Bug #5789
closedSaxonC 11.99 on Windows: using file paths with Windows separator backslash doesn't seem to work, need to use forwards slash
100%
Description
Issue reported by user here: https://saxonica.plan.io/boards/4/topics/9165
Under Windows the SaxonC APIs which use file paths with backward slashes fails. SaxonC 12 now uses the XML resolver under the hood to manage resolving of filenames. This is bug in SaxonC because the XML resolver is expecting URIs, but SaxonC is passing a string with "", which isn't allowed in URIs.
The advice given is to "urify" the strings that come from the user to make Windows filenames into URIs. It is a complicated issue. We also have to deal with "C:" at the front, "C:/path" isn't a valid URI, you need something like "file:///C:/path"
Some background example, https://spec.xproc.org/3.0/xproc/#f.urify
Updated by O'Neil Delpratt almost 2 years ago
The following error message is reported by SaxonC:
Exception from catalog resolver resolverURI()
Updated by Martin Honnen almost 2 years ago
Probably no solution for SaxonC itself but with Python I have looked through existing modules around paths and from pathlib import Path
permits me to use e.g. xslt30_executable.set_base_output_uri(Path('.', 'result.xml').absolute().as_uri())
to construct a file URI that SaxonC 11.99 does understand.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Bug fix applied in the resolveFileToSource java method of the class SaxonCAPI
Updated by O'Neil Delpratt almost 2 years ago
I have applied a similar fix to comment #2 by creating a File object and getting the URI.
Updated by O'Neil Delpratt almost 2 years ago
- Status changed from Resolved to Closed
- Fixed in version set to 12.0
Bug fix applied in the SaxonC 12.0 major release.
Please register to edit this issue