Insert XML node before specific node using c#

Posted by sam on Stack Overflow See other posts from Stack Overflow or by sam
Published on 2010-06-09T09:45:47Z Indexed on 2010/06/09 9:52 UTC
Read the original article Hit count: 246

Filed under:
|

This is my XML file

<employee>
  <name ref="a1" type="xxx"></name>
  <name ref="a2" type="yyy"></name>
  <name ref="a3" type="zzz"></name>
</employee>

Using C#, I need to insert this node

<name ref="b2" type="aaa"></name>

between the "a2" and "a3" nodes. Any pointer how to sort this out?

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml