12-18-2012 03:13 AM
My problem is that a program writes all xml reports to one file and it is no longer readable using IE. I get an error message: "Only one top level element is allowed in an XML document."
So I need to separate reports into own xml files. I know that a report ends to </Reports> and next one begins with <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
How can I search <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> mark from an xml file which includes all reports and separate every report to own file?
I use LV 8.5.1.
BR,
Jick
12-18-2012 08:25 AM
Is the program generating the report written in LV? If so you should probably consider fixing it. If its not written in LV you should get whoever did write it to fix it.
In the mean time, XML is just a text format so you could read the entire file in, and use the standard string search/parsing functions in LV to look for the 2nd header and write the two parts back out to separate files. If the file is very large, you can follow the same basic procedure, but only read chunks of the file (a couple thousand bytes or so) at one time.
Mike...