Subject: Re: [xsl] sibling sorting From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 31 May 2018 12:48:53 -0000 |
Dear All,
Here is my XML: B B B B B B B B B B B B B B <descriptor> B B B B B B B B B B B B B B B B B <mainterm weight="a">dexmedetomidine</mainterm> B B B B B B B B B B B B B B B B B <link>zdverse drug reaction - disease</link> B B B B B B B B B B B B B B B B B <sublink>xerostomia</sublink> B B B B B B B B B B B B B B B B B <sublink>nausea</sublink> B B B B B B B B B B B B B B B B B <link>drug therapy</link> B B B B B B B B B B B B B B B B B <sublink>respiration depression</sublink> B B B B B B B B B B B B B B B </descriptor>
The required output is:
B B B B B B B B B B B B B B <descriptor> B B B B B B B B B B B B B B B B B <mainterm weight="a">dexmedetomidine</mainterm> B B B B B B B B B B B B B B B B B <link>drug therapy</link> B B B B B B B B B B B B B B B B B <sublink>respiration depression</sublink> B B B B B B B B B B B B B B B B B <link>zdverse drug reaction - disease</link> B B B B B B B B B B B B B B B B B <sublink>nausea</sublink> B B B B B B B B B B B B B B B B B <sublink>xerostomia</sublink> B B B B B B B B B B B B B B B </descriptor>
My XSLT:
B B B <xsl:template match="ani:descriptor">
B B B B B B <xsl:copy>
B B B B B B B B B <xsl:copy-of select="@*"/>
B B B B B B B B B <xsl:apply-templates>
B B B B B B B B B B B B <xsl:sort select="ani:link|ani:sublink" order="ascending" data-type="text"/>
B B B B B B B B B </xsl:apply-templates>
B B B B B B </xsl:copy>
B B B </xsl:template>
In the XML both the link and sublink elements are sibling to each other, first links have to sorted then sublink. With the above XSLT i am getting the output same as input. Help in this regard is appreciated.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] sibling sorting, Ganesh Babu N nbabug | Thread | Re: [xsl] sibling sorting, Ganesh Babu N nbabug |
[xsl] sibling sorting, Ganesh Babu N nbabug | Date | Re: [xsl] sibling sorting, Ganesh Babu N nbabug |
Month |