ID: 32581
Updated by: [EMAIL PROTECTED]
Reported By: acoster at gmail dot com
-Status: Open
+Status: Wont fix
Bug Type: XML related
Operating System: Linux 2.4.26-grsec
PHP Version: 4.3.10
New Comment:
In PHP 5 this extension uses libxml2. In PHP 4 it uses expat.
You might wanna try with external expat library. (add
--with-expat-dir=/install/prefix to your configure line)
Previous Comments:
------------------------------------------------------------------------
[2005-04-05 03:47:53] acoster at gmail dot com
Description:
------------
When using a xml_parser, initialized with the function above, any
newlines inside a cdata block (even when the node is enclosed in
<![CDATA[]>) are ignored. The same function was tested with PHP 5, and
it worked.
Reproduce code:
---------------
class Article_Parser {
function Article_Parser($fname) {
$this->xp = xml_parser_create();
xml_parser_set_option($this->xp, XML_OPTION_TARGET_ENCODING,
"ISO-8859-1");
xml_set_element_handler($this->xp, 'openTag', 'closeTag');
xml_parser_set_option($this->xp,XML_OPTION_SKIP_WHITE, 0);
xml_set_character_data_handler($this->xp, 'cdataHandler');
xml_set_object($this->xp, $this);
$this->tree = array();
$this->__stack = array();
$this->__sptr = -1;
xml_parse($this->xp, file_get_contents($fname)) or die('Erro ao
fazer parsing do arquivo!');
xml_parser_free($this->xp);
}
Expected result:
----------------
A parsed XML file with its newlines.
Actual result:
--------------
A parsed XML file, whose newlines were ignored.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32581&edit=1