This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Recursive Template Application


Hello, my Name is Philip Koester and I am new to this list (and to XSL). To
dive into the matter, I am trying to transform a structured document into
HTML. I ran into troubles with templates that I want to be applied
recursively. Some snippets:

<!-- Template T1: transform <toc> to <section> -->

<xsl:template match="toc">
 <section numbered="false" title="Contents"/>
 ...
</xsl:template>

<!-- Template T2: transform <section> to <h2> -->

<xsl:template match="section">
 <h2><xsl:value-of select="@title"/></h2>
</xsl:template>

This stylesheet works only half-way in that it correctly transforms "<toc/>"
to "<section .../>" but leaves it at that. The output of T1 is not matched
by T2. But how can I enforce this, so that "<toc/>" is finally transformed
to "<h2>..."? Should I run the XSL processor twice? Or is there a more
efficient way to accomplish this?

Regards,

    Philip



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]