I have an XML file and I upload it to Xmldocument. This document has a node with some child nodes, such as
<xml here>
<somenode>
<child> </child>
<children></children>
<children></children>
<children></children> // I need to insert it
<children></children> // I need to insert this second time
<children></children>
<children></children>
<child> </child>
<somenode>
<xml here>
here somenode has several children, where the names of the first and last child node names are the same, since other nodes, except the first and last node, have some other name (identical to each other). I am creating a function to insert a node at a specific position, I'm not sure about the criteria, but may be in the middle.
- how can i insert a node at a specific position. I am using the XMLnode.appendChild method to insert
- Do I need to reorder / sort nodes after insertion. Please suggest.
- How can I determine what a structure is and how should I find where a new node should be added in accordance with the current structure of the document.