Altova Mailing List Archives


[xsl] Need help with sorting.

From: "Austin, Darrel" <Darrel.Austin@------------------>
To:
Date: 3/27/2007 3:20:00 PM
Thanks, everyone, for help with getting my select statement in shape!
I'm now stuck on sorting the elements that I matched from the select
statement.

My XML:

<xsl:template match="/">
	<xsl:for-each select="//menuItem[pageID =
$pageID]/descendant-or-self::menuItem">
		<xsl:sort select="translate(@lastUpdate, '/', '')"
data-type="number"/>
		<xsl:call-template name="createItem" />
	</xsl:for-each>
</xsl:template>

<xsl:template name="createItem">
	lastUpdate: <xsl:value-of select="lastUpdate"/>
	browserTitle: <xsl:value-of select="browserTitle"/>
	pageID: <xsl:value-of select="pageID"/>
</xsl:template>

Andrew gave me ths shortened syntax for my SORT command.

The problem is that the above isn't sorting the output. I just get the
items in the order they were in the XML file. Is it because I'm not
sorting the group, but rather each individual node by itself? If so,
where should I move the SORT command to get around that?

-Darrel

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.