Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
I have a xml which conatins the basic match data now I need to reorder it and update the id's of that node.

 Here is my xml -
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Match>
<Matchdetail Id="1">Bla..Bla..Bla</Matchdetail>
 <Elements>
 <Element Sequence="8"> Bla..Blaa..Bla..</Element>
<Element Sequence="2"> Bla..Blaa..Bla..</Element>
<Element Sequence="3"> Bla..Blaa..Bla..</Element>
<Element Sequence="6"> Bla..Blaa..Bla..</Element>
<Element Sequence="10"> Bla..Blaa..Bla..</Element>
</Elements>
</ Match>

Now i want to update the Sequence in uniform order. so what i want is look like this -

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Match>
<Matchdetail Id="1">Bla..Bla..Bla</Matchdetail>
<Elements>
<Element Sequence="1"> Bla..Blaa..Bla..</Element>
<Element Sequence="2"> Bla..Blaa..Bla..</Element>
<Element Sequence="3"> Bla..Blaa..Bla..</Element>
<Element Sequence="4"> Bla..Blaa..Bla..</Element>
<Element Sequence="5"> Bla..Blaa..Bla..</Element>
</Elements>
</ Match>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900