Bah, XML
| From: | szii@sziisoft.com | Date: | Sat, 03 Feb 2001 23:48:52 +0000 |
| Subject: | Bah, XML | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-38011@lists.php.net to get a copy of this message | ||
Why is this failing....?
If I comment out the xml_set_element_handler() call, it's okay...
If I comment out the xml_parse() call, it's okay...
If I leave both of them in...it core dumps.
Ideas?
-Szii
<?php
function startElement($parser, $name, $attrs)
{
}
function endElement($parser, $name)
{
}
$data = "<?xml version=\"1.0\"?><xml></xml>";
$xmlp = xml_parser_create();
xml_set_element_handler($xmlp, "startElement", "endElement");
if (!xml_parse($xmlp, $data, 1))
{
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xmlp)),
xml_get_current_line_number($xmlp)));
}
xml_parser_free($xmlp);
?>