[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sorting nodes in reverse document order

Subject: sorting nodes in reverse document order
From: Ann Marie Rubin - Sun PC Networking Engineering <Annmarie.Rubin@xxxxxxxxxxxx>
Date: Mon, 15 May 2000 10:23:03 -0400 (EDT)
xslt for each reverse
Hello,

I'm stuck on this problem and hope someone on this list has some ideas
to get me going in the right direction.

I have a for-each statement inside a template that outputs a list of the
ancestors of the current context node. I couldn't use the parent or
ancestor axes to get this list because these nodes are not contained
within their parent nodes in the XML source document.  Each node has a
SUPERCLASS attribute whose value is the name of its parent.

Here is the XSL stylesheet code:

<!-- named template to do the hierarchy tracing -->
<xsl:template name="hierarchy">
<br data="{@NAME} -- {@SUPERCLASS}"><a href="{@NAME}.html"><xsl:value-of
select="@NAME"/></a></br>
<xsl:if test="@SUPERCLASS">
  <xsl:param name="parentname" select="@SUPERCLASS"/>
  <xsl:for-each select="//CLASS[@NAME=$parentname]">
       <xsl:call-template name="hierarchy"/>
  </xsl:for-each>
</xsl:if>
</xsl:template>

The nodes are output in this order:

context node
parent of context node
grandparent of context node
.
.
.
root node

How can I sort these nodes and output them in reverse order? For
example:

root node
.
.
.
grandparent of context node
parent of context node
context node


Thanks,

Ann Marie








 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.