This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Sorting by attribute
- To: "'XSL-List at mulberrytech dot com'" <XSL-List at mulberrytech dot com>
- Subject: Sorting by attribute
- From: Eric Taylor <Eric dot Taylor at RealPage dot com>
- Date: Thu, 31 Aug 2000 14:18:00 -0500
- Reply-To: xsl-list at mulberrytech dot com
My XML looks something like this:
<related>
<para><link internal="part2" text="c"/></para>
<para><link page="test 1" text="a"/></para>
<para><link page="test 2" text="d"/></para>
<para><link page="test 3" text="b"/></para>
</related>
I want to apply the link template to each of these, sorting them based on
what's in the text attribute. I tried the following but got an "unspecified
error when I tried to display with IE5:
<xsl:template match="related">
<xsl:for-each select="para">
<xsl:sort select="link/@text"/>
<div><xsl:apply-templates/></div>
</xsl:for-each>
</xsl:template>
Could someone kindly set me straight. Thanks. Eric
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list