Questions tagged [saxon-js]

Saxon-JS is an implementation of XSLT 3.0 that runs in any modern browser and since Saxon-JS 2 also under Node.js. It is written in Javascript, and executes stylesheets that have first been compiled using Saxon-EE running on a server or developer's machine or by Saxon-JS 2's Node.js command line tool xslt3.

Details of the Saxon-JS product can be found at http://saxonica.com/saxon-js/index.xml

Saxon-JS offers all the mandatory features defined in the XSLT 3.0 specification from W3C. It omits some of the optional features, like schema-awareness and streaming but since Saxon-JS 2 supports serialization and higher-order-functions.

Saxon-JS also offers XSLT extensions designed to enable fully interactive applications to be implemented. Template rules can be written that respond to user input events such as clicking on a button. The stylesheet can write selectively to parts of the HTML page. It can also make asynchronous requests (AJAX-style) to fetch data from the server.

57 questions
10
votes
2 answers

NodeJs XSLT Transformation

I need to transform an XML document using XSLT in nodejs. I can’t seem to find a library for nodejs that is currently maintained and encompasses the full standard of XSLT. Does anyone have any suggestions on a package or something in native nodejs…
user3597741
  • 429
  • 1
  • 7
  • 13
3
votes
3 answers

How to convert xsl file to sef file

I have xsl file I would like to apply to some XML content in node.js. I found saxon-js and it seems to offer what I need. While I'm slightly lost in the documentation, it seems like I should first convert my xsl file to .sef file before running…
Jarek
  • 3,359
  • 1
  • 27
  • 33
3
votes
0 answers

Using Saxon, how do I include a compiled stylesheet (sep) in a separate stylesheet (xsl)?

I'm compiling stylesheets (XSL) for use with the SaxonJS into their compiled form (SEP). $ java -jar saxon9ee.jar -target:JS -xsl:child.xsl -export:child.sef.xml -nogo I would like to use the compiled child stylesheet in another parent stylesheet…
dacracot
  • 22,002
  • 26
  • 104
  • 152
1
vote
0 answers

"npm install saxon-js" not generating .d.ts file

Following command failing with 404 error. npm i --save-dev @types/saxon-js I am trying to convert xml using stylesheet from a nodejs typescript project. Can anyone help me here to get rid of the following error? npm ERR! 404 Not Found - GET…
curious
  • 11
  • 2
1
vote
1 answer

SaxonJS transform with nested stylesheets causes XError:Failed URI resolution

I am trying to transform XML using stylesheets that reference other xsl stylesheets. I compile the main stylesheet using xslt3 on the command line into a .sef.json file, but when I use that .sef.json with .transform(), I get a Failed URI resolution…
anna.go
  • 23
  • 2
1
vote
1 answer

Error when running SaxonJS in Node JS, "Context item for '/' must be a node"

const node = document.createElement('div'); node.innerHTML = "

Text 1

" For this JS HTMLElement, how should I run an XPath against it using SaxonJS? const res = saxonJs.XPath.evaluate('//p', node); Has error Context item for '/' must be a…
Shukai Ni
  • 457
  • 2
  • 6
  • 17
1
vote
1 answer

Is it possible to execute javascript from an XML document loaded into the browser?

I wonder if there is some XML processing instruction or even an element (like the HTML