ID: 33240
Updated by: [EMAIL PROTECTED]
Reported By: jacob at jacobweber dot com
Status: Open
-Bug Type: XML related
+Bug Type: Documentation problem
Operating System: Fedora Core 3
PHP Version: 5.0.4
New Comment:
Yes, it skips whitespace when you set it to 1.
Otherwise it will not skip it, it's left as is.
I could not find the documentation for these options
(on the page for xml_parser_set_option()):
XML_OPTION_SKIP_WHITE
XML_OPTION_SKIP_TAGSTART
even as they seem to have existed since PHP 3? :)
Previous Comments:
------------------------------------------------------------------------
[2005-06-03 22:50:41] jacob at jacobweber dot com
Description:
------------
Turning on XML_OPTION_SKIP_WHITE causes the space in the following XML
to be skipped:
<a>' &</a>
I believe this is incorrect. It doesn't skip the space in:
<a>& '</a>
Jacob
Reproduce code:
---------------
$xmlStr = "<a>' &</a>";
$xmlParser = xml_parser_create();
xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($xmlParser, $xmlStr, $xmlArr);
xml_parser_free($xmlParser);
print_r($xmlArr);
Expected result:
----------------
Array
(
[0] => Array
(
[tag] => A
[type] => complete
[level] => 1
[value] => ' &
)
)
Actual result:
--------------
Array
(
[0] => Array
(
[tag] => A
[type] => complete
[level] => 1
[value] => '&
)
)
(note the missing space after the apostrophe
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33240&edit=1