updated example to show descending order

This commit is contained in:
kvisco%ziplink.net 2000-04-12 11:26:26 +00:00
parent a7dee3de3d
commit 6a196acd08
2 changed files with 59 additions and 13 deletions

View File

@ -7,11 +7,17 @@
<BODY>
<P ALIGN="CENTER">
<B>
<FONT SIZE="+2">Sorted Entries</FONT>
<FONT SIZE="+2">A simple sorting example</FONT>
<HR SIZE="1">
</B>
</P>
<OL>
<TABLE BORDER="0">
<TR>
<TD>Sorting in ascending order</TD>
</TR>
<TR>
<TD>
<OL>
@ -19,9 +25,31 @@
<LI>Dream Theatre</LI>
<LI>Gilbert, Paul</LI>
<LI>Royal Hunt</LI>
<LI>Satriani, Joe</LI>
</OL>
<LI>Gilbert, Paul</LI>
<LI>Royal Hunt</LI>
<LI>Satriani, Joe</LI>
</OL>
</TD>
</TR>
<TR>
<TD>Sorting in descending order</TD>
</TR>
<TR>
<TD>
<OL>
<LI>Satriani, Joe</LI>
<LI>Royal Hunt</LI>
<LI>Gilbert, Paul</LI>
<LI>Dream Theatre</LI>
</OL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@ -14,7 +14,7 @@
<BODY>
<P ALIGN="CENTER">
<B>
<FONT SIZE="+2">Sorted Entries</FONT>
<FONT SIZE="+2">A simple sorting example</FONT>
<HR SIZE="1"/>
</B>
</P>
@ -26,12 +26,30 @@
<!-- matches root element -->
<xsl:template match="/*">
<OL>
<xsl:apply-templates>
<!-- sort using the value of the selected node -->
<xsl:sort select="."/>
</xsl:apply-templates>
</OL>
<TABLE BORDER="0">
<TR><TD>Sorting in ascending order</TD></TR>
<TR>
<TD>
<OL>
<xsl:apply-templates>
<!-- sort using the value of the selected node -->
<xsl:sort select="."/>
</xsl:apply-templates>
</OL>
</TD>
</TR>
<TR><TD>Sorting in descending order</TD></TR>
<TR>
<TD>
<OL>
<xsl:apply-templates>
<!-- sort using the value of the selected node -->
<xsl:sort select="." order="descending"/>
</xsl:apply-templates>
</OL>
</TD>
</TR>
</TABLE>
</xsl:template>
<!-- matches only entry elements -->