LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Append Child problem, violates DOM model?

Solved!
Go to solution

Hello,

 

I'm very new to LV, please be gentle 🙂

 

I'm trying to create an XML document based on some input from a cluster (eventually this will be a sub VI, for now only working on test data).

 

Everything works fine up until the second 'Append Child' invocation. At that point I'm told that I'm trying to insert the node at 'a wrong place'. I'm guessing I'm violating the DOM model somehow, but for the life of me I can't figure out how or why. Seems to me I'm duplicating exactly how the first child is appended, and I should be able to insert new nodes more or less where I please.

 

What I want to end up with is a structure like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<files>
    <file>
        <filename>image0.png</filename>
        <date>28 oct 2014</date>
        <time>06:45:12</time>
        <test>
            <testname>Black Phasing</testname>
            <result>Passed</result>
            <info>1000 um offset</info>
        </test>
    </file>
</files>

 Eventually there will be several <test> nodes per <file>.

 

I see that I've left out the <file> node in my code, but that's irrelevant for the time being. What I'm looking for is any tips and thoughts on what might be wrong, suggestions on what to look into.

 

Regards,

-Tobias

0 Kudos
Message 1 of 3
(2,899 Views)

well, I've dumbed it down some and must have tried a dozen different solutions, but I simply can't figure how to add a child to a child, so to speak. Have not even been able to add two children at the same level.

 

Am I just a noob par excellence, or could it really be impossible to create an XML doc with more than 1 level?

 

I will be looking into the 3rd party solutions as seems to be the consensus on the forum, but still would really like to see a solution using only the functions / VIs provided by NI.

0 Kudos
Message 2 of 3
(2,867 Views)
Solution
Accepted by topic author Tobias_Jønch

Finally. That wasn't easy to find.

 

https://decibel.ni.com/content/docs/DOC-16162

0 Kudos
Message 3 of 3
(2,860 Views)