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 à [EMAIL PROTECTED]:

> 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:[EMAIL PROTECTED]/

_______________________________________________
Phpxmldb-phpxml-arc mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/phpxmldb-phpxml-arc

Reply via email to