03-20-2013 10:17 AM
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>
Solved! Go to Solution.
03-20-2013 10:25 AM
I usually use the Get XML (Pretty Print) method and save that to a text file.
03-20-2013 10:31 AM
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.
03-20-2013 10:39 AM
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.
03-20-2013 10:44 AM
@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?
03-20-2013 10:53 AM
@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.