|
Posted by Nick Webster on 05/27/05 19:24
Hi,
I have a slight problem with parsing XML:
If the tag was say - <Something ID="12"> - My parser is only retrieving
the 'Something' part, and discarding the 'ID="12"'.
Code:
function startElement($xml_parser, $name, $attrs) {
echo $name; //this is the part with the issue
}
function endElementStuff($xml_parser, $name) {
}
function charData($xml_parser, $data) {
echo $data;
}
$xml_parser = xml_parser_create();
$ml_set_element_handler($xml_parser, "startElement", "endElementStuff");
xml_set_character_data_handler($xml_parser, "charData");
xml_parse($xml_parser, $result, TRUE);
xml_parser_free($xml_parser);
Any ideas?
TIA.
--
Nick Webster
[Back to original message]
|