11-26-2014 09:22 AM
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
Solved! Go to Solution.
11-27-2014 08:31 AM
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.
11-27-2014 09:37 AM