This is the official Saxonica Python wheel package for
Saxon, an XML document processor. SaxonC
provides APIs to run XSLT 3.0 transformations, XQuery 3.1 queries, XPath 3.1, and
XML Schema validation.
Important security note
SaxonC is affected by the eMudhra CA compromise, because it contains its own
CA Cert bundle, separate from Python's own mechanisms like certifi.
These relate to the compromised eMudhra certificates. The 12.10.1 and 13.1.1
release adopts the mitigation recommended in CVE-2026-114820: they have been
rebuilt with updates that remove the set of impacted root CA certificates
related to eMudhra.
Users should upgrade from vulnerable versions immediately.
Vulnerable versions are SaxonC 12.6 to, and including, 12.10, 13.0, and 13.1.
Versions 12.5 and prior are not vulnerable because they predate the compromised
certificates.
If you must access remote HTTPS URIs, then no mitigation is possible, and you
should upgrade as soon as possible.
SaxonC-HE
The SaxonC release comes in separate wheels for the three product editions:
saxonche (SaxonC-HE: open-source Home Edition)
saxoncpe (SaxonC-PE: Professional Edition)
saxoncee (SaxonC-EE: Enterprise Edition)
SaxonC-PE and SaxonC-EE are commercial products that require a valid
license key. Licenses can be purchased from the
Saxonica online store.
Alternatively a 30-day
is available free of charge. By downloading the software, you are agreeing to our
.
The main reason for using SaxonC in preference to other XML
tools available for Python is that it supports all the latest W3C
standards: XSLT 3.0, XPath 3.1, XQuery 3.1, and XSD 1.1.
What's new in this version?
SaxonC-EE and SaxonC-PE 13 include support for many features in the XPath, XQuery, and XSLT
4.0 specifications currently in development in the QT4 Community Group.
For a record of bugs fixed in each maintenance release, please consult the
issues list — you can filter
the list on the property "Fixed in maintenance release". This is also the place
to report any problems you find.
About SaxonC
SaxonC is a version of Saxon developed by compiling the Java source code to native
executables that run on the C/C++ platform, with extensions for PHP and Python. All
features of Saxon have been ported, other than those (such as collations) that are
necessarily platform dependent. In particular, SaxonC provides processing in XSLT,
XQuery and XPath, and Schema validation. It therefore makes these processing capabilities
available to a plethora of other languages that are strongly coupled to C/C++ such as PHP,
Perl, Python, and Ruby.
About Saxonica
Saxon is developed by Saxonica, a company created in 2004 by Michael Kay, who was
the editor of the XSLT 2.0 and 3.0 specifications in W3C. The original Saxon product
on the Java platform has been continually developed for over 20 years, and has
acquired a reputation for standards conformance, performance, and reliability.
Installation
pip install saxonche
Getting started
Either import the whole API:
from saxonche import *
Or specific modules:
from saxonche import PySaxonProcessor
The SaxonC API includes classes for constructing XDM data models
and for a variety of processors. For full details see the SaxonC Python API
documentation.
The following short example shows how to get the Saxon version from
the PySaxonProcessor:
from saxonche import PySaxonProcessor
proc = PySaxonProcessor(license=False)
print(proc.version)
It will print something like this:
SaxonC-HE 13.1.1 from Saxonica
Note: license=False requests the open-source version of Saxon, whereas
license=True requests the commercial product - which requires a license file.
SaxonC looks for the license key in the directory identified by the environment
variable SAXONC_HOME. To explicitly set the location of the license key,
create a licensed PySaxonProcessor and set the licenseFileLocation property
on it before doing anything else:
from saxoncee import PySaxonProcessor
proc = PySaxonProcessor(license=True)
proc.set_configuration_property("http://saxon.sf.net/feature/licenseFileLocation",
"/path/to/saxon-license.lic")
...
Example: Running a transformation
The following basic example shows how an XSLT stylesheet can be run against a source
XML document in Python using SaxonC:
All users are welcome to use the public support site for
reporting issues and seeking help (registration required). In addition, many
questions are asked and answered on StackOverflow:
please use the saxon tag.
Acknowledgement
We learned a lot about how to create Python wheels for Saxon from the
Saxonpy wheel package, which is a third-party project
on github.
Alternatives
Use instead of saxonche: tools that do the same job, closest first.