Re: evaluation context of parameters:

This seems to me to be covered by the specification.  Section 13 says: 
"The current node and current node list used for computing the value
specified by xsl:param element is the same as that used for the
xsl:apply-templates or xsl:call-template element within which it
occurs."

I get the expected output with XT.

Jon Seymour wrote:
> 
> First let me say, I think XSLT is an excellent piece of work! We have been
> using Lotus XSL for the past month now, primarily to do java code
> generation. It has saved us absolutely heaps of time!
> 
> I posted this to the LotusXSL discussion group, but since I think it
> highlights a deficiency in the specification, you guys might be interested
> too.
> 
> The stylesheet below contains a complete test case for the issue at hand.
> 
> jon seymour
> 
> Working at Optus Communications Ltd (jon.seymour@yes.optus.com.au)
> Employed by IBM Global Services Australia (jseymour@au1.ibm.com)
> 
> ----------------------------------------------------------------------------
> --------------
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!--
> 
>    Consider the XML below, the expected output and the actual output (with
> Lotus XSL 0.17.1)
> 
>    I say, expected output, because I think it would be reasonable for @id to
> be evaluated in the
>    context of the node which is invoking apply-templates, rather than the
> context of the node
>    which matches the selection criteria of apply-templates. I read the
> specification for clarification
>    on this matter, but it appears to be mute on this point.
> 
>    XML:
>       <A id="a">
>          <B id="b">
>          </B>
>       </A>
> 
>    Expected Output:
>        a
> 
>    Actual Output:
>        b
> 
> -->
> 
> <xsl:stylesheet
>         xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
> 
> <xsl:template match="A">
>    <xsl:apply-templates select="B">
>        <xsl:param name="p1" expr="@id"/>
>    </xsl:apply-templates>
> </xsl:template>
> 
> <xsl:template match="B">
>    <xsl:param-variable name="p1"/>
>    <xsl:value-of select="string($p1)"/>
> </xsl:template>
> </xsl:stylesheet>

Received on Thursday, 10 June 1999 09:51:48 UTC