02-21-2017 10:54 AM
I use LabViews XML parser to edit some XML files. Everything is working fine, but one thing bothers me - all the appends etc are done in a single line. Since I append ~50k children to a node it start to be a problem, as it produces a very long line in the XML, that makes it very hard to edit manually or even to view.
Is it possible to change, so that the LabView will add end-line characters (any kind of them would be good).
Solved! Go to Solution.
02-21-2017 12:24 PM
@nikodem wrote:
I use LabViews XML parser to edit some XML files. Everything is working fine, but one thing bothers me - all the appends etc are done in a single line. Since I append ~50k children to a node it start to be a problem, as it produces a very long line in the XML, that makes it very hard to edit manually or even to view.
Is it possible to change, so that the LabView will add end-line characters (any kind of them would be good).
Perhaps there isn't a problem with the way LabVIEW is saving the files, but on how you are viewing them. LabVIEW uses a single newline (I think). If your viewer is expecting cr+lf then you might see what you are seeing. View it in notepad ++ and you can see if there are any EOL.
02-22-2017 01:13 AM
I have checked this, as suggested, in Notepad++ (that I actually use to view these XMLs by default) and still there is no CR or LF at the end of the nodes.
This is not crucial, actually, as the XML definition does not ask to have these end-of-lines - it only parses tags (and this single-line format is okay for any XML input) it is only a problem for human viewing of the file... and the fact that this line is 11 558 805 characters long
02-22-2017 01:48 AM
Add a newline between > and < 🙂
/Y
02-22-2017 02:07 AM
@Yamaeda wrote:
Add a newline between > and < 🙂
/Y
This will definitely work, but this is as elegant as parsing XML only with Match Regular Pattern VI - not my pair of shoes.
02-22-2017 05:08 PM
There are other XML parsers for LabVIEW ... [The XML produced will be slightly different, but consistent].
Bob Schor
02-23-2017 12:43 AM
I'm aware of this Bob, but I'm limited here and have to use this tool.
02-23-2017 02:13 AM
What you want is a pretty print XML.
You can do that with an XML invoke node. There is an option to save the document normal or Pretty Print.
02-23-2017 07:50 AM
Simplest and best solution!