AW: A little bit confused
Brought to you by:
bs_php,
nigelswinson
From: J. C. <jan...@im...> - 2002-01-17 16:40:02
|
I am also fighting with the develop version the whole day now. getData goes to wholeText() goes to substringData() goes to _setContent() Still confused? Something with $replace=TRUE does fix it ... I did some changes (too long to explaine), just try this file (but backup your old one!). Did ever someone try to do getData() of <node>0</node> ????? It does not work :( and I can't solve it ... I should go home maybe and watch TV ... > -----Ursprüngliche Nachricht----- > Von: php...@li... > [mailto:php...@li...]Im Auftrag von Luc > Saint-Elie > Gesendet: Donnerstag, 17. Januar 2002 17:09 > An: php...@li... > Betreff: A little bit confused > > > Hello (again..)) > > I've been away from xpath.class.php for some time and I'm trying without > succes very simple things with the last dev version > > I use > /Xpath-develop/XPath.class.php (from the cvs) > > > here is my xml file : > ------------------------------------------------------------------ > -------------- > <?xml version="1.0" encoding="iso-8859-1"?> > <liste> > <message> > <is_read>no</is_read> > <texte>qfdmqkjsdmlfkqkdf</texte> > <expediteur>userone</expediteur> > <destinataire>usertwo</destinataire> > <date>1011277311</date> > </message> > <message> > <is_read>no</is_read> > <texte>bon salut ma poule</texte> > <expediteur>usertwo</expediteur> > <destinataire>userone</destinataire> > <date>1011278602</date> > </message> > <message> > <is_read>no</is_read> > <texte>kgluylutglkèutky(kdyrkglu-iuykuyd(uè</texte> > <expediteur>userone</expediteur> > <destinataire>usertwo</destinataire> > <date>1011279657</date> > </message> > </liste> > ------------------------------------------------------------------ > ------------------ > > here is a dam simple bit of code : > > ------------------------------------------------------------------ > --------------------- > require_once 'lib/XPath.class.php'; > $xPath = new XPath(); > $xPath->importFromFile('xml_files/messages.xml'); > $msglist = $xPath->evaluate('/liste/message'); > print_r($msglist); > echo '<br>'; > foreach ( $msglist as $msg ) { > echo $msg.'<br>'; > $is_read = $xPath->getData($msg.'/is_read[1]'); > echo $is_read.'<br>'; > $texte = $xPath->getData($msg.'/texte[1]'); > echo $texte.'<br>'; > $expediteur = $xPath->getData($msg.'/expediteur[1]'); > echo $expediteur.'<br>'; > } > echo $xPath->exportAsHtml(); > ------------------------------------------------------------------ > ----------------------- > > Dump of the evaluate() is ok : > > $msglist Array > ( > [0] => /liste[1]/message[1] > [1] => /liste[1]/message[2] > [2] => /liste[1]/message[3] > ) > > Dump of exportAsHtml() is OK > > But all getData() variables are empty... > > Any direction ? > > Luc > > > _______________________________________________ > Phpxpath-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpxpath-users |