Project

Profile

Help

Bug #5839

closed

SaxonCS.exe query -qs doesn't find file in local working directory: FODC0002 Exception thrown by URIResolver

Added by Martin Honnen almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Command Line
Sprint/Milestone:
Start date:
2023-01-19
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
.NET

Description

Testing on Windows, I can run e.g. Saxon HE Java fine from the command line with -qs:"'cars-example-json-as-xml.xml' => doc() => xml-to-json()", it finds the local file cars-example-json-as-xml.xml fine.

SaxonCS (tested with both 11 and 12), however fails, looking for a file file:///C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json/file:/C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json:

'C:\Program Files\Saxonica\SaxonCS-12.0\SaxonCS.exe' query -t -qs:"'cars-example-json-as-xml.xml' => doc() => xml-to-json()"
SaxonCS-EE 12.0 from Saxonica
.NET 6.0.10 on Windows 10.0.22621.0
Using license serial number V..
..
Analyzing query from {'cars-example-json-as-xml.xml' => doc() => xml-to-json()}
Analysis time: 18.4502 milliseconds
Error on line 1 column 1 of xml-to-json:
  FODC0002  Exception thrown by URIResolver resolving `cars-example-json-as-xml.xml` against
  `file:///C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json/file:/C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.OpenRead(String path)
   at Org.XmlResolver.Utils.UriUtils._getFileStream(String uri)
   at Org.XmlResolver.Utils.UriUtils.GetStream(String uri, Assembly asm)
   at Org.XmlResolver.Utils.UriUtils.GetStream(Uri uri)
   at Saxon.Callbacks.DirectResourceResolver.resolve(JJ_ResourceRequest request)
   at Saxon.Hej.lib.JJ_ResourceRequest.resolve(JJ_ResourceResolver[] resolvers)
   at Saxon.Hej.functions.DocumentFn.resolveURI(String href, String baseURI, String documentKey, XPathContext context)
: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. : 'C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\xml-to-json\file:\C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\cars-example-json-as-xml.xml'
<?xml version="1.0" encoding="UTF-8"?>Query processing failed: Exception thrown by URIResolver resolving `cars-example-json-as-xml.xml` against `file:///C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json/file:/C:/Users/marti/OneDrive/Documents/xslt/blog-xslt-3-by-example/xml-to-json': Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. : 'C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\xml-to-json\file:\C:\Users\marti\OneDrive\Documents\xslt\blog-xslt-3-by-example\cars-example-json-as-xml.xml'
Exiting with code 2

That seems a bug to me.

Please register to edit this issue

Also available in: Atom PDF