Hi list!
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.
Best regards
Omar Siam
Hi Omar,
As the XSLT transformer is not part of the BaseX code, we may need to find out if we can set the base URI to the generated transformer instance [1]. Maybe a custom URI resolver could be assigned? Suggestions are welcome.
Best, Christian
[1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba...
On Wed, Jul 25, 2018 at 3:44 PM Omar Siam Omar.Siam@oeaw.ac.at wrote:
Hi list!
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.
Best regards
Omar Siam
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.
basex-talk@mailman.uni-konstanz.de