Project

Profile

Help

Bug #5789

closed

SaxonC 11.99 on Windows: using file paths with Windows separator backslash doesn't seem to work, need to use forwards slash

Added by O'Neil Delpratt over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2023-01-03
Due date:
% Done:

100%

Estimated time:
Found in version:
11.99
Fixed in version:
12.0
Platforms:

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

Actions #1

Updated by O'Neil Delpratt over 1 year ago

The following error message is reported by SaxonC:

Exception from catalog resolver resolverURI()
Actions #2

Updated by Martin Honnen over 1 year 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.

Actions #3

Updated by O'Neil Delpratt over 1 year 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

Actions #4

Updated by O'Neil Delpratt over 1 year ago

I have applied a similar fix to comment #2 by creating a File object and getting the URI.

Actions #5

Updated by O'Neil Delpratt over 1 year 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

Also available in: Atom PDF