How to insert element after specific element in xml ?

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
 
T

Thiago Macedo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top