");
break;
case "name":
print("
");
print("");
break;
case "intro":
print("");
break;
case "outro":
print("");
break;
case "p":
print("
");
break;
case "section":
print('' . $attribs['name'] . '
');
print("
");
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 ("");
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);
?>