|
Subject: Re: [xsl] How to sort Using Dom and SelectNodes From: Rick Taylor <taylor@xxxxxxxx> Date: Wed, 04 Jun 2003 13:34:35 -0600 |
<xsl:template match="xml">
<xsl:apply-templates select="FLD[@order]">
<xsl:sort select="@order" data-type="number"/>
</xsl:apply-templates>
</xsl:template> <xsl:template match="FLD">
<xsl:value-of select="."/>
</xsl:template>Hello,
I have a simple selectnodes method which grabs nodes from a nodes list who have the attribute ORDER. I'd actually like to select and then order the result based on the value of the ORDER attribute. So:
<xml> <FLD order="3">run</FLD> <FLD order="1">See</FLD> <FLD>foo</FLD> <FLD order="2">spot</FLD> <FLD>bar</FLD> </xml>
Would yield the result fragment (tree?): <FLD order="1">See</FLD> <FLD order="2">spot</FLD> <FLD order="3">run</FLD>
How can I achieve this?
Karl
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Rick Taylor XML Developer PPDM Association
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] How to sort Using Dom and Sel, Karl J. Stubsjoen | Thread | Re: [xsl] How to sort Using Dom and, Karl J. Stubsjoen |
| RE: [xsl] importing/including a sty, Robert Koberg | Date | [xsl] merging multiple xml files, RPeterson |
| Month |