Project

Profile

Help

SaxonCS: query -o option giving error

Added by Martin Honnen over 1 year ago

I thought I had used XQuery with the -o option and SaxonCS from the command line but it seems not, at least any, even simple attempts, fail with an error. "System.ArgumentException: The path is empty. (Parameter 'path')".

Example (Windows cmd shell):

"C:\Program Files\Saxonica\SaxonCS-11.3\SaxonCS.exe" query -qs:"<test>{current-dateTime()}</test>" -o:dateTimeTest.xml 

gives

System.ArgumentException: The path is empty. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at Saxon.Ejava.io.File..ctor(String name)
   at Saxon.Ejava.io.File.getParentFile()
   at Saxon.Hej.Query.createFileIfNecessary(File file)
   at Saxon.Hej.Query.doQuery(String[] args, String command)
Fatal error during query: ArgumentException: The path is empty. (Parameter 'path')
Exiting with code 2

Same attempt using Java java -cp "C:\Program Files\Saxonica\SaxonEE11-3J\saxon-ee-11.3.jar" net.sf.saxon.Query -qs:"<test>{current-dateTime()}</test>" -o:dateTimeTest.xml works fine.

SaxonCS transform -o seems to work so somehow it doesn't seem to be my shell use but some bug or quirk in the doQuery code.


Replies (3)

Please register to reply

RE: SaxonCS: query -o option giving error - Added by Michael Kay over 1 year ago

It's working for me on MacOS if the output filename includes a path, e.g. /Users/mike/xxx/test.xml, but I've reproduced the failure if it's a simple name like test.xml.

As a workaround, use -o:./dateTimeTest.xml

RE: SaxonCS: query -o option giving error - Added by Martin Honnen over 1 year ago

Thanks, can confirm that the -o:./dateTimeTest.xml workaround works even on Windows.

    (1-3/3)

    Please register to reply