SaxonCS: fn:transform in XQuery called with relative URI for source-location fails with "Unable to retrieve URI source.xml" while SaxonJ can run the XQuery fine

Added by Martin Honnen over 1 year ago

I found that SaxonCS (tested with 11.3 on both Windows and Linux) fails to run XQuery code from the command line where the XQuery calls fn:transform with a map having a file name as a relative URI provided for 'source-location'. The file exists in the same directory as the executed XQuery and the XQuery run with SaxonJ works fine.


  map {
    'source-location' : 'source.xml',
    'stylesheet-location' : 'sheet.xsl'

when run with SaxonJ from the command line successfully runs fn:transform while SaxonCS gives the following error:

   Unable to retrieve URI source.xml
Error on line .. column .. of query.xq:

   at Saxon.Hej.s9api.Xslt30Transformer.applyTemplates(Source source, Destination destination)
   at context, Sequence[] arguments)
: Unable to retrieve URI source.xml

Please register to reply