https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2014-11-14T16:14:36ZSaxonica Developer CommunitySaxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=36802014-11-14T16:14:36ZMichael Kaymike@saxonica.com
<ul><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li></ul><p>Added to W3C test suite as match-234</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=36822014-11-14T16:47:54ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul><p>It seems to be a problem with binding references from variable references in a pattern to global variables. Binding is more dynamic in Saxon 9.6, as the first step towards support of packages, and it seems the context for this dynamic binding is not being set up propertly while evaluating a pattern.</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=36832014-11-14T17:30:22ZMichael Kaymike@saxonica.com
<ul></ul><p>The method Mode.searchRuleChain() (Mode.java line 612) correctly calls Rule.matches() to test whether a rule matches the current item; Rule.matches() sets up the binding context for cross-component references (eg global variable references) before calling Pattern.matches(). But the method Mode.searchRuleChain() (Mode.java line 758), which performs a filtered search in support of xsl:apply-imports and xsl:next-match, calls Pattern.matches() directly without going via Rule.matches(). (3 calls).</p>
<p>So what is happening is that patterns are being matched by next-match with the "current component" being the template containing the next-match instruction rather than the template to which the rule is attached; this means the wrong binding vector is being used, which results in the global variable reference getting the wrong value.</p>
<p>But changing this doesn't fix the problem....</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=36842014-11-14T17:53:38ZMichael Kaymike@saxonica.com
<ul></ul><p>The stylesheet looks wrong: the <code><apply-templates select="*, node()"/></code> processes all child elements twice, which can never produce the required output. I've changed it to <code><apply-templates select="node()"/></code> and after applying the above changes to Mode.java, the expected output is now produced.</p>
<p>Patch committed on the 9.6 branch. Not yet done for 9.7 as this area is in flux.</p>
<p>I've adjusted whitespace, namespaces, and accented characters to make the test more robust for W3C testing.</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=38692014-12-23T15:48:56ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul><p>I have now applied the same patch to the 9.7 branch, and test match-234 now passes.</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=39522015-01-14T16:11:36ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in version</strong> set to <i>9.6.0.4</i></li></ul><p>Bug fix applied in the Saxon 9.6.0.4 maintenance release.</p> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=39752015-01-14T16:12:42ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=51342015-12-11T12:44:34ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Sprint/Milestone</strong> set to <i>9.6.0.4</i></li><li><strong>Applies to branch</strong> <i>9.6</i> added</li><li><strong>Fix Committed on Branch</strong> <i>9.6</i> added</li><li><strong>Fixed in Maintenance Release</strong> <i>9.6.0.4</i> added</li></ul> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=51562015-12-11T12:45:58ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>9.6.0.4</i> to <i>9.6.0.3</i></li><li><strong>Fixed in Maintenance Release</strong> <i>9.6.0.3</i> added</li><li><strong>Fixed in Maintenance Release</strong> deleted (<del><i>9.6.0.4</i></del>)</li></ul> Saxon - Bug #2219: xsl:next-match; patterns using match="$var" syntaxhttps://saxonica.plan.io/issues/2219?journal_id=51782015-12-11T12:48:25ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>9.6.0.3</i> to <i>9.6.0.4</i></li><li><strong>Fixed in Maintenance Release</strong> <i>9.6.0.4</i> added</li><li><strong>Fixed in Maintenance Release</strong> deleted (<del><i>9.6.0.3</i></del>)</li></ul>