Jump to content


Photo

Extensible Capability of XML Files


  • Please log in to reply
2 replies to this topic

#1 amaggs145

amaggs145
  • Members
  • 25 posts

Posted 23 April 2012 - 08:08 PM

One of my colleagues that I work with uses Perl to read & write XML files. One on the features that he likes most about this is that the XML files are extensible in the sense that more information can be added to the files later without breaking previous code that was used to write and read the original version of the files before additional information was added.

I was wondering if there is some tip or trick to having this same capability with the VI's available in the XML toolkit. One way that I was thinking of was instead of using "Easy Read XML File.vi" directly I could read the all the data within the file first with LAbVIEW's file read VI's, then do some processing on the text to extract only necessary data and then use "Easy Parse XML.vi" on select portions of the file.

There may be some other method that would require less custom coding for each file. Thanks for any input.

Regards,
Anthony
  • 0

#2 Jim Kring

Jim Kring
  • JKI Team
  • 1,267 posts

Posted 26 April 2012 - 07:59 PM

On trick you can use, is to use a string data type in LabVIEW for an XML element (I think you also need to name the string with an " #xml" suffix). The result is that the raw XML data will be read into/from the string and then can be processed in a separate step. This is especially helpful if elements (having the same name) come in a few different flavors (sub-element types and structure).
  • 0

#3 Jim Kring

Jim Kring
  • JKI Team
  • 1,267 posts

Posted 09 August 2016 - 06:07 PM

Update: I've added a little bit of documentation about this, here:

 

https://github.com/J...tring-labelname


  • 0