Bonjour

Rare de voir un Perlien ici, non ?
Blague à part, voici mon problème. Je dispose d'un fichier XML que je parse et je veux récupérer la valeur de ces balises dans un tableau. Le XML en question est :
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
<array>
<variable_0>&lt;html&gt;&lt;body&gt;</variable_0>
<variable_1>Bonjour tout le monde</variable_1>
<variable_2>&lt;/body&gt;</variable_2>
<variable_3>&lt;html&gt;</variable_3>
</array>
Dans un fichier PHP, je dispose en variable globale d'un tableau et voici comment je procède :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<?php
 
/*
 * Created on 09-févr.-2006
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
$array=NULL;
 
function processing($id_analyseur, $value){
	 global $array;
	 $array = array();
	 print "$value";
	 $value = html_entity_decode($value, ENT_QUOTES, "ISO-8859-1");
	 array_push($array, $value);
}
 
function XMLFile2Array($xml) {
	global $array;
	$fichier = $xml;
	$id_fichier = fopen($fichier, "r");
	$XML_data = fread($id_fichier, filesize($fichier));
	$parser = xml_parser_create();
	//xml_set_element_handler($parser, "letsgo", "finish");
	xml_set_character_data_handler($parser, "processing");
	xml_parse($parser, $XML_data, feof($id_fichier));
	xml_parser_free($parser);
	fclose($id_fichier);
	echo "test:<br>";
	foreach ($array as $value){
 		$value = htmlentities($value, ENT_QUOTES, "ISO-8859-1");
 		echo "".$value."</br>";
 	}
	return $array;
}
 
?>
Or à la fin du script, mon tableau est vide. Où est mon erreur ?
Merci d'avance de vos réponses et en note, j'utilise PHP4.

@++