Your import tree looks like this

FRONT
  - SUB1
    - FUNC
  - SUB2
    - FUNC

Note that importing the same module twice at different points in the tree is equivalent to importing two different modules that happen to have identical content.

So the import precedences are

FRONT               5
  - SUB1             4
    - FUNC          3
  - SUB2             2
    - FUNC          1

which means that the highest precedence rule matching sub2/test is the match="*" template in the instance of FUNC with precedence 3.

>I do - however - still considder this to be a bug.

You can regard it either as a bug in your code, or as the language spec not being designed the way you would have liked it to be designed. But the processors are all conforming to the spec.

Michael Kay
Saxonica


On 23/09/2010 3:13 PM, Jens Henrik Gabe wrote:
When overriding a template from a 2nd level import in several 1st level imports, only the last overriding template "survives"!
We are using SAXON v9.2.1.1
 
The attached files details the issue:
 
test.func.xsl are imported by both test.sub1.xsl and test.sub2.xsl, and the template with mode="value" are overridden in both importing files.
 
Transforming the test.xml with test.front.xsl should result in
 
<result>
  <sub1>SUB1SUB1</sub1>
  <sub2>SUB2SUB2</sub2>
</result>
 
but the result is:
 
<result>
  <sub1>FAILFAIL</sub1>
  <sub2>SUB2SUB2</sub2>
</result>
 
 
------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help