[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sibling sorting

Subject: sibling sorting
From: "Ganesh Babu N nbabuganesh@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 May 2018 12:41:11 -0000
 sibling sorting
Dear All,

Here is my XML:
               <descriptor>
                  <mainterm weight="a">dexmedetomidine</mainterm>
                  <link>zdverse drug reaction - disease</link>
                  <sublink>xerostomia</sublink>
                  <sublink>nausea</sublink>
                  <link>drug therapy</link>
                  <sublink>respiration depression</sublink>
                </descriptor>

The required output is:

               <descriptor>
                  <mainterm weight="a">dexmedetomidine</mainterm>
                  <link>drug therapy</link>
                  <sublink>respiration depression</sublink>
                  <link>zdverse drug reaction - disease</link>
                  <sublink>nausea</sublink>
                  <sublink>xerostomia</sublink>
                </descriptor>

My XSLT:

    <xsl:template match="ani:descriptor">
        <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates>
                <xsl:sort select="ani:link|ani:sublink" order="ascending"
data-type="text"/>
            </xsl:apply-templates>
        </xsl:copy>
    </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.

Regards,
Ganesh

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.