"); break; case "name": print(""); print(""); break; case "intro": print("<h4><i>"); break; case "outro": print("<i>"); break; case "p": print("<p>"); break; case "section": print('<b>' . $attribs['name'] . '</b><br />'); print("<title>"); break; } print ('in HBT'); } function HandleCharacterData($parser, $data) { switch ($GLOBALS['currentTag']) { case "name": AppendToGlobal ($currentTag, $data); case "intro": case "p": case "outro": print ($data); break; case "email": case "author": case "date": AppendToGlobal($currentTag, $data); break; } print ('In HCD'); } function HandleEndTag($parser, $name) { swich($name) { case "article": print ("</html>"); break; case "name": print(""); print(""); print(""); print("

" . $GLOBALS["name"] . "

"); break; case "intro": print(""); break; case "outro": print(""); print(""); break; case "p": print("

"); break; case "date": print('Written by ' . $GLOBALS["author"] . ' (' . $GLOBALS['email'] . ') on ' . $GLOBALS['date']); break; } print ('in HET'); } funcion AppendToGlobal($variableName, $value) { global $($variableName); $($variableName) .= $value; $($variableName) = trim(${$varableName}); } /* MAIN APPLICATION */ $xmlParser = CreateParser(); SetOptions($xmlParser); SetHandlers($xmlParser); $fp = OpenFile('article.xml'); Parse($xmlParser, 'article.xml'); FreeParser($xmlParser); ?>