[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

php4-xslt extenstion problem



I'm running Debian Sarge, and a recent upgrade seems to have broken all my
XSL stylesheets.

I've allways been using relative paths, and this has been working fine, but
suddenly now, I have to use absolute paths to the xslt_process() function,
or use xslt_set_base($xslt, 'file://'.getcwd().'/'); to specify the base.

This still doesn't solve the problem with using <xsl:include> from within
the stylesheets though, and sablotron is still unable to find my included
stylesheets.
They're all in the same folder. My originals are in separate folders, but
this produces the same error.

I'd appreciate any suggestions for resolutions to this problem.

A simplified version of my PHP and XSL files are as follows:
testxsl.php:
<?php

$xml = '<'.'?xml version="1.0" encoding="ISO-8859-1"'.'?>
       <root>
           <test>123</test>
           <test>456</test>
       </root>';

$xslt = xslt_create ();
xslt_set_encoding ($xslt, "ISO-8859-1");

xslt_set_base($xslt, 'file://'.getcwd().'/'); # This resolves the first
problem with having to specify path in xslt_process
echo xslt_process($xslt,
                 'arg:/_xml',
                 'test.xsl',
                 NULL,
                 array('/_xml' => $xml));
xslt_free($xslt);

?>
=============================================================
test.xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="xml" version="1.0"
           encoding="iso-8859-1" indent="yes"
           doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
           doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

<xsl:include href="file://test2.xsl"/>

<xsl:template name="content">
<xsl:for-each select="/root/test">
   <xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
=============================================================
test2.sl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:output method="xml" version="1.0"
           encoding="iso-8859-1" indent="yes"
           doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
           doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

<xsl:template match="/">
   <xsl:call-template name="content"/>
</xsl:template>


</xsl:stylesheet>


--
Tommy



Reply to: