Skip to main content

Official Saxonica python package for the SaxonC-HE 12.4.2 processor: for XSLT 3.0, XQuery 3.1, XPath 3.1 and XML Schema processing.

Project description

Welcome to SaxonC-HE

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.

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 evaluation license is available free of charge. By downloading the software, you are agreeing to our terms and conditions.

For full documentation for the latest SaxonC release, see the SaxonC 12 documentation.

Why choose SaxonC?

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. It even includes experimental support for the draft 4.0 specifications currently under development.

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

with PySaxonProcessor(license=False) as proc:
	print(proc.version)

It will print something like this:

SaxonC-HE 12.4.2 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 where the main SaxonC library has been installed, and the directory identified by the environment variable SAXONC_HOME.

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:

from saxonche import *

with PySaxonProcessor(license=False) as proc:
 
xsltproc = proc.new_xslt30_processor()
document = proc.parse_xml(xml_text="<doc><item>text1</item><item>text2</item><item>text3</item></doc>")
executable = xsltproc.compile_stylesheet(stylesheet_file="test.xsl")
output = executable.transform_to_string(xdm_node=document)
print(output)

For more Python examples, and further details about installing and configuring the product, see the SaxonC 12 documentation.

Support

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

saxonche-12.4.2-cp312-cp312-win_amd64.whl (17.1 MB view hashes)

Uploaded CPython 3.12 Windows x86-64

saxonche-12.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

saxonche-12.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

saxonche-12.4.2-cp312-cp312-macosx_11_0_arm64.whl (17.4 MB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

saxonche-12.4.2-cp312-cp312-macosx_10_9_x86_64.whl (17.3 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

saxonche-12.4.2-cp311-cp311-win_amd64.whl (17.1 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

saxonche-12.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

saxonche-12.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.1 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

saxonche-12.4.2-cp311-cp311-macosx_11_0_arm64.whl (17.4 MB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

saxonche-12.4.2-cp311-cp311-macosx_10_9_x86_64.whl (17.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

saxonche-12.4.2-cp310-cp310-win_amd64.whl (17.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

saxonche-12.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

saxonche-12.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

saxonche-12.4.2-cp310-cp310-macosx_11_0_arm64.whl (17.4 MB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

saxonche-12.4.2-cp310-cp310-macosx_10_9_x86_64.whl (17.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

saxonche-12.4.2-cp39-cp39-win_amd64.whl (17.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

saxonche-12.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

saxonche-12.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

saxonche-12.4.2-cp39-cp39-macosx_11_0_arm64.whl (17.4 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

saxonche-12.4.2-cp39-cp39-macosx_10_9_x86_64.whl (17.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

saxonche-12.4.2-cp38-cp38-win_amd64.whl (17.1 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

saxonche-12.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (20.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

saxonche-12.4.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (20.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

saxonche-12.4.2-cp38-cp38-macosx_11_0_arm64.whl (17.4 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

saxonche-12.4.2-cp38-cp38-macosx_10_9_x86_64.whl (17.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page