This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: problems with match
- From: Jarno dot Elovirta at nokia dot com
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 25 Jul 2002 13:26:04 +0300
- Subject: RE: [xsl] problems with match
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
> this is quite a simple problem, but I don't understand it.
> Why does this not work?
>
> <xsl:template match="/">
> the main body
> <xsl:call-template name="title"/>
> </xsl:template>
>
> <xsl:template name="title" match="/root/output">
> <b>Auftrag #<xsl:value-of select="data/ordernr" /> (<xsl:value-of
> select="data/shopname" />) </b>
> </xsl:template>
>
> I mean the template name=title -> last section
>
> Why must I apply the value-of select like this, although I
> have a "match" in
> the <xsl:template name="title" - tag?:
> It only works like this:
>
> <xsl:template name="title" match="/root/output">
> <b>Auftrag #<xsl:value-of select="data/ordernr" /> (<xsl:value-of
> select="data/shopname" />) </b>
> </xsl:template>
Isn't this identical to the one above? Anyhow, calling a template does not change the current node, even if the template being called has a match attribute. You could do
<xsl:template match="/">
the main body
<xsl:apply-templates name="root/output/data"/>
</xsl:template>
<xsl:template match="data">
<b>Auftrag #<xsl:value-of select="data/ordernr" /> (<xsl:value-of select="data/shopname" />)</b>
</xsl:template>
If I understood what you were after.
Cheers,
Jarno
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list