Sun Oct 26, 2008 6:47 pm
<?php
$file = "contact.xml";
function startElement($parser, $name, $attrs) {
print "<B>$name =></B> ";
}
function endElement($parser, $name) {
print "\n";
}
function characterData($parser, $value) {
print "$value<BR>";
}
$simpleparser = xml_parser_create();
xml_set_element_handler($simpleparser, "startElement", "endElement");
xml_set_character_data_handler($simpleparser, "characterData");
if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}
while($data = fread($fp, filesize($file))) {
if (!xml_parse($simpleparser, $data, feof($fp))) {
die(xml_error_string(xml_get_error_code($simpleparser)));
}
}
xml_parser_free($simpleparser);
?>
<!--
<contact id="43956">
<personal>
<name>
<first>J</first>
<middle>J</middle>
<last>J</last>
</name>
<title>Manager</title>
<employer>National Company</employer>
<dob>1951-02-02</dob>
</personal>
</contact>
-->
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.