amaggs145 1 Posted April 23, 2012 Report Share Posted April 23, 2012 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 Quote Link to post Share on other sites
Jim Kring 133 Posted April 26, 2012 Report Share Posted April 26, 2012 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). Quote Link to post Share on other sites
Jim Kring 133 Posted August 9, 2016 Report Share Posted August 9, 2016 Update: I've added a little bit of documentation about this, here: https://github.com/JKISoftware/JKI-EasyXML/blob/master/README.md#reading-raw-xml-into-strings-using-the-xml-suffix-in-string-labelname Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.