XSLT import with relative path fails

Tuesday, 2 October 2012 · 2 messages · last reply 4 Oct 2012
CK
Charles Kowalski2 Oct 2012 16:50 #
Hi, I am trying to use TEI-to-xhtml stylesheet* provided by the tei consortium using the saxon HE transformer. The importing of xsl dependencies fails with this error: XTSE0165: I/O error reported by XML parser processing file:/../xhtml2/tei.xsl: /../xhtml2/tei.xsl (No such file or directory) The specific file i try to run is The actual href in the xsl:import is <xsl:import href="../../../xhtml2/tei.xsl"/> From the error message it looks as if the relative path: "../../../xhtml2/tei.xsl" is converted to the (non-existent) absolute path: "/../xhtml2/tei.xsl The same transformation works fine if called from the cli with java -jar path/to/saxon9he.jar some-tei.xml path/to/tei-stylesheets/xml/tei/stylesheet/profiles/tei/html/to.xsl Is there some sort of url resolution happening on behalf of basex before the xsl is passed to saxon? I will try to reproduce with a set of less complex xsl files but it seems like the issue lies with relative path resolution. Thanks, Alexandros *You can download the latest stylesheets from sourceforge at: http://sourceforge.net/projects/tei/files/Stylesheets/tei-xsl-6.14.zip/download
MS
Michael Seiferle4 Oct 2012 10:48 #
Hi Alexandros, thanks for your mail, I will have a look at this. IIRC there is no URI resolution on BaseX’ behalf, but maybe the current working directory for Saxon is not set to what Saxon expects. Out of curiosity, does it work if you use absolute paths in the first place? I guess you are calling sth. like xslt:transform($doc, "path/to/tei/...") I'll try to have a look at it this afternoon, I guess this issue might as well affect other users. If you could provide me with a SSCE that can be run easily that would be great but not a necessity. Cheers Michael
Quoted text · Charles Kowalski · 27 lines
Am 02.10.2012 um 16:50 schrieb Charles Kowalski <alxarch at gmail.com>: > Hi, > > I am trying to use TEI-to-xhtml stylesheet* provided by the tei consortium using the saxon HE transformer. > The importing of xsl dependencies fails with this error: > XTSE0165: I/O error reported by XML parser processing file:/../xhtml2/tei.xsl: > /../xhtml2/tei.xsl (No such file or directory) > The specific file i try to run is > The actual href in the xsl:import is <xsl:import href="../../../xhtml2/tei.xsl"/> > > From the error message it looks as if the relative path: "../../../xhtml2/tei.xsl" > is converted to the (non-existent) absolute path: "/../xhtml2/tei.xsl > > The same transformation works fine if called from the cli with > java -jar path/to/saxon9he.jar some-tei.xml path/to/tei-stylesheets/xml/tei/stylesheet/profiles/tei/html/to.xsl > Is there some sort of url resolution happening on behalf of basex before the xsl is passed to saxon? > > I will try to reproduce with a set of less complex xsl files but it seems like the issue lies with relative path resolution. > > Thanks, > Alexandros > > *You can download the latest stylesheets from sourceforge at: http://sourceforge.net/projects/tei/files/Stylesheets/tei-xsl-6.14.zip/download > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

⚡Generated with XQuery