ID:               26188
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sergey at bds dot ru
-Status:           Open
+Status:           Bogus
 Bug Type:         XML related
 Operating System: Windows
 PHP Version:      4.3.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The CDATA section and the ordinary text node are no different
semantically... How come you think the CDATA section should be
represented as a separate node...



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

[2003-11-10 03:04:20] sergey at bds dot ru

In a "Expected result" section the second array with the supposed CDATA
Section should have value of the "tag" attribute "#cdata-section"

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

[2003-11-10 02:57:14] sergey at bds dot ru

Description:
------------
When parse_xml_into_structure parses an xml, it seems for me that it
skips the CDATA section. 
Parser assumes the CDATA node as an usual value of its node.
But, it should be actually parsed into a new child node - CDATA section

Reproduce code:
---------------
test.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<PlaceHolderList>
<![CDATA[
function fnShow()
{

}
]]>
</PlaceHolderList>

test.php
$strXml      = implode("", file("test.xml"));
$objParser   = xml_parser_create();
xml_parser_set_option($objParser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($objParser, XML_OPTION_SKIP_WHITE,   1);
xml_parse_into_struct($objParser, $strXml, $arrParserValues,
$arrParserIndexes);
print_r($arrParserValues);

Expected result:
----------------
Array
(
    [0] => Array
        (
            [tag] => PlaceHolderList
            [type] => complete
            [level] => 1
            [value] => 
    [1] => Array
        (
            [tag] => PlaceHolderList
            [type] => cdata
            [level] => 2
            [value] => function fnShow(){    var aAll = document.all;  
 var e = new Enumerator(aAll);    while (!e.atEnd())    {>        alert
(e.item());        e.moveNext();    }}
        )

)

Actual result:
--------------
Array
(
    [0] => Array
        (
            [tag] => PlaceHolderList
            [type] => complete
            [level] => 1
            [value] => function fnShow(){    var aAll = document.all;  
 var e = new Enumerator(aAll);    while (!e.atEnd())    {>        alert
(e.item());        e.moveNext();    }}
        )

)


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


-- 
Edit this bug report at http://bugs.php.net/?id=26188&edit=1

Reply via email to