Arbre XML d'un fichier project STAF-18 (EVA) déposée
Ce formulaire s'addresse aux gens qui veulent programmer PHP/XML ou
aux curieux qui veulent regarder la structure de leur fichier XML.
$content\n";
}
echo " ";
}
}
function stack_printer ($el) {
echo "$el ";
}
function show_stack ($indent) {
global $stack, $astack;
global $pointer, $apointer, $current;
global $xml_tree, $xml_stack, $xml_data, $xml_attrs, $html_tree
echo "$indent\n";
array_walk ($stack, 'stack_printer');
// echo "Current attrs : ";
// array_walk ($astack[$apointer], 'stack_printer');
// echo " \n";
}
// ----------------------- The 3 functions for the PHP XML Parser
// xml_parse fait appel à ces fonctions
// grab current element and push it onto the stack
// push its attributs on the astack
function startElement($parser, $name, $attrs) {
global $stack, $astack;
global $pointer, $apointer, $current;
global $xml_tree, $xml_stack, $xml_data, $xml_attrs, $html_tree;
$pointer = push ($stack, $name) -1 ;
$apointer = push ($astack, $attrs) -1 ;
// the current element
$current = $name;
if ($html_tree) { echo "\n
$current\n"; };
if ($xml_tree) { echo "\n
<$current>\n"; };
if ($xml_stack) { show_stack("\nstack=\n"); };
if ($xml_attrs) { attr_printer($attrs); } ;
}
// pop off the element from the stack
// pop off the attributes from the astack
function endElement($parser, $name) {
global $stack, $astack;
global $pointer, $apointer, $current;
global $xml_tree, $xml_stack, $xml_data, $xml_attrs, $html_tree;
if ($html_tree) {echo "\n