09-17-2019 03:43 AM
Hello All,
i am working with this big xml.I am reading a part of it and editing it and writing back . While Writing back I am deleting the existing nodes and build up new nodes and writing them . My problem is when i am writing the new nodes are being inserted at the bottom i want to insert them at the original place
Eg:-
Original
<Main>
<Machine NUM=1/>
<Machine NUM=2/>
<Material NUM=1/>
<Material NUM=2/>
</Main>
What i get after writining back
<Main>
<Material NUM=1/>
<Material NUM=2/>
<Machine NUM=1/>
<Machine NUM=2/>
<Machine NUM=3/>
</Main>
What i want
<Main>
<Machine NUM=1/>
<Machine NUM=2/>
<Machine NUM=3/>
<Material NUM=1/>
<Material NUM=2/>
</Main>
Solved! Go to Solution.
09-17-2019 07:41 AM
It is extremely difficult to see what you are doing from the partial Snippet you attached. There are broken wires, data structures (like Nodes) that I don't understand, etc.
I think you have the "wrong algorithm". Here (without knowing the details of your data structure, and not knowing how you make decisions) is one possibility:
Bob Schor
09-17-2019 03:37 PM
09-18-2019 05:43 AM
Hallo bob schor
soory i didnt think the rest of the vi would help in knowing the data structure as you can see i am sending a 2d array and a 1 d array and making a cluster5 out of them toi place them in required format. the xml format is a bit complex .
its like this
<Main>
<Machine1 Attr1 Attr2 ...>
<Node1 Attr1 Attr2../>
<Node2 Attr1 Attr2../>
</Machine1>
<Machine2 Attr1 Attr2 ...>
<Node1 Attr1 Attr2../>
<Node2 Attr1 Attr2../>
</Machine2>
...
Smae for material
</Main>.
Hallo Ben 64,
I realise that but I didnt find any examples with insert method Can you please provide me with some reference
Thanks,
09-18-2019 08:03 AM
@anilkumarmuppirala18 wrote:
Hallo bob schor
soory i didnt think the rest of the vi would help in knowing the data structure as you can see i am sending a 2d array and a 1 d array and making a cluster5 out of them toi place them in required format. the xml format is a bit complex .
I'm sorry, but you "Just Don't Get It" (I probably wasn't sufficiently clear, but I'll explain, here). You say "as you can see", but that's exactly the point, I cannot "see". What you attached was a picture where everything was very tiny, impossible (for me) to see without doing a lot of unnecessary work, while if you attached your LabVIEW VI, I would just open LabVIEW, see all the VIs and wires at "normal size", easily visible, and if I wanted to "simplify" it or straighten out the wires, I could do that. I could also test it, be sure I understood how it worked, and possibly been able to actually suggest code changes.
But OK, I'll let someone else strain their eyes trying to help you. I was just hoping you were willing to make a small effort to help me to help you ...
Bob Schor
09-18-2019 08:08 AM - edited 09-18-2019 08:10 AM
hello bob i am attaching the vi
09-18-2019 09:08 AM
09-19-2019 03:08 AM
Thank you very much ben that worked like a charm . sorry i could not share the xml as i am not allowed to share it . Thnaks for you help O:-)