c# Xml ADD A XML NODE AS A CHILD TO A PARTICULAR OTHER NODE
Posted
by kacalapy
on Stack Overflow
See other posts from Stack Overflow
or by kacalapy
Published on 2010-05-01T16:05:25Z
Indexed on
2010/05/01
16:07 UTC
Read the original article
Hit count: 483
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.
© Stack Overflow or respective owner