I'm trying to use fn:transform() within a XSL stylesheet for the first time, where the stylesheet is stored in eXist-db:
transform(map{'stylesheet-location':'xmldb:exist:///db/sample.xsl', 'source-node':$xml})
sample.xml contains imports, e.g. <xsl:import href="functions.xsl"/>. It works when running the main XSL in oXygen. But when I run it in eXist-db, I get the following error:
exerr:ERROR Exception while transforming node: I/O error reported by XML parser processing file:/Applications/eXist-db.app/Contents/Resources/functions.xsl: /Applications/eXist-db.app/Contents/Resources/functions.xsl (No such file or directory) [at line 127, column 30]
So it looks like Saxon is looking for the imported XSL in the filesystem where the app is intalled, rather than in eXist-db, where sample.xsl is located. How can I get fn:transform() to call an XSL in eXist-db, and have the imports also come from eXist-db?
I tried adding 'stylesheet-base-uri':'xmldb:exist:///db/' to the map parameter of fn:transform(), but that did not resolve it.