This has to be a noob issue, as I'm just starting with XQuery. I was successfully able to build a simple XQuery for eXist that runs an XSL transform. But I have been unsuccessful in building a similar XQuery for Saxon (9.9.1.5J) that runs an XSL transform.
Working XQuery for eXist:
xquery version "3.0";
transform:transform(doc("sample.xml"), doc("sample.xsl"), ())
Failing XQuery for Saxon:
xquery version "3.1";
transform(map{'source-node': doc('sample.xml'),'stylesheet-node':doc('sample.xsl')})
The error reported by Saxon is:
Query failed with dynamic error: Cannot serialize a map using this output method
I've searched Google and SO for this error, but get nothing. I have tried it with and without the output declaration, and with and without an output declaration in the XSL. I've tried it with fn:transform() and transform(). I put in a declaration for the fn namespace too. The transform works from the Saxon command line and from eXist. So I must be missing something simple about the building of the map for the options to fn:transform().