[phpXML] problem with the class
Brought to you by:
bs_php,
nigelswinson
From: <ob...@eu...> - 2001-10-08 15:10:34
|
Hello, I have a problem with the class: the order of the elements are not respected. Maybe someone has already encounter this problem and has a fix. See example below. In a tag "Datacontent", there are five tags, 2 named "media" and 3 named "p", the two "media" tags are placed before the others tags when evaluated, but in the source, they are places between the others. Rem: the "DataContent" tag is at the 7th level of the document, it has been simplified for the example. Could you please tell me if it is a normal behaviour of the class? This doesn't happend in other cases. XML Source: ----------- .... <DataContent> <media media-type="image" style="leftSide"><media-reference mime-type="" data-location="#photo0" /></media> <p>Les demi-finales des Internationaux de France de tennis proposent vendredi d'un...</p> <p>Cédric Pioline fut en 1998 le dernier Français demi-finaliste..</p> <media media-type="image" style="rightSide"><media-reference mime-type="" data-location="#photo1" /></media> <p>Grosjean sera beaucoup plus frais...</p> </DataContent> PHP Code: --------- ... $newstext_eval = $xml->evaluate("/DataContent/*"); foreach ($newstext_eval as $partoftext) { echo $partoftext . "\n"; } Result: ------- ... DataContent[1]/media[1] DataContent[1]/media[2] DataContent[1]/p[1] DataContent[1]/p[2] DataContent[1]/p[3] What I expect is: ----------------- ... DataContent[1]/media[1] DataContent[1]/p[1] DataContent[1]/p[2] DataContent[1]/media[2] DataContent[1]/p[3] Thanks __ Olivier -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |