|
Subject: [xsl] Re: xsl:with-param From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> Date: Sun, 15 Jun 2003 22:44:26 +0200 |
> Am I misunderstanding something or should the follow xslt
> snippet work:
>
> -----
> <xsl:template match="/">
> <foo>
> <xsl:apply-templates mode="foo">
> <xsl:with-param name="wit">B</xsl:with-param>
> </xsl:apply-templates>
> </foo>
> </xsl:template>
>
> <xsl:template match="body" mode="foo">
> <xsl:param name="wit" />
> <xsl:if test="contains(@wit, $wit)">
> <body wit="{$wit}"><xsl:apply-templates mode="foo"/></body>
> </xsl:if>
> </xsl:template>
> -----
>
> I expected that the root template would apply any
> other templates with mode="foo" and make available to
> them the param $wit with value 'B'.
In case "body" is not the top element (the child of "/"), probably a
template that was instantiated for one of its ancestors didn't have an
xsl:param named "wit".
Then "the chain is broken" ... this template cannot pass a parameter it
doesn't know about.
You haven't shown us the sml.source and the other templates that are part of
the transformation, so one can only provide a guess of what is the exact
reason for the reported behaviour.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] xsl:with-param, James Cummings | Thread | [xsl] Xpath and xsl position questi, Mark Ivs |
| RE: [xsl] problem with URN please h, Michael Kay | Date | [xsl] Re: A Calendar Project..., Dimitre Novatchev |
| Month |