How to insert element after specific element in xml ?

  • Thread starter Thread starter E.F
  • Start date Start date
E

E.F

Hi,

i try to manage xml with vb.net and i have to insert
this element between 2 elements:
<QUATRE Attr_1="400" Attr_2="100" />
in my xml file witch is looking like that :

<TEST>
<Etape_1>
<NEUF Attr_1="400" Attr_2="100" />
<DIX Attr_1="400" Attr_2="100" />
<ONZE Attr_1="400" Attr_2="100" />
</Etape_1>
<Etape_2>
<UN Attr_1="400" Attr_2="100" />
<DEUX Attr_1="400" Attr_2="100" />
<TROIS Attr_1="400" Attr_2="100" />
-----> here is the place where my element shoud be inserted<-----------
<CINQ Attr_1="400" Attr_2="100" />
</Etape_2>
</TEST>

Does anybody can show me the way to do ?

Thank you for your attention,

Etienne
 
Hi,

i try to manage xml with vb.net and i have to insert
this element between 2 elements:
<QUATRE Attr_1="400" Attr_2="100" />
in my xml file witch is looking like that :

<TEST>
<Etape_1>
<NEUF Attr_1="400" Attr_2="100" />
<DIX Attr_1="400" Attr_2="100" />
<ONZE Attr_1="400" Attr_2="100" />
</Etape_1>
<Etape_2>
<UN Attr_1="400" Attr_2="100" />
<DEUX Attr_1="400" Attr_2="100" />
<TROIS Attr_1="400" Attr_2="100" />
-----> here is the place where my element shoud be inserted<-----------
<CINQ Attr_1="400" Attr_2="100" />
</Etape_2>
</TEST>

Does anybody can show me the way to do ?

Thank you for your attention,

Etienne

which class are you using to parse your xml?
take a look: http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.insertafter(VS.80).aspx

Thiago
 
Back
Top