30 if ($encoded) $xml = base64_decode(($xml));
31 $xml2 =
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\" ?>";
32 $xml2.= str_replace(
"<BR>",
"<BR/>", $xml);
63 $xml_parser = xml_parser_create(
"ISO-8859-1");
65 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING,
true);
66 xml_set_element_handler($xml_parser,
"startElementXml",
"endElementXml");
67 xml_set_character_data_handler($xml_parser,
"characterDataXml");
69 if (!xml_parse($xml_parser, $fp)) {
70 die(sprintf(
"XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)) , xml_get_current_line_number($xml_parser)));
72 xml_parser_free($xml_parser);
74 while ($attribut = each($tabvalues)) {
79 if (
sizeof($list[$attribut[0]]) != 0) {
83 while ($x = each($list[$attribut[0]])) {
91 $idoc->SetValue($attribut[0], $value);
93 $idoc->SetValue($attribut[0], $attribut[1]);
103 while (list($att, $valeur) = each($attrs)) {
104 $balise.=
" $att=\"$valeur\"";
128 if ($depth_index == 1) {
129 $title = $attrs[
"TITLE"];
137 if ($depth_index == 3) {
164 $value = trim($value);
166 if ($depth_index == 3) {
169 $tabvalues[
$name] = base64_encode($value);
175 $tabvalues[
$name] =
"something";
178 $list[
$name][$i] = base64_encode($value);
203 if (chop($data) !=
"") {
211 $title = stristr($xml,
"$nom_arg=");
214 $fin = strpos(
$title,
"\"");