Bug #4990


saxon-js 2.2 no longer reads stylesheet URIs from web context

Added by John Dziurlaj about 3 years ago. Updated over 1 year ago.

Start date:
Due date:
% Done:


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


I am working on upgrading a project from SaxonJS 2.0 to 2.2. However, when upgrading this webpack project, I am getting an error regarding the resolution of the stylesheet, which is passed via URI:

[10:32:49 AM] uncaught exception: XError:Failed URI resolution: href=xslt/cvr_v1_json2xml.sef.json base=undefined -- TypeError: k is not a constructor; code:FODC0005

            sourceText: wrappedJson,
            stylesheetLocation: `xslt/${sefFile}`,
            initialTemplate: "start",
            destination: "application"
        }, cb);

I have checked by entering the SEF URL manually, and it resolves (Firefox and Chrome).

(see cdftransformer.ts) Full codebase here

Actions #1

Updated by Norm Tovey-Walsh about 3 years ago

I did some testing with Webpack in the course of investigating the global object bug. I would have said that we have tests that cover this case, but perhaps I'm mistaken. We'll take a look as soon as possible. Apologies for the inconvenience.

Actions #2

Updated by Norm Tovey-Walsh almost 3 years ago

Sorry for the delay. I was trying to reproduce the bug but I'm not having much luck. The repo you point to contains XML SEF files but not the original stylesheets. Saxon-JS 2.x doesn't support XML SEF files, can you provide the JSON versions or the original stylesheets?

If you can describe a little more precisely how to reproduce the problem, that would also be appreciated. Thanks!

Actions #3

Updated by Norm Tovey-Walsh over 2 years ago

  • Status changed from New to AwaitingInfo
Actions #4

Updated by John Dziurlaj over 2 years ago

There is a JSON based SEF located at The CVR JSON2XML is configured to use this style sheet.

Actions #5

Updated by Debbie Lockett about 2 years ago

I've had a look at the GitHub project, but I've not yet worked out how to use webpack to try testing changes myself; so I don't yet have a working repro.

I'd be interested to know what happens if you try updating to use Saxon-JS 2.3 rather than 2.2. I can see that the failure arises internally within the call to resolveUri (in NodePlatform.js); and there were some code changes in this area for the 2.3 release (e.g. re bug #5021).

I'm not necessarily confident that it'll be fixed, but perhaps you'll see a different (more useful) error message...

Actions #7

Updated by John Dziurlaj over 1 year ago

I've upgraded to SaxonJS 2.5 and get a similar, but slightly different error:

Object { message: "Failed URI resolution: href=xslt/cvr_v1_json2xml.sef.json base=file:///// -- TypeError: q is not a constructor", stack: "L@http://localhost:9080/docs/cdfconverter.js:13249:549\nresolveUri@http://localhost:9080/docs/cdfconverter.js:13858:167\nF@http://localhost:9080/docs/cdfconverter.js:14151:494\ntransform@http://localhost:9080/docs/cdfconverter.js:14152:266\n./src/cdftransformer.ts/CdfTransformer.transform@http://localhost:9080/docs/cdfconverter.js:17019:15\n./src/cdfconverter.ts/CdfConverterViewModel.prototype.transform@http://localhost:9080/docs/cdfconverter.js:16940:45\n./node_modules/knockout/build/output/knockout-latest.js/</init/</<@http://localhost:9080/docs/cdfconverter.js:5291:264\nEventListener.handleEvent*B@http://localhost:9080/docs/cdfconverter.js:5208:130\n./node_modules/knockout/build/output/knockout-latest.js/</init/<@http://localhost:9080/docs/cdfconverter.js:5291:170\nb@http://localhost:9080/docs/cdfconverter.js:5200:147\ninit@http://localhost:9080/docs/cdfconverter.js:5291:130\ninit@http://localhost:9080/docs/cdfconverter.js:5308:432\n./node_modules/knockout/build/output/knockout-latest.js/</p/</<@http://localhost:9080/docs/cdfconverter.js:5270:95\nG@http://localhost:9080/docs/cdfconverter.js:5232:458\n./node_modules/knockout/build/output/knockout-latest.js/</p/<@http://localhost:9080/docs/cdfconverter.js:5270:75\nD@http://localhost:9080/docs/cdfconverter.js:5202:52\np@http://localhost:9080/docs/cdfconverter.js:5269:408\nk@http://localhost:9080/docs/cdfconverter.js:5267:170\nm@http://localhost:9080/docs/cdfconverter.js:5267:52\nk@http://localhost:9080/docs/cdfconverter.js:5267:228\nm@http://localhost:9080/docs/cdfconverter.js:5267:52\nk@http://localhost:9080/docs/cdfconverter.js:5267:228\nm@http://localhost:9080/docs/cdfconverter.js:5267:52\nk@http://localhost:9080/docs/cdfconverter.js:5267:228\nm@http://localhost:9080/docs/cdfconverter.js:5267:52\nk@http://localhost:9080/docs/cdfconverter.js:5267:228\nm@http://localhost:9080/docs/cdfconverter.js:5267:52\nk@http://localhost:9080/docs/cdfconverter.js:5267:228\n./node_modules/knockout/build/output/knockout-latest.js/</\n./src/cdfconverter.ts/window.onload@http://localhost:9080/docs/cdfconverter.js:16954:8\nEventHandlerNonNull*./src/cdfconverter.ts@http://localhost:9080/docs/cdfconverter.js:16952:1\n__webpack_require__@http://localhost:9080/docs/cdfconverter.js:20:30\n@http://localhost:9080/docs/cdfconverter.js:84:18\n@http://localhost:9080/docs/cdfconverter.js:87:10\n", name: "XError", code: "FODC0005" }

Please register to edit this issue

Also available in: Atom PDF Tracking page