How to run a transformation
- Paste or open the XML and the stylesheet. The example turns a UBL invoice into an HTML page and a CSV file.
- Add parameters if the stylesheet takes any: one
name = valueper line, passed to itsxsl:paramas strings. - Press Transform (or Ctrl+Enter in an editor). The result opens below; HTML gets a Preview, and each file from
xsl:result-documenta tab of its own.
XSLT 3.0, 2.0 and 1.0
Stylesheets are compiled and run by SaxonJS 2.7, Saxonica's XSLT 3.0 processor for JavaScript, in a background worker. What XSLT 3.0 adds works: text value templates (expand-text), xsl:iterate, xsl:for-each-group, maps and arrays, functions as values and the whole of XPath 3.1. A 1.0 stylesheet runs in backwards-compatible mode, as the XSLT 3.0 specification provides.
Not available: schema-aware processing (xsl:import-schema) and streaming, which need Saxon-EE, and other local files: xsl:include, xsl:import and document() can't reach files on your disk, so put the modules into one stylesheet to try them here.
Messages, errors and result documents
- xsl:message lines appear above the result, in order. With
terminate="yes"the run stops with its text. - Errors show their code and message: static errors (
XTSE0010,XPST0003) with the line in the stylesheet, dynamic ones (FORG0001,XPTY0004) as they happen. A stylesheet that runs forever can be stopped. - Result documents written by
xsl:result-document href="…"get a tab each and download under their own name. - HTML results can be previewed. The preview runs without scripts and without access to this page.
Questions
Is my XML uploaded?
No. The stylesheet is compiled and run by SaxonJS in your browser; neither file leaves your machine.
Which XSLT version is supported?
XSLT 3.0 with XPath 3.1, through SaxonJS 2.7. XSLT 1.0 and 2.0 stylesheets run too.
Can I use xsl:include or xsl:import?
Not of local files: only the pasted stylesheet is available. Merge the modules into one stylesheet to try it here.
Is it the same as Saxon on a server?
SaxonJS implements the same XSLT 3.0 specification as Saxon-HE for Java. Schema-aware processing and streaming, which need Saxon-EE, are not available.
Other tools
- XML formatter: Pretty-print or minify XML, keeping text, CDATA and comments as written.
- XPath tester: Evaluate XPath 3.1 against a document and see each match with its line.
- XSD generator: Infer an XML Schema from sample documents, checked against them.
- XML from XSD: Generate a sample XML document from a schema, validated against it.
- XML diff: Compare two XML documents as trees: changed, added and removed elements, attributes and text.
- XML to JSON converter: Convert XML to JSON, with arrays where an element repeats or wherever its XSD allows.
- JSON to XML converter: Convert JSON to XML: @keys become attributes, arrays repeated elements.
- XML to CSV converter: Turn a repeating element into CSV rows: invoice lines, products, records.
- E-invoice viewer: Read an XRechnung, ZUGFeRD, Factur-X or Peppol invoice as a document, and print it.
- XML validator: check a document against XSD, DTD, RelaxNG or Schematron, up to 1 GB.