Re: [xsl] specific template?

Subject: Re: [xsl] specific template?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 3 Jul 2003 15:58:05 +0100
Hi Martin,

> Oh, thanks, but I found what I need:
>
>            <xsl:apply-templates select="//formular">
>              <xsl:with-param name="name">login</xsl:with-param>
>            </xsl:apply-templates>
>
> ...
>
> <xsl:template match="formular">
>    <xsl:param name="name"/>
>    <xsl:if test="@name=$name">

If you only want to do something with the formular whose name
attribute is 'login', then it's easier to do:

  <xsl:apply-templates select="//formular[@name = 'login']" />

Or you can have two templates, one for general <formular> elements
that does nothing:

<xsl:template match="formular" />

and one for the <formular> element that you're interested in:

<xsl:template match="formular[@name = 'login']">
  ...
</xsl:template>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread