Skip to content

Update SaxonHE to version 11.2 #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2022
Merged

Update SaxonHE to version 11.2 #149

merged 1 commit into from
Oct 23, 2022

Conversation

stweil
Copy link
Member

@stweil stweil commented Jul 9, 2022

The new version needs more jar files from the zip archive,
so simply extract all files included there.

Signed-off-by: Stefan Weil [email protected]

The new version needs more jar files from the zip archive,
so simply extract all files included there.

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Member Author

stweil commented Jul 10, 2022

SaxonHE 11 also supports Python code like in this example:

#!/usr/bin/python3

stylesheet_file = 'alto__hocr.xsl'
source_file = 'wetzel_reisebegleiter_1901_0021.alto'

from saxonc import *

with PySaxonProcessor(license=False) as proc:
    xdmAtomicval = proc.make_boolean_value(False)
    xsltproc = proc.new_xslt30_processor()
    outputi = xsltproc.transform_to_string(source_file=source_file, stylesheet_file=stylesheet_file)
    print(outputi)

saxonc was installed using instructions from https://saxonica.com/html/download/c.html and
from https://www.saxonica.com/saxon-c/documentation11/index.html#!starting/installingpython like this:

wget https://saxonica.com/download/libsaxon-HEC-setup64-v11.3.zip
unzip libsaxon-HEC-setup64-v11.3.zip
cd libsaxon-HEC-11.3/
mkdir lib
cp -al libsaxonhec.so rt saxon-data lib
export SAXONC_HOME=$PWD/lib
python3.9 -m venv ../venv3.9
source ../venv3.9/bin/activate
pip install -U pip setuptools wheel
pip install cython
cd Saxon.C.API/python-saxon/
python3 saxon-setup.py build_ext -if
export PYTHONPATH=$PWD

Copy link
Collaborator

@kba kba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python bindings are nice and it's a good idea to update Saxon in any case, we're three major versions behind.

@stweil stweil merged commit c9aca90 into master Oct 23, 2022
@stweil stweil deleted the saxon branch October 23, 2022 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants