Re: [xsl] Match pattern should get child content but gets sib's content also

Subject: Re: [xsl] Match pattern should get child content but gets sib's content also
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Fri, 26 Apr 2002 15:20:08 -0400
[Joerg Heinicke]

> Hello Tom,
>
> I must say, that you are wrong.

I'm alway willing to be wrong (good thing, too!).  I added the string "=="
to the end of your template to mark the end of the template's contribution
so it was even more clear, and sure enough, the OOPS comes from the default
template while the Hello and World do come from his.

I use the null template from time to time to suppress unwanted activation of
the default template, and I see that I forgot that it (my null template)
would take precedence.

This example has caused me to check over what I thought was my understanding
of how templates are found to be matched.  It seems that I formed some of my
ideas when I was first getting started with xslt, didn't get some matches I
expected, and also didn't really understand the Rec.  Time for some
updating.

Thanks,

Tom P

> The built-in template has the lowest
> priority, so when the node <aValue> is accessed and a template is
> searched for it, the processor uses Doug's template, not the built-in on.
> The built-in templates are similar to
>
> <xsl:template match="node()">
>    <xsl:apply-templates/>
> </xsl:template>
>
> <xsl:template match="text()">
>    <xsl:value-of select="."/>
> </xsl:template>
>
> As a test for it, use Doug's template/stylesheet and change it a bit, so
> that a text will be added by this template:
>
> <xsl:template match="link/aValue">
>      <xsl:text>from template: </xsl:text>
>      <xsl:value-of select="."/>
> </xsl:template>
>
> You will see it ;-)



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


Current Thread