Let's wait for what O'Neil has to say, unfortunately the SaxonC 12.4 branch doesn't seem to be online yet at https://saxonica.plan.io/projects/saxonmirrorhe/repository/he?utf8=%E2%9C%93&rev=saxon12.
In an experiment of my own I managed all the following to run from Windows and Linux:
from saxonche import PySaxonProcessor, PySaxonApiError
from pathlib import Path
with PySaxonProcessor() as saxon_proc:
print(saxon_proc.version)
xslt_processor = saxon_proc.new_xslt30_processor()
filenames = [r'sample1 sheet.xsl', r'dir space test\sample1 sheet.xsl', r'dir space test/sample1 sheet.xsl']
filenames.extend([Path(filename).as_posix() for filename in filenames])
for filename in filenames:
try:
print(f'Running {filename}:')
xslt_executable = xslt_processor.compile_stylesheet(stylesheet_file=filename)
print(xslt_executable.call_template_returning_string())
except PySaxonApiError as e:
print(e.message)
print()
Windows output:
(venv) PS C:\Users\marti\PycharmProjects\SaxonCHE124FilePathWithSpaces> python .\main.py
SaxonC-HE 12.4 from Saxonica
Running sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl-->
Running dir space test\sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20te
st/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running dir space test/sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20te
st/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.
xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl-->
Running dir space test/sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20te
st/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running dir space test/sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20te
st/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:51:07.1600576+01:00; static-base-uri: file:///C:/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Linux output:
(saxonche1241) mh@LIBERTYDELL23:/mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces$ python main.py
SaxonC-HE 12.4 from Saxonica
Running sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.7209+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.7209+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl-->
Running dir space test\sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.740001+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.740001+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running dir space test/sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.758782+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.758782+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.772325+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.772325+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/sample1%20sheet.xsl-->
Running dir space test\sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.790236+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.790236+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
Running dir space test/sample1 sheet.xsl:
<p>Run with SAXON HE 12.4 at 2023-12-02T07:52:37.807477+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl</p><!--Run with SAXON HE 12.4 at 2023-12-02T07:52:37.807477+01:00; static-base-uri: file:///mnt/c/Users/marti/PycharmProjects/SaxonCHE124FilePathWithSpaces/dir%20space%20test/sample1%20sheet.xsl-->
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">
<xsl:output method="html" indent="yes" html-version="5"/>
<xsl:template match="/" name="xsl:initial-template">
<p>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} at {current-dateTime()}; static-base-uri: {static-base-uri()}</p>
<xsl:comment>Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} at {current-dateTime()}; static-base-uri: {static-base-uri()}</xsl:comment>
</xsl:template>
</xsl:stylesheet>