Re: [xsl] XSLT Output contains the unwanted content of all elements as text

Subject: Re: [xsl] XSLT Output contains the unwanted content of all elements as text
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Fri, 09 Mar 2007 12:38:03 +0100
Florent Georges wrote:
But a matching template would never looked for that
element, as the default template rule for elements would be
redefined to do nothing, and the root element would match
it.

So the entire tree walk would stop at the... root element:

<xsl:template match="*"/>

    <xsl:template match="non-root-element">
      Can never be reached.
    </xsl:template>

Ah, in that way. Yes, you are very right ;) I *always* start my new template with something like:

<xsl:template match="/" name="main" >
   <xsl:apply-templates select="specify/starting/point/here" />
</xsl:template>


which gives me a clear starting point for the tree walk in any situation. I didn't realize that the OP did not have such a root-matching template.


-- Abel

Current Thread