LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW XML VIs omit Line feeds

Solved!
Go to solution
Highlighted

Hopefully I'm missing something really simple here... I am creating an XML file, adding a few nested child nodes, and saving the XML. This all works ok except for the fact that LabVIEW does not insert line feeds (or any whitespace for that matter) between my nodes. This makes the resulting document nearly unreadable by humans, which was the entire point of storing this data in XML to begin with. Any suggestions? Essentially, the output of LabVIEW's XML VIs is this:

<InstrumentList><PS_VIN Version="1.0"><Data></Data></PS_VIN></INSTRUMENTList>

 

And what I really want is this:

<InstrumentList>

    <PS_VIN Version="1.0">

        <Data>

        </Data>

    </PS_VIN>

</INSTRUMENTList>

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 1 of 6
(1,345 Views)
Highlighted

I usually use the Get XML (Pretty Print) method and save that to a text file.

Message 2 of 6
(1,342 Views)
Highlighted

Is there really no XML save VI that saves with reasonable syntax? FYI, your solution works, I'd just like to know if there is a way to do this without saving as a text file.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 3 of 6
(1,338 Views)
Highlighted
Solution
Accepted by topic author Charles_CLA

There is also a Save File (Pretty Print) method you could use. 

 

I am usually messing with the text that is why I use the Get XML and save the text.

0 Kudos
Message 4 of 6
(1,330 Views)
Highlighted

 


@Darin.K wrote:

There is also a Save File (Pretty Print) method you could use. 

 

I am usually messing with the text that is why I use the Get XML and save the text.


Thanks Darin, that works great! Any guesses as to why that isn't the default save method?

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 5 of 6
(1,324 Views)
Highlighted

@Charles_CLA wrote:

 Thanks Darin, that works great! Any guesses as to why that isn't the default save method?


<plug type="shameless">

 

If we add this:

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-LV-version-info-to-Help/idi-p/2324150

 

Then we could look in the help file and see that the Pretty Print functionality for Get XML and Save XML was added in LV9 and was not there in the original VIs in LV8.6.

</plug>

 

My guess is that they never got around to updating the VIs in the palettes.

0 Kudos
Message 6 of 6
(1,320 Views)