whitesox99
MIS
Hi,
How can I rearrange contents of xml. For example in the following sample under <details> I have several <body> tags and each body tag contains <linenume> tag that shows the sequence of <body> tags. In the following sample I have <linenume>2</linenume> then <linenume>1</linenume> then <linenume>4</linenume> and finally <linenume>3</linenume>. I need <linenume>1</linenume> then <linenume>2</linenume> then <linenume>3</linenume> and finally <linenume>4</linenume> to be arrange in that sequence in the final output.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<details>
<body>
<linenume>2</linenume>
<linevalue>222</linevalue>
<linedesc>Two</linedesc>
</body>
<body>
<linenume>1</linenume>
<linevalue>111</linevalue>
<linedesc>One</linedesc>
</body>
<body>
<linenume>4</linenume>
<linevalue>444</linevalue>
<linedesc>Four</linedesc>
</body>
<body>
<linenume>3</linenume>
<linevalue>333</linevalue>
<linedesc>Three</linedesc>
</body>
</details>
</note>
Here is what I need to have the final output. Any small sample will help alot.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<details>
<body>
<linenume>1</linenume>
<linevalue>111</linevalue>
<linedesc>One</linedesc>
</body>
<body>
<linenume>2</linenume>
<linevalue>222</linevalue>
<linedesc>Two</linedesc>
</body>
<body>
<linenume>3</linenume>
<linevalue>333</linevalue>
<linedesc>Three</linedesc>
</body>
<body>
<linenume>4</linenume>
<linevalue>444</linevalue>
<linedesc>Four</linedesc>
</body>
</details>
</note>
thanks
How can I rearrange contents of xml. For example in the following sample under <details> I have several <body> tags and each body tag contains <linenume> tag that shows the sequence of <body> tags. In the following sample I have <linenume>2</linenume> then <linenume>1</linenume> then <linenume>4</linenume> and finally <linenume>3</linenume>. I need <linenume>1</linenume> then <linenume>2</linenume> then <linenume>3</linenume> and finally <linenume>4</linenume> to be arrange in that sequence in the final output.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<details>
<body>
<linenume>2</linenume>
<linevalue>222</linevalue>
<linedesc>Two</linedesc>
</body>
<body>
<linenume>1</linenume>
<linevalue>111</linevalue>
<linedesc>One</linedesc>
</body>
<body>
<linenume>4</linenume>
<linevalue>444</linevalue>
<linedesc>Four</linedesc>
</body>
<body>
<linenume>3</linenume>
<linevalue>333</linevalue>
<linedesc>Three</linedesc>
</body>
</details>
</note>
Here is what I need to have the final output. Any small sample will help alot.
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<details>
<body>
<linenume>1</linenume>
<linevalue>111</linevalue>
<linedesc>One</linedesc>
</body>
<body>
<linenume>2</linenume>
<linevalue>222</linevalue>
<linedesc>Two</linedesc>
</body>
<body>
<linenume>3</linenume>
<linevalue>333</linevalue>
<linedesc>Three</linedesc>
</body>
<body>
<linenume>4</linenume>
<linevalue>444</linevalue>
<linedesc>Four</linedesc>
</body>
</details>
</note>
thanks