From: el_profesorfr at yahoo dot fr Operating system: SuSE Linux 7.3 PHP version: 4.3.2 PHP Bug Type: DOM XML related Bug description: Losing entities during XSL transformation
Description: ------------ Hello, When transforming an XML document with the DomXsltStylesheet object, references to local entities in the source XML doc do not pass through. In the source code provided, I'm using page.xml as the source XML, sheet.xsl as the stylesheet, and transform.php as the PHP code of course. The problem can be seen simply by issuing 'php transform.php' on the command line. Hope I'm not missing something like an option, I'm not really an XML guru! Environment: - Linux SuSE 7.3 - Apache 2.0.47 - PHP 4.3.2 - libxml 2.5.8 - libxslt 1.0.31 Best regards, Thomas Reproduce code: --------------- ==== page.xml ==== <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE old [ <!ENTITY ccedil "ç"> ]> <old>ça marche !</old> ==== sheet.xsl ==== <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <new><xsl:apply-templates/></new> </xsl:template> </xsl:stylesheet> ==== transform.php ==== <? $xml = domxml_open_file ('page.xml'); $xsl = domxsl_xslt_stylesheet_file ('sheet.xsl'); $out = $xsl->process ($xml, array ()); $echo $xsl->result_dump_mem ($out); ?> Expected result: ---------------- The output of 'php transform.php' should be: <?xml version="1.0"?> <new>ça marche !</new> (ç being the UTF-8 escape sequence for ç) That's the output of the command 'xsltproc sheet.xsl page.xml' on the same machine. Actual result: -------------- You only get: <?xml version="1.0"?> <new>a marche !</new> The 'ç' got lost somewhere down on the pipe... PHP does the same thing when running as an Apache2 module. -- Edit bug report at http://bugs.php.net/?id=24722&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24722&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24722&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24722&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24722&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24722&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24722&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24722&r=support Expected behavior: http://bugs.php.net/fix.php?id=24722&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24722&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24722&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24722&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24722&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24722&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24722&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24722&r=gnused