#31139 [Opn->Fbk]: "XML Parser Functions" seem to drop & when parsing
| From: | chregu@php.net | Date: | Fri, 17 Dec 2004 06:53:56 +0000 |
| Subject: | #31139 [Opn->Fbk]: "XML Parser Functions" seem to drop & when parsing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-70445@lists.php.net to get a copy of this message | ||
ID: 31139
Updated by: chregu@php.net
Reported By: exaton at free dot fr
-Status: Open
+Status: Feedback
Bug Type: XML related
Operating System: Windows XP
PHP Version: 5.0.3
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Please give an example, which is selfrunning, yours isn't.
Previous Comments:
------------------------------------------------------------------------
[2004-12-16 23:09:49] exaton at free dot fr
(gave a more explicit title)
------------------------------------------------------------------------
[2004-12-16 23:06:24] exaton at free dot fr
Description:
------------
I parse my XML with the "XML parser functions" (xml_parser_create() and
all that). Up to PHP 5.0.2 I had no problem, and suddenly the following
has appeared in 5.0.3 :
I used to put é in an XML file to recuperate the é
HTML entity in my page output and therefore an acute-accentuated e in
the text. This was perfectly coherent with XML specs, and worked fine.
Now the output on the page has simply dropped the "&" that should come
from & , therefore parsing é into eacute; -- which of
course is perfectly unwanted.
é is of course not the only affected entity : I'm not seeing a
single & in any content obtained from parsing XML.
Note : explicitely passing a charset string to xml_parser_create() did
not solve this.
Reproduce code:
---------------
$this -> parser = xml_parser_create();
xml_parser_set_option($this -> parser, XML_OPTION_SKIP_WHITE, 1);
xml_parser_set_option($this -> parser, XML_OPTION_CASE_FOLDING, 0);
// $this -> contents has the plaintext contents of an XML file, prone
to contain things like é
xml_parse_into_struct($this -> parser, $this -> contents, $this ->
values, $this -> index);
xml_parser_free($this -> parser);
Expected result:
----------------
When I eventually recuperate the output with my custom architecture, I
expect things like é to have been parsed into é --
they always were up to and including PHP 5.0.2 .
Actual result:
--------------
In PHP 5.0.3, é for example is now parsed into eacute;
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31139&edit=1