I have spent some time on cleaning up XSLTC's implementation of
the xsl:apply-imports element and I have come across a scenario
that seems to be handled differently by the various XSLT processors.
I'd like some help with determing what the correct behaviour for
XSLTC is. Consider that you have these stylesheets:

  A.xsl imports B.xsl, which imports C.xsl
  A.xsl imports D.xsl, which imports E.xsl

Stylesheets A, B, C and D all have a template that matches on
an element "foo" - stylesheet E does _not_. This matching
template looks like this (in all of the first 4 stylesheets):

  <xsl:template match="foo">
    <A><xsl:apply-imports/></A>
  </xsl:template>

The xsl:apply-imports elements is similar to a call to "super()"
in Java, so the template in A.xsl triggers the template in D.xsl
(because this is the imported template with the highest import
precedence). There are no matching templates in E.xsl, so what
should the template in D.xsl do?

  A) Nothing? 
  B) Trigger the matching template in B.xsl?

Saxon goes with option A), while Xalan (and currently XSLTC) goes
with option B). I am tempted to say that Saxon is correct, as
template D.xsl does not "inherit" any behaviour from template B.xsl.

Any input welcome!

Morten J�rgensen,
XML Technology Centre,
Sun Microsystems Ireland ltd.

Reply via email to