By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

xsl imports relative to current file instead of xsl file

P: n/a
In the directory /var/www/dynamo/xsl is the basic xsl file for xhtml
documents /var/www/dynamo/xsl/xhtml.xsl. In this file there is an import
statement: <xsl:import href="xhtml/basic.xhtml.xsl" />.
This import statement should load /var/www/dynamo/xsl/xhtml/basic.xhtml.xsl
as far as I know.

The current document is /var/www/dynamo/xml/index.xml (.xml documents are
handled by the PHP parser on my server). This is the error message I get:
Warning: I/O warning : failed to load external entity
"/var/www/dynamo/xml/xhtml/basic.xhtml.xsl"
in /var/www/dynamo/lib/xml/content.class.php on line 10

Warning: compilation error: file /var/www/dynamo/xml/ element import
in /var/www/dynamo/lib/xml/content.class.php on line 10

Warning: xsl:import : unable to
load /var/www/dynamo/xml/xhtml/basic.xhtml.xsl
in /var/www/dynamo/lib/xml/content.class.php on line 10

If I change the import statement to
<xsl:import href="../xsl/xhtml/basic.xhtml.xsl" /> the page is displayed
correctly.

So from this I learn that the xsl imports are not relative to the parent xsl
file... This is confirmed by visiting the page
at /var/www/dynamo/xml/test/index.xml. With
the ../xsl/xhtml/basic.xhtml.xsl import statement I get the error:

Warning: I/O warning : failed to load external entity
"/var/www/dynamo/xml/xsl/xhtml/basic.xhtml.xsl"
in /var/www/dynamo/lib/xml/content.class.php on line 10

Warning: compilation error: file /var/www/dynamo/xml/test/ element import
in /var/www/dynamo/lib/xml/content.class.php on line 10

Warning: xsl:import : unable to
load /var/www/dynamo/xml/xsl/xhtml/basic.xhtml.xsl
in /var/www/dynamo/lib/xml/content.class.php on line 10

Same behaviour. I don't remember the XSL import to work like this :-(
Is it a change/bug in the latest xsl or php5 release? Can I change this
behaviour so that the imports are handled relative to the xsl file?

Thanks in advance,
Rutger Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.