c# Xml ADD A XML NODE AS A CHILD TO A PARTICULAR OTHER NODE
- by kacalapy
i have an xml doc with a structure like this:
below is supposed to be XML but i dont know how to format it so it will show correct so i used [ ] instead of the typical <
[Book]
[Title title="Door Three"/]
[Author name ="Patrick"/]
[/Book]
[Book]
[Title title="Light"/]
[Author name ="Roger"/]
[/Book]
i want to be able to PROGRAMMATICALY add xml nodes to this xml in a particular place. lets say i wanted to add a Link node as a child to the author node where the name is Roger (or whatever dynamic value is passed in here).
i think its best if the function containing this logic is passed a param for the name to add an xml node under, please advise and whats the code i need to add xml nodes to a certain place in the xml?
now i am using .AppendChild() method but it doesn't allow for me to specify a parent node to add under...
thanks all.