How to Sort XML message

Here should go questions about transforming XML with XSLT and FOP.
satishu
Posts: 2
Joined: Thu Nov 08, 2007 9:58 am
Location: Kakinada

How to Sort XML message

Post by satishu »

Hi all,


I am working as an XI developer, we are using XSLT mapping programms in XI. Now i have a requirement like I am sending from one XML message to another XML message. here my requirement is suppose I have a XML structure like bellow.

<List>
<EMID>1002</EMID>
<Ename>AAA</Ename>
<DeptID>10</DeptID>
<List>
<List>
<EMID>1003</EMID>
<Ename>BBB</Ename>
<DeptID>10</DeptID>
<List>
<List>
<EMID>1001</EMID>
<Ename>CCC</Ename>
<DeptID>10</DeptID>
<List>

I want to sort this structure with EMID wise and send to target as bellow
<List>
<EMID>1001</EMID>
<Ename>CCC</Ename>
<DeptID>10</DeptID>
<List>
<List>
<EMID>1002</EMID>
<Ename>AAA</Ename>
<DeptID>10</DeptID>
<List>
<List>
<EMID>1003</EMID>
<Ename>BBB</Ename>
<DeptID>10</DeptID>
<List>


How can I achive this requirement.


Thanks in advance,
Satish
jkmyoung
Posts: 89
Joined: Mon Mar 06, 2006 10:13 pm

Post by jkmyoung »

<xsl:for-each select="List">
<xsl:sort select="EMID"/>
<xsl:copy-of select="."/>
</xsl:for-each>
Post Reply