I am using Libxml2 Every time i am adding new nodes to the existing XML document. Adding new nodes is fine but what ever i added nodes in the XML document it added last of the child node but i want to add new nodes after the root node.
Asked
Active
Viewed 462 times
-1
-
How are you adding nodes? Which child node do you mean when you say "it added last of the child node"? – nwellnhof Mar 02 '17 at 20:58
1 Answers
0
Once you've created your new node, you can get use xmlAddPrevSibling on the current first child of the root to get your new node inserted "before" the current first child.

Jason Viers
- 1,722
- 12
- 20