Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: newbee question on apply-templates newbee question on apply-templatesTo: NULL Date: 6/1/2004 8:18:00 AM Hi, I posted a question earlier, did not quite get the answer I want. I have xsl file like this: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="Chapter"> <h2> Chapter <xsl:value-of select="@number"/>: <xsl:value-of select="@title"/> </h2> <xsl:apply-templates /> </xsl:template> <xsl:template match="Section"> <h3> <xsl:value-of select="@title"/> </h3> </xsl:template> </xsl:stylesheet> and xml file like this: <Chapter number="13" title="Viewing XML Data on the Web"> <Section title="Going from XML to HTML"/> <Section title="Serving Up Your XML Data"/> </Chapter> The result html: <h2>Chapter 13: Viewing XML Data on the Web</h2> <h3>Going from XML to HTML</h3> <h3>Serving Up Your XML Data</h3> If I removed <xsl:apply-templates /> from xsl file, the html will be: <h2>Chapter 13: Viewing XML Data on the Web</h2> What is <xsl:apply-templates /> doing on this occasion? The explanation I got was, it tried to match children of current element with the template. Does that mean it try to apply <xsl:template match="Chapter"> template to all the children of <Chapter number="13" .....>, that should not affect the result html file because there are no Chapter elements in the children. Thanks in Advance | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
