Subject: [xsl] Sort By Multiple Values? From: "Wei, Alice Ju-Hsuan" <ajwei@xxxxxxxxxxx> Date: Thu, 27 Dec 2007 13:23:21 -0500 |
Hi, I have a document here where I am attempting to sort it using multiple valu= es. Here is the XML: <computer> <language> <ability rank=3D"1">XML 1.0</ability> <type>XML</type> </language> <language> <ability rank=3D"1">XSLT 1.0</ability> <type>XML</type> </language> <language> <ability rank=3D"2">XSLT 2.0</ability> <type>XML</type> </language> <language> <ability rank=3D"1">HTML 4.01 / XHTML 1.0</ability> <type>HTML</type> </language> <language> <ability rank=3D"1">CSS</ability> <type>HTML</type> </language> </computer> The XSL: <xsl:template match=3D"computer"> [<span class="skills"> <xsl:apply-templates select="language"> <xsl:sort select="@rank" order="ascending"/> </xsl:apply-templates> </span>] </xsl:template> The output now is in the same order as it is in the order of the document w= hen the @rank value is 1, and followed by the one where @rank=3D2. [XML 1.0] [XSLT 1.0] [HTML 4.01/XHTML 1.0] [CSS] [XSLT 2.0]. Is it possible that I can get it to display as [CSS] [HTML 4.01/XHTML 1.0] [XML 1.0] [XSLT 1.0] [XSLT 2.0] ? Thanks to those who can help. --------------------------------------- Alice Wei MIS 2008 School of Library and Information Science Indiana University Bloomington ajwei@xxxxxxxxxxx 812-856-2659
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] (Auto-)detecting which XM, Colin Paul Adams | Thread | Re: [xsl] Sort By Multiple Values?, Alice Wei |
RE: [xsl] xalan and replace "regex", Michael Kay | Date | Re: [xsl] Sort By Multiple Values?, Alice Wei |
Month |