On 25.07.2018 15:44, Omar Siam wrote:
I have an XSL snippet that includes and imports some XSL files.
I pass this to xslt:transform and the includes and imports are resolved using the working directory where basex was started from.
On my server that was / and on my Windows development machine C:\Users\user\basex\bin. This was not what I expected.
Quick way to see the effect:
declare namespace xsl="http://www.w3.org/1999/XSL/Transform";
xslt:transform(<root><test/></root>, <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="test"><root><xsl:value-of select="static-base-uri()"/></root></xsl:template> </xsl:stylesheet>)
Perhaps in a future version it may be possible to set that to the directory the XQuery runs from or to be able to just specify what it should be.
Can't you "just specify what it should be" by putting the base URI you want into
<xsl:stylesheet xml:base="file:///C:/dir/subdir" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> ... </xsl:stylesheet>
or perhaps picking up that static base URI from XQuery with
xslt:transform(<root><test/></root>, <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:base="{static-base-uri()}" version="2.0"> <xsl:template match="test"><root><xsl:value-of select="static-base-uri()"/></root></xsl:template> </xsl:stylesheet>)
? I am not sure that is what you want but I am also not sure whether you have considered it.