|    
			
				15/06/2005, 05:51
			
			
			  | 
  |   |  |  |  Fecha de Ingreso: enero-2002 Ubicación: Graná 
						Mensajes: 646
					 Antigüedad: 23 años, 9 meses Puntos: 0 |  | 
  |  Se me olvidaba incluir el código:
 
 function startElement($parser, $name, $attrs) {
 global $matriz_inicial;
 if ($htmlexpr = $matriz_inicial[$name])
 echo "<tr><td colspan=3>$htmlexpr";
 }
 
 function endElement($parser, $name) {
 global $matriz_final;
 if ($htmlexpr = $matriz_final[$name])
 echo "$htmlexpr</td></tr>";
 }
 
 function characterData($parser, $data) {
 echo $data;
 }
 
 
 //Aquí empieza la lectura del fichero XML.
 $xml_parser = xml_parser_create();
 
 // Opciones del objeto xml: no tener en cuenta las minúsculas.
 xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
 
 // Manejadores de elemento inicial y final: qué es lo que tiene que hacer.
 xml_set_element_handler($xml_parser, "startElement", "endElement");
 
 // Manejador para los datos leídos.
 xml_set_character_data_handler($xml_parser, "characterData");
 
 if (!($fp = fopen($fichero, "r"))) {die("¡Error! no se puede abrir el fichero: ".$fichero);}
 
 // Leemos el fichero
 while ($data = fgets($fp)) {
 if (!xml_parse($xml_parser, $data, feof($fp)))
 die(sprintf("Error XML : %s en la línea %d", xml_error_string(xml_get_error_code($xml_parser)),
 xml_get_current_line_number($xml_parser)));
 } // end del while
 
 // Liberamos la memoria.
 xml_parser_free($xml_parser);
 
 He obviado algunos datos. Los valores de las etiquetas se cogen de un formulario y se meten en las matrices "matriz_inicial" y "matriz_final". Eso lo he comprobado y está bien y no lo pongo para no liar más. Ayuda porfaaaa
     |