From: michiel at trendserver dot nl
Operating system: Debian
PHP version: 5.0.2
PHP Bug Type: XSLT related
Bug description: exsl:document does not create directories
Description:
------------
The PHP5 XSL extension does not seem to create directories when using the
<exsl:document> element.
Reproduce code:
---------------
XML file (test.xml):
<?xml version="1.0"?>
<a>
<b>test1</b>
<b>test2</b>
</a>
XSLT file (test.xsl):
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">
<xsl:output method="html" indent="yes" encoding="US-ASCII"/>
<xsl:template match="a">
<exsl:document href="output/test.html" method="html">
<xsl:for-each select="b">
<p><xsl:value-of select="."/></p>
</xsl:for-each>
</exsl:document>
</xsl:template>
</xsl:stylesheet>
PHP file (exslt.php):
<?php
$xml = new DomDocument;
$xml->load('test.xml');
$xsl = new DomDocument;
$xsl->load('test.xsl');
$proc = new xsltprocessor;
$proc->importStyleSheet($xsl);
$proc->transformToXML($xml);
?>
Expected result:
----------------
Running 'xsltproc test.xsl test.xml' gives a directory 'output' with file
'test.html' containing '<p>test1</p><p>test2</p>'.
Running 'php exslt.php' should give the same result.
Actual result:
--------------
Warning: XSLTProcessor::transformToXml(output/test.html): failed to open
stream: No such file or directory in /var/www/experiment/exslt.php on line
10
Warning: No such file or directoryruntime error: file
/var/www/experiment/test.xsl element document in
/var/www/experiment/exslt.php on line 10
Warning: xsltDocumentElem: unable to save to output/test.html in
/var/www/experiment/exslt.php on line 10
Note: when an empty directory 'output' is created before running 'php
exslt.php', the file 'test.html' is created correctly.
--
Edit bug report at http://bugs.php.net/?id=30448&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30448&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30448&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30448&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30448&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30448&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30448&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30448&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30448&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30448&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30448&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30448&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30448&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30448&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30448&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30448&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30448&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30448&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30448&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30448&r=mysqlcfg