Subject: Re: Traverse order From: "Charlotte.Allen" <Charlotte.Allen@xxxxxxxxxxxx> Date: Wed, 18 Aug 1999 05:12:40 +0800 (GMT) |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Traverse order, Honglin Su | Thread | RE: Traverse order, Mike Brown |
Meaning of XPath spec?, chet | Date | RE: Traverse order, Mike Brown |
Month |