evaluation context of parameters:

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 08:54:40 UTC