<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Format XML data in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075405#M1171663</link>
    <description>&lt;P&gt;There should be no need for linebreaks in XML, they are only there for better human(!) readability. Maybe, some odd software needs them, too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp; XML documents in LabVIEW have the method "pretty print", which returns the document as XML with linebreaks and indentation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xml.png" style="width: 141px;"&gt;&lt;img src="https://ip1.i.lithium.com/51febdf3443a1305624dc534c3df166b9ba7d2d9/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373137373769394443463145394631454237313630452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="xml.png" alt="xml.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Aug 2020 18:51:35 GMT</pubDate>
    <dc:creator>Sebastian.Weber</dc:creator>
    <dc:date>2020-08-16T18:51:35Z</dc:date>
    <item>
      <title>Format XML data</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075392#M1171659</link>
      <description>&lt;P&gt;Hi team ,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wrote a data into XML file , but format was i need to change&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All data are written in a single line .&amp;nbsp; All parameters name and data need to write in separate new line&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How i need to modify and write.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please suggest&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2020 16:05:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075392#M1171659</guid>
      <dc:creator>willcan</dc:creator>
      <dc:date>2020-08-16T16:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Format XML data</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075405#M1171663</link>
      <description>&lt;P&gt;There should be no need for linebreaks in XML, they are only there for better human(!) readability. Maybe, some odd software needs them, too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However,&amp;nbsp; XML documents in LabVIEW have the method "pretty print", which returns the document as XML with linebreaks and indentation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xml.png" style="width: 141px;"&gt;&lt;img src="https://ip1.i.lithium.com/51febdf3443a1305624dc534c3df166b9ba7d2d9/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373137373769394443463145394631454237313630452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="xml.png" alt="xml.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Aug 2020 18:51:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075405#M1171663</guid>
      <dc:creator>Sebastian.Weber</dc:creator>
      <dc:date>2020-08-16T18:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Format XML data</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075503#M1171697</link>
      <description>&lt;P&gt;Hi &lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/603878"&gt;@willcan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check &lt;A title="JKI Easy XML" href="https://forums.ni.com/t5/%E0%AE%A4%E0%AE%AE%E0%AE%BF%E0%AE%B4%E0%AE%BF%E0%AE%A9%E0%AE%BF/XML-format-data/gpm-p/4075496#M7" target="_self"&gt;this&lt;/A&gt; post.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 09:17:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4075503#M1171697</guid>
      <dc:creator>Its_Me_Ashiq(ஆஷிக்)</dc:creator>
      <dc:date>2020-08-17T09:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Format XML data</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4079106#M1173237</link>
      <description>&lt;P&gt;Hi sebastian weber,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the data for 1 set&amp;nbsp; . But i am in need to display data&amp;nbsp; for multiple tagname after a completion first tagname ( data set ) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all data should be printed in a same document (multiple tagname ) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i got a error . please find attachment of error and model format&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2020 16:12:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4079106#M1173237</guid>
      <dc:creator>willcan</dc:creator>
      <dc:date>2020-08-29T16:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Format XML data</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4079289#M1173306</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have a SubVI which inserts the nodes, which I have not on my system. Therefore, I use pure method / property calls here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snip.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/9946812fc4b9ce76d01fedbcd4f7ab1076eab12c/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373235333869363942303637454245363130353645392f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Snip.png" alt="Snip.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The point is to create an element (just the tag) and a text node (the value). The text node is appended to the element, and this element is appended to the &amp;lt;TestData&amp;gt; element.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output of the "Generated XML" indicator is:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="no" ?&amp;gt;&amp;lt;TestData&amp;gt;&amp;lt;S.no&amp;gt;1&amp;lt;/S.no&amp;gt;&amp;lt;Testcase&amp;gt;Name&amp;lt;/Testcase&amp;gt;&amp;lt;LOLIM&amp;gt;0&amp;lt;/LOLIM&amp;gt;&amp;lt;HILIM&amp;gt;5&amp;lt;/HILIM&amp;gt;&amp;lt;Rule&amp;gt;NA&amp;lt;/Rule&amp;gt;&amp;lt;Unit&amp;gt;unit&amp;lt;/Unit&amp;gt;&amp;lt;Result&amp;gt;Test Failed&amp;lt;/Result&amp;gt;&amp;lt;/TestData&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and the output of the "PrettyXML" indicator is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="no" ?&amp;gt;&lt;BR /&gt;&amp;lt;TestData&amp;gt;&lt;BR /&gt;  &amp;lt;S.no&amp;gt;1&amp;lt;/S.no&amp;gt;&lt;BR /&gt;  &amp;lt;Testcase&amp;gt;Name&amp;lt;/Testcase&amp;gt;&lt;BR /&gt;  &amp;lt;LOLIM&amp;gt;0&amp;lt;/LOLIM&amp;gt;&lt;BR /&gt;  &amp;lt;HILIM&amp;gt;5&amp;lt;/HILIM&amp;gt;&lt;BR /&gt;  &amp;lt;Rule&amp;gt;NA&amp;lt;/Rule&amp;gt;&lt;BR /&gt;  &amp;lt;Unit&amp;gt;unit&amp;lt;/Unit&amp;gt;&lt;BR /&gt;  &amp;lt;Result&amp;gt;Test Failed&amp;lt;/Result&amp;gt;&lt;BR /&gt;&amp;lt;/TestData&amp;gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I noticed that PrettyPrint always inserts two linebreaks, so I replace them with a single one in my code.&lt;/P&gt;
&lt;P&gt;Of course, you can simply replace "&amp;gt;" by "&amp;gt;\n" in the original XML, but PrettyXML also does indentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, there's one problem with your tags. Due to the XML standard, a tag must not have a whitespace in it. Otherwise, it is not valid XML.&lt;/P&gt;
&lt;P&gt;Some of your tags have a trailing white space, and "test case" consists of two words. So, this is not allowed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 10:56:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Format-XML-data/m-p/4079289#M1173306</guid>
      <dc:creator>Sebastian.Weber</dc:creator>
      <dc:date>2020-08-31T10:56:57Z</dc:date>
    </item>
  </channel>
</rss>

