LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i use close VI for XML?

Solved!
Go to solution

Hi

 

I seem to have trouble understanding how to properly instantiate and close XML blocks. While the attached program shows no initial errors, when running it i get an error about attempting to create an invalid document. Can someone give a simple explanation as for how do i close this kind on blocks or prompt me to where i can read further details about this issue? I have found the 'Help' function somewhat vague.

 

Thanks

0 Kudos
Message 1 of 4
(1,368 Views)

You are closing your document inside the FOR loop.  Remove the Close that is in the top level FOR loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,357 Views)
Solution
Accepted by topic author AndreiV

Ok, I did a little more digging and cleaning up.  One of your main issues is that you need an overall element to put things into (XML is weird).  After that, I did some more cleaning up and attached is the result.  I didn't spend a lot of time cleaning, but I highly recommend you consider subVIs to eliminate duplicate code (such as the Add Element).  I find it useful in these situations to line up things based on references (keep the reference wires as straight as possible instead of the error wire).  It just makes it easier to keep track of the references.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(1,328 Views)

Thanks for the details!

0 Kudos
Message 4 of 4
(1,297 Views)