Project

Profile

Help

Bug #4777

closed

Shadow attribute xsl:include/@href

Added by Michael Kay about 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2020-10-03
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Under the XX compiler, XSLT test case shadow-004 fails

s=shadow t=shadow-004
Actual error: XTSE0090
Expected success, got XTSE0090: At 219 of static.xsl: 
Error XTSE0090 at xsl:include/@_href on line 8 in shadow/shadow-004.xsl:
 xsl:include must not have attribute @_href

Actions #1

Updated by Michael Kay about 4 years ago

In the XX compiler, static.xsl line 128, we process all the children of an xsl:stylesheet element using xsl:iterate; in particular it handles the xsl:import/include children at line 532, failing if there is an invalid attribute at line 549.

I'm now trying to debug the compiler by running it directly as a transformation, with the new -T option for tracing. For reference the invocation is:

~/GitHub/saxon-js-enterprise/build/temp/js/build/xslt3ee.js
-xsl:/Users/mike/GitHub/saxon-js-enterprise/build/temp/js/source/XX/compiler.sef
-s:/Users/mike/GitHub/xslt30-test/tests/attr/shadow/shadow-004.xsl
-o:/Users/mike/Desktop/temp/shadow-004.sef.json
-im:compile-complete
-debug
-T
-t

(Note in passing that the <applyT> instructions are all logged twice; perhaps more important, (a) the mode name isn't present in the trace, and (b) we don't explicitly identify the template rule that gets called.)

This shows we are executing the apply-templates in XSLT-SEF-compiler line 406, on the xsl:transform element, and this invokes the template rule at static.xsl#128, which processes all the children of the xsl:transform in an xsl:iterate.

At line static.xsl#263 we process the xsl:include element and put the processed xsl:include element in variable $possible.component. This invokes the template rule at static.xsl#920, which at line 944 processes the _href shadow attribute. The template at #920 should return a copy of the xsl:include element with the @href attribute expanded.

We then reach the xsl:when condition at line 532 (though the trace isn't very helpful at revealing this), and the error comes at line 544.

It's now clear what's wrong: the check for bad attributes is looking at ./@* rather than $possible.component/@*.

Actions #2

Updated by Michael Kay about 4 years ago

The fix looks good, but rerunning the build with target test-NodeJS-XSLT isn't actually picking up the changed XX compiler source.

Although the build apparently succeeded, a careful look at the log shows:

compile-XX:
     [echo] XJ compiling XX-compiler
     [echo] Compiling /Users/mike/GitHub/saxon-js-enterprise/src/xslt/XXcompiler/XSLT-SEF-compiler.xsl to /Users/mike/GitHub/saxon-js-enterprise/build/temp/js/source/XX/compiler.sef using Saxon-EE
     [java] Error at char 72 in xsl:message/@select on line 257 column 113 of static.xsl:
     [java]   XPST0008  Variable current-precedence has not been declared (or its declaration is not in scope)
     [java] Static error near {...g attribute in {serialize(....} at char 32 (in expression on line 830) of file:/Users/mike/GitHub/saxon-js-enterprise/src/xslt/XXcompiler/static-normalize/normalize.xsl 
     [java]   XPST0003  expected ")", found "."
     [java] Static error near {...g attribute in {serialize(....} at char 32 (in expression on line 830) of file:/Users/mike/GitHub/saxon-js-enterprise/src/xslt/XXcompiler/static-normalize/normalize.xsl 
     [java]   XPST0003  expected ")", found "."
     [java] expected ")", found "."
     [java] Java Result: 2

Both these syntax errors were in xsl:message instructions added for extra diagnostics.

Actions #3

Updated by Michael Kay about 4 years ago

  • Status changed from New to Resolved

Test case now working, with the change to static.xsl

Actions #4

Updated by Michael Kay about 4 years ago

  • Applies to JS Branch 2.0, Trunk added
  • Fix Committed on JS Branch 2.0, Trunk added
Actions #5

Updated by Community Admin almost 4 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (2.0, Trunk)
Actions #6

Updated by Community Admin almost 4 years ago

  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (2.0, Trunk)
Actions #7

Updated by Debbie Lockett almost 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 2.1

Bug fix applied in the Saxon-JS 2.1 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page