Re: [xsl] Recursive?

Subject: Re: [xsl] Recursive?
From: omprakash.v@xxxxxxxxxxxxx
Date: Thu, 17 Mar 2005 15:00:37 +0530
    You can do as follows:

If you want the indents as well, you may have to use a recursive-string
chopping template to count the number of dots in your numbering element. I
don't see this information available in the structure of your xml file.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl
<xsl:output method="xml" indent="yes" />

<xsl:template match="//numbering">
     <xsl:value-of select="."/><xsl:text> </xsl:text>

<xsl:apply-templates select="following-sibling::name" mode="list"/>


<xsl:template match="name">

<xsl:template match="text()">
     <xsl:value-of select="normalize-space(.)"/>

<xsl:template match="name" mode="list">
     <xsl:value-of select="."/>




                    Sven Waibel                                                                                    
                    <sven.waibel@        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
          >            cc:     (bcc: omprakash.v/Polaris)                                        
                                         Subject:     [xsl] Recursive?                                             
                    02:26 PM                                                                                       
                    respond to                                                                                     

Hi everybody,

my xml:
<?xml version="1.0" encoding="ISO-8859-15"?>
           <tt id="20">
                     <tc id="4611686020000000015">
           <tt id="21">
                     <tt id="22">
                               <tt id="23">
                                          <tc id="4611686020000000012">

                                          <tc id="4611686020000000013">

                               <tc id="4611686020000000014">

I want to get this:

number name

1 test0
  1.1 test1
2 test2
  2.1 test3
    2.1.1 test4 test5 test6
    2.1.2 test7

Should i do it recursively or is there a better way to achieve it?

Thanks and best regards.


This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at

Current Thread