Bug #3645
Updated by Michael Kay almost 7 years ago
*Summary:* _This error occurs when a stylesheet module is imported multiple times by different routes, and the module contains a template rule with a match pattern containing a predicate that makes a function call to a user-defined function._
Trying to validate or to transform with a certain XSLT generates this exception with Saxon 9.8:
<pre>
java.lang.AssertionError: **** Component reference function df:class#2 is already bound
at net.sf.saxon.expr.instruct.Actor.processComponentReference(Actor.java:146)
at net.sf.saxon.expr.instruct.Actor.allocateBindingSlotsRecursive(Actor.java:109)
at net.sf.saxon.expr.instruct.Actor.allocateBindingSlotsRecursive(Actor.java:112)
at net.sf.saxon.trans.SimpleMode$2.processRule(SimpleMode.java:952)
at net.sf.saxon.trans.SimpleMode.processRuleChain(SimpleMode.java:1148)
at net.sf.saxon.trans.SimpleMode.processRules(SimpleMode.java:1074)
at net.sf.saxon.trans.SimpleMode.processRules(SimpleMode.java:1062)
at net.sf.saxon.trans.SimpleMode.forceAllocateAllBindingSlots(SimpleMode.java:950)
at net.sf.saxon.trans.SimpleMode.allocateAllBindingSlots(SimpleMode.java:941)
at net.sf.saxon.style.PrincipalStylesheetModule.compile(PrincipalStylesheetModule.java:1377)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:328)
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:258)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:106)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:739)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:175)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTransformer(SaxonTransformerFactory.java:131)
</pre>
I'm working on some samples, I will attach them a little bit later, basically the same XSLT stylesheet seems to be imported on two branches, resulting in this problem being reported.