--TEST--
Bug #26614 (CDATA sections skipped on line count)
--SKIPIF--
--FILE--
';
// Case 2: replace some characters so that we get comments instead
$xmls["Comment"] ='
';
// Case 3: replace even more characters so that only textual data is left
$xmls["Text"] ='
-!-- ATA[
multi
line
CDATA
block
---
';
function startElement($parser, $name, $attrs) {
printf("<$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function endElement($parser, $name) {
printf("$name> at line %d, col %d (byte %d)\n",
xml_get_current_line_number($parser),
xml_get_current_column_number($parser),
xml_get_current_byte_index($parser));
}
function characterData($parser, $data) {
// dummy
}
foreach ($xmls as $desc => $xml) {
echo "$desc\n";
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!xml_parse($xml_parser, $xml, true))
echo "Error: ".xml_error_string(xml_get_error_code($xml_parser))."\n";
xml_parser_free($xml_parser);
}
?>
--EXPECTF--
CDATA
at line 2, col %d (byte 9)
at line 9, col %d (byte 56)
Comment
at line 2, col %d (byte 9)
at line 9, col %d (byte 56)
Text
at line 2, col %d (byte 9)
at line 9, col %d (byte 56)