ID:               24722
 Updated by:       [EMAIL PROTECTED]
 Reported By:      el_profesorfr at yahoo dot fr
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: SuSE Linux 7.3
 PHP Version:      4.3.2
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

Optional mode parameter was documented including possible values.


Previous Comments:
------------------------------------------------------------------------

[2003-07-21 11:56:29] el_profesorfr at yahoo dot fr

Yep, that works fine, thanks a lot!

However I noticed later that without the flag, most entity references
in the body of the source XML would be stripped (my initial "bug"
report), while on some occasions they would pass through unchanged (as
if it were raw data).
I can provide a .xml + .xsl pair if you want to look at it any further,
but I'm not sure if it deserves another bug report (might be a feature I
didn't understand, or a bug in libx*, ...).

Thomas

------------------------------------------------------------------------

[2003-07-21 05:52:39] [EMAIL PROTECTED]

You need to use the undocumented flags when loading the document:
$xml = domxml_open_file('page.xml',DOMXML_LOAD_SUBSTITUTE_ENTITIES);

------------------------------------------------------------------------

[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 "&#231;">
]>
<old>&ccedil;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>&#xE7;a marche !</new>

(&#xE7 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

Reply via email to