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

Re: Traverse order

Subject: Re: Traverse order
From: "Charlotte.Allen" <Charlotte.Allen@xxxxxxxxxxxx>
Date: Wed, 18 Aug 1999 05:12:40 +0800 (GMT)
Re: Traverse order
Honglin,

This is easily done.... just put an <xsl apply-templates /> tag first
in the <xsl:template/> block.

Here's an example:

xml-
----------------------------------------------
<root>rootnode
	<node>one
	</node>
	<node>five
		<node>two
		</node>
		<node>four
			<node>three
			</node>
		</node>
	</node>
</root>
----------------------------------------------
xsl-
---------------------------------------------
<xsl:template match="root">
	<xsl:apply-templates select="./*"/>
	<xsl:value-of select="./text()"/>
</xsl:template>

<xsl:template match="node">
	<xsl:appy-templates select="./*"/>
	<xsl:value-of select="./text()"/>
</xsl:template>
----------------------------------------------
output-
--------------------------------------------
one
	two
		three
			four
			five
		rootnode
---------------------------------------------

Hope this helps,

Charlotte Allen

> Hi, there,
> 
> When the XSL processor processes the XML document, it will read the root
> element first, then the child elements. Can we construct an XSL
> stylesheet to do the post-order traverse, it print out the leaf element
> which has no child, then the parents, and the last one is the root
> element.
> 
> Thank you!
> 
> Honglin
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



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


Current Thread
  • Traverse order
    • Honglin Su - Tue, 17 Aug 1999 16:18:17 -0400
      • Charlotte.Allen - Wed, 18 Aug 1999 05:12:40 +0800 (GMT) <=
      • <Possible follow-ups>
      • Mike Brown - Tue, 17 Aug 1999 15:35:32 -0600

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.