[phpXML] Re: Beginners question
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. on b. of <fca...@la...> - 2001-10-10 22:09:34
|
tahnk you, it runs!!! :))) ----- Original Message ----- From: "Luc Saint-Elie" <lu...@sa...> To: <us...@li...>; <fca...@la...> Sent: Thursday, September 13, 2001 12:44 PM Subject: Re: Beginners question > Hello, > > attributes are in an array() > > try : > $t = array(); > > $list_imentenoticias = $xml->evaluate('/imentenoticias'); > > foreach ( $list_imentenoticias as $imentenoticia ) > { > $t = $xml->get_attributes($imentenoticia); > $id =$t['id'] > > $url = $xml->get_content($imentenoticia ."/url[1]"); > $titular_texto = $xml->get_content($imentenoticia ."/titular_texto[1]"); > $media = $xml->get_content($imentenoticia ."/media[1]"); > $url_fuente = $xml->get_content($imentenoticia ."/url_fuente[1]"); > > and so on.... > > } > > Luc > > > En réponse à fca...@la...: > > > 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.../ > > > -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |