[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
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
|