Questions tagged [saxon]

Saxon is an implementation of XSLT, XQuery, XPath, and XSD. In supports the latest W3C standards including XSLT 3.0, XQuery 3.1, XPath 3.1, and XSD 1.1. There are versions for Java, .NET, and C, in both open source and commercial editions. The latest addition to the product set is Saxon-JS, an XSLT runtime which will run in most browsers.

Saxon is a processor for the W3C languages XSLT, XPath, XQuery and XSD (XML Schema). It was originally created by Michael Kay and is now developed and maintained by Saxonica. There are open-source and commercial versions. Standards supported include XSLT 2.0/3.0, XPath 2.0/3.0/3.1, XQuery 1.0/3.0/3.1, XSD 1.0/1.1, and XQuery Update 1.0. (XSD based validation and XQuery Update as well as optional XSLT 3 features like streaming require a commercial version of the product, like the EE Enterprise edition for streaming in XSLT 3.0). The latest releases 11.6 and 12.3 with the commercial PE and EE editions also supports some experimental XPath 4, XSLT 4 and XQuery 4 extensions.

The product is developed in Java and runs on all standard Java platforms. In addition it has been cross-compiled to .NET, and to a native library with APIs for C/C++ as well as PHP and, in the Saxon/C 1.2 release and the recent SaxonC 11.6 release, a Cython based Python module implementation saxonc (https://www.saxonica.com/saxon-c/doc/html/saxonc.html), as well as with the new SaxonC 12 release directly as a Python wheel on PyPi: https://pypi.org/project/saxonche/. The latest release in the Saxon family is Saxon 12.3, developed on Java and transpiled to C# as SaxonCS 12.3 EE, a pure C# implementation of XSLT 3, XPath 3.1 and XQuery 3.1 for .NET 6, integrating it with new code to interface with the .NET 6 platform then compiled and built for .NET 6 using dotnet.

The Saxon-CE version was compiled to Javascript using GWT and runs in any browser. Saxon-CE is now obsolete; its replacement is Saxon-JS, which in its 1.x releases was only a native Javascript XSLT runtime, relying on the stylesheet first being prepared for execution using Saxon Enterprise Edition but since its 2.x releases supports XSLT 3.0 and XPath 3.1 both client-side in the browser as well as with Node.js, not requiring Saxon Enterprise Edition anymore to precompile an XSLT file to an SEF file but being able to do that on the fly calling the fn:transform XPath 3.1 function or in a pre-processing step using xslt3 on Node.js.

Please use this tag only if your question directly relates to the Saxon processor. If you enquire about XSLT, XQuery, XPath, or XSD in general (i.e. if your question is independent of a specific implementation), use tags XSLT, XQuery, XPath or XSD respectively, with a version number where appropriate.

Saxonica staff monitor this forum, but this is not an official way of requesting product support, and many excellent answers (and a few bad ones) come from users who have no connection with Saxonica. The fact that an answer is ticked means that the original poster found it helpful, it does not mean that the answer is endorsed by Saxonica. If you want to raise a support issue with Saxonica, use http://saxonica.plan.io/

External links:

1825 questions
62
votes
6 answers

How to check if an element exists in the XML using XPath?

Below is my element hierarchy. How to check (using XPath) that AttachedXml element is present under CreditReport of Primary Consumer
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327
17
votes
2 answers

XSLT 2.0 transformation via linux shell

I want to perform an XSLT 2.0 transformation by the use of command line executions. I heard that i could use the Saxon library by a shell command like: java -jar sax.jar -input foo.xml -xsl foo.xsl -output bar.xml Does anyone know how exactly I can…
Alp
  • 29,274
  • 27
  • 120
  • 198
16
votes
7 answers

Use saxon with python

I need to process XSLT using python, currently I'm using lxml which only support XSLT 1, now I need to process XSLT 2 is there any way to use saxon XSLT processor with python?
Maliq
  • 315
  • 1
  • 3
  • 11
14
votes
2 answers

Syntax error in javax.xml.xpath.XPathFactory provider-configuration file of Saxon-HE 9.3

I am using Java SE 6 on Mac OS X and Saxon-HE 9.3.0.5. The ServiceLoader is not able to find the Saxon implementation of javax.xml.xpath.XPathFactory. mac:test2 ludo$ java -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build…
Ludovic Kuty
  • 4,868
  • 3
  • 28
  • 42
11
votes
3 answers

Saxon 9 XSLT transformer vs Xalan 2.7

I am currently using Xalan 2.7.0 for XSLT transformations over XML, but thinking over to switch to Saxon 9 version for XSLT transformations. So could someone list me the major cons and prons of using Saxon over Xalan . Although i know that Saxon…
Aditya
  • 159
  • 1
  • 1
  • 10
10
votes
6 answers

How to execute XSLT 2.0 with ant?

I'm trying to run an XSLT transformation from an ant file. I'm using a XSLT 2.0 stylesheet with a saxon 9 parser (supporting XSLT 2.0). The problem is that it seems that ant is always calling an XSLT 1.0 parser. Here's my ant file :
paulgreg
  • 18,493
  • 18
  • 46
  • 56
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
9
votes
2 answers

Turn off xml header output in Saxon

Using the .NET version of Saxon 9.4, I run a command line like: Query.exe -s:myfile.xml -qs:/cruisecontrol/build/msbuild[@success='true']/project[1]/target[@name='GetLatestSource']/message[last()]/text() and I get a result like
Andrew
  • 14,325
  • 4
  • 43
  • 64
9
votes
1 answer

Saxon error with XSLT import statement

The Saxon processor gives me an error whenever I have an XSLT import statement. Here is the error: XTSE0165: I/O error reported by XML parser processing file: shared/test.xslt (The system cannot find the path specified): Here is how my XSLT…
Ayyoudy
  • 3,641
  • 11
  • 47
  • 65
9
votes
3 answers

Difference between newTransformer and newTemplates in Java XSLT transformations

In Java, from a TransformerFactory for creating objects to process XSLT, and it has the methods: newTransformer which creates Transformer object, which can transform XML into a result. newTemplates which creates Templates object which can create a…
Adrian Smith
  • 17,236
  • 11
  • 71
  • 93
9
votes
4 answers

How to run saxon xslt transformation in java

I can easily run the following in command line to transform an xml file: java -jar saxon9he.jar -o:outputfile.xml data.xml transform.xslt I would like to do the exact same results from within a java file so I can use it in part of a program I'm…
Robert Petty
  • 197
  • 1
  • 3
  • 17
9
votes
1 answer

XSLT function returns different results [Saxon-EE vs Saxon-HE/PE]

I am currently working on a pure XSL-Transformation with Saxon-Processor in various versions. Below is my short stylesheet, simplified for the needs of my question:
uL1
  • 2,117
  • 2
  • 17
  • 28
8
votes
1 answer

Using SAXON Xpath engine in Java

Here is my code : public static void main(String[] args) { // System.setProperty( // "javax.xml.xpath.XPathFactory", // "net.sf.saxon.xpath.XPathFactoryImpl"); String…
g andrieu
  • 2,081
  • 3
  • 14
  • 10
8
votes
4 answers

How to suppress indentation for XML output in XQuery

Is there a way from within an XQuery to remove indentation of the XML output? Eg. say I had an XQuery of; producing an XML result document of; How can I remove the indents so the output document looked like…
Nigel Alderton
  • 2,265
  • 2
  • 24
  • 55
8
votes
4 answers

Running XQuery on the command line

It sounds like I need some type of XML processor It looks like theres a program called Saxon which I can use to run XQuery When I try this websites example I get Error: Could not find or load main class net.sf.saxon.Query I don't know how to set…
Sam
  • 1,765
  • 11
  • 82
  • 176
1
2 3
99 100