SAX simple example
saxsimple.php:
<?php
// create a xml_parser Object
include_once("saxmain.php");
xml_set_element_handler($parser_object,"startElement","endElement");
//callback for start Elements
function startElement($parser_object, $elementname, $attribute) {
print "<ul>";
print "$elementname \n";
foreach ($attribute as $key => $value)
{
print "$key => $value; ";
}
}
//callback for end Element
function endElement($parser_object, $elementname) {
print "</ul>\n";
}
doParse($parser_object);
More Sax Callbacks
© copyright 2004 Bitflux GmbH