ID: 24722 Updated by: [EMAIL PROTECTED] Reported By: el_profesorfr at yahoo dot fr Status: Open -Bug Type: DOM XML related +Bug Type: Documentation problem Operating System: SuSE Linux 7.3 PHP Version: 4.3.2 New Comment:
You need to use the undocumented flags when loading the document: $xml = domxml_open_file('page.xml',DOMXML_LOAD_SUBSTITUTE_ENTITIES); Previous Comments: ------------------------------------------------------------------------ [2003-07-19 15:46:37] el_profesorfr at yahoo dot fr 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 this bug report at http://bugs.php.net/?id=24722&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php