Subject: RE: [xsl] Recursive? From: "Aron Bock" <aronbock@xxxxxxxxxxx> Date: Thu, 17 Mar 2005 14:31:59 +0000 |
<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>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Recursive? Date: Thu, 17 Mar 2005 09:56:03 +0100
Hi everybody,
my xml: <?xml version="1.0" encoding="ISO-8859-15"?> <it> <tt id="20"> <numbering>1</numbering> <name><![CDATA[test0]]></name> <tc id="4611686020000000015"> <numbering>1.1</numbering> <name><![CDATA[test1]]></name> </tc> </tt> <tt id="21"> <numbering>2</numbering> <name><![CDATA[test2]]></name> <tt id="22"> <numbering>2.1</numbering> <name><![CDATA[test3]]></name> <tt id="23"> <numbering>2.1.1</numbering> <name><![CDATA[tgf]]></name> <tc id="4611686020000000012"> <numbering>2.1.1.1</numbering> <name><![CDATA[test4]]></name> </tc> <tc id="4611686020000000013"> <numbering>2.1.1.2</numbering> <name><![CDATA[test5]]></name> </tc> </tt> <tc id="4611686020000000014"> <numbering>2.1.2</numbering> <name><![CDATA[test6]]></name> </tc> </tt> </tt> </it>
I want to get this:
number name
1 test0 1.1 test1 2 test2 2.1 test3 2.1.1 test4 2.1.1.1 test5 2.1.1.2 test6 2.1.2 test7
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Recursive?, Michael Kay | Thread | Re: [xsl] Recursive?, omprakash . v |
Re: [xsl] Recursive?, Sven Waibel | Date | Re: [xsl] Error in XPath expression, António Mota |
Month |