[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] sorting nodes in reverse document order
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|