[phpXML] Beginners question
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. on b. of <fca...@la...> - 2001-10-10 22:09:05
|
Hello everybody, I'm a beginner working with xml, and I have a little problem extracting the data. I have an estructure like this <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE imentenoticias SYSTEM "http://imente.com/xml/dtd/imentenoticias.dtd"> <imentenoticias> <article id="1000279706996255072"> <url>http://www.imente.com/ver/not.cgi?1000279706996255072</url> <titular_texto>Cientificos Apoyan Celulas Madre Y Creen No Suficiente Plan Bush</titular_texto> <fuente>NAVEGALIA.COM Noticias - Sociedad</fuente> <media>text</media> <url_fuente>http://www.navegalia.com/Channels/Noticias/Secciones/layout_Secc ion/0,18600,sociedad,00.html</url_fuente> <fecha_captura>Mie 12 Set 2001 09:28</fecha_captura> <indexacion></indexacion> </article> </imentenoticias> and i want to select everything including the id. I could select everything but how can i take the id? i have tried $xml = new XML("exemple.xml"); // Select all members of the government. $imentenoticias = $xml->evaluate("//@id"); // Run through all members of the government. foreach ( $imentenoticias as $noticia ) { // Retrieve information about the person. $id = $xml->get_content("//@id[1]"); $id2 = $xml->get_content($noticia."/id[1]"); } and I obtain empty values. thank you best regards Fernando Caamaño -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |