[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Recursive?
Sven, the following proposes indent depth depending on number of "ancestors"
of a tt or tc node.
It doesn't match your output exactly, in that your output sample doesn't show "tgf" and shows "2.1.2 test7" for "2.1.2 test6"...but for now I'm assuming them typos. Regards, --A <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="tt|tc"> <xsl:call-template name="indent"> <xsl:with-param name="depth" select="count(ancestor::*) - 1"/> <xsl:with-param name="leadchar" select="' '"/> </xsl:call-template> <xsl:value-of select="numbering"/> <xsl:text> </xsl:text> <xsl:value-of select="name"/> <xsl:text>
</xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template name="indent"> <xsl:param name="depth" select="0"/> <xsl:param name="leadchar" select="' '"/> <xsl:if test="$depth > 0"> <xsl:value-of select="$leadchar"/> <xsl:call-template name="indent"> <xsl:with-param name="depth" select="$depth - 1"/> <xsl:with-param name="leadchar" select="$leadchar"/> </xsl:call-template> </xsl:if> </xsl:template> <xsl:template match="text()"> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> Waibel <sven.waibel@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Recursive? Date: Thu, 17 Mar 2005 09:56:03 +0100 _________________________________________________________________ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
|
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
|