LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

End lines in XML files

Solved!
Go to solution

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).

0 Kudos
Message 1 of 9
(4,718 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 9
(4,693 Views)

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 Robot Sad

0 Kudos
Message 3 of 9
(4,664 Views)

Add a newline between > and < 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 9
(4,659 Views)

@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. Smiley LOL

0 Kudos
Message 5 of 9
(4,654 Views)

There are other XML parsers for LabVIEW ...  [The XML produced will be slightly different, but consistent].

 

Bob Schor

0 Kudos
Message 6 of 9
(4,639 Views)

I'm aware of this Bob, but I'm limited here and have to use this tool.

0 Kudos
Message 7 of 9
(4,633 Views)
Solution
Accepted by topic author nikodem

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. 

Message 8 of 9
(4,624 Views)

Simplest and best solution!

0 Kudos
Message 9 of 9
(4,610 Views)