Project

Profile

Help

Bug #5338

closed

XX Compiler reports "Unknown accumulator NNNNN" when an accumulator-before or -after call occurs in a global variable

Added by Alexander Stein almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XX compiler
Sprint/Milestone:
-
Start date:
2022-02-19
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:
Fed
Contact person:
Alexander J. Stein
Additional contact persons:
Wendell A. Piez

Description

Hello, we have a pipelines and software using Saxon HE (Java) variant and the SaxonJS variant with NodeJS to build CLI tooling. We have encountered a problem in which running Saxon HE will process a collection of XSL transforms in shell scripts (running Saxon HE 9.x and/or 10.x) and successfully execute. Developers wrapping compiling those same transforms into SEF artifacts receive compilation failures.

https://github.com/usnistgov/metaschema/issues/180

We receives exceptions like this only with SaxonJS.

Failed to compile stylesheet: Static error in XPath on line 17 in fixtures/accumulator_simple.xsl {accumulator-after('total-items')}: Unknown accumulator Q{}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Static error in XPath on line 17 in fixtures/accumulator_simple.xsl {accumulator-after('total-items')}: Unknown accumulator Q{}total-items
Failed to compile stylesheet: Static error in XPath on line 27 in fixtures/accumulator_basic.xsl {accumulator-after('total-items')}: Unknown accumulator Q{}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Static error in XPath on line 27 in fixtures/accumulator_basic.xsl {accumulator-after('total-items')}: Unknown accumulator Q{}total-items
Failed to compile stylesheet: Static error in XPath on line 28 in fixtures/accumulator_namespaces.xsl {accumulator-after('example:total-items')}: Unknown accumulator Q{https://example.com/ns/custom/0.1}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
    Static error in XPath on line 28 in fixtures/accumulator_namespaces.xsl {accumulator-after('example:total-items')}: Unknown accumulator Q{https://example.com/ns/custom/0.1}total-items

We have build a reproduction library here. With or without namespaces (I re-read the XSLT 3.0 standard), it is not clear to me if an accumulator requires a unique namespace or not. I built simple reproductions and none of these seem to compile with current SaxonJS from NPMJS. Instructions to reproduce in the repo below.

https://github.com/aj-stein-nist/issue180example.git

Let me know if this is my misunderstanding of syntax for accumulators, whether SaxonJS is working as intended, or whether Saxon HE is working as intended. Similar code compiles with Saxon as intended. Thanks.

Please register to edit this issue

Also available in: Atom PDF Tracking page