[phpXML] Re: Could you help a newbie ? ;o)
Brought to you by:
bs_php,
nigelswinson
From: <lu...@sa...> - 2001-10-08 15:05:32
|
Petra, Try, $CONTENT_list = $xml->evaluate('/CONTENT'); foreach ( $CONTENT_list as $CONTENT ) { $DATE = $xml->get_content($CONTENT.'/DATE[1]'); $CONTENTTYPE = $xml->get_content($CONTENT.'/CONTENTTYPE[1]'); $HEADLINE = $xml->get_content($CONTENT.'/NEW[1]/HEADLINE[1]'); $NEWSBODY = $xml->get_content($CONTENT.'/NEW[1]/NEWSBODY[1]'); echo $HEADLINE.'<p>'.$NEWSBODY.'<hr size="1" noshade>'; } En réponse à pe...@zu...: > Hi ! > > I've testet the XML parser first time today - and it works great. > > I've only one problem: > > XML-Example: > > <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?> > <CONTENT> > <DATE value="1">2001-09-06 14:45:12</DATE> > <CONTENTTYPE>plain/text - news</CONTENTTYPE> > <NEW> > <HEADLINE>Motorola bringt das Handy zum Aufziehen</HEADLINE> > <NEWSBODY>06.09.01 - Zum Thema regenerative ....</NEWSBODY> > </NEW> > </CONTENT> > > With the function evaluate I can retrieve the Information in the the > <NEW> tag, with > $CONTENT = $xml->evaluate("//NEW"); > foreach ( $CONTENT as $NEW ) { > $HEADLINE = $xml->get_content($NEW."/HEADLINE[1]"); > $NEWSBODY = $xml->get_content($NEW."/NEWSBODY[1]"); > echo $HEADLINE."<p>".$NEWSBODY."<hr size="1" noshade>"; > } > > > But how can retrieve the information in the DATE and CONTENTTYPE -Tag > ???? > > Thx for help ! > > Petra -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |