I did some modifications to the phpxml librarie v1.0, as I have
discovered a minor bug and missing some feature I needed.

For more details see http://www.kzar.net/testxml.php

First, now you can do a XPath expression like this one:

//document/keyword[contains(text(),'some text')]/parents::*

Formerly, this expression did an error as the lib guess that it was a
XPtah function like "contains(text()" because of fails inclusive
parenthesis detection (sorry for my poor english...)

I also added a new method: count_nodes($path) that returns numbers of
elements within the path.
e.g. you can do:

$nodes = $xml->count_nodes("/document[$j]/keyword");
for($i=1; $i<=nodes; $i++)
        echo "Keyword =

This way you don't evaluate a path like that :

$test = $xml->evaluate("//document[$j]/keyword);
foreach($test as $node)
        echo "Keyword = ".$xml->get_content($test)."<br>";

This is usefull and time execution saving as you don't have to evaluate
again a path.

Any comments and suggestions are welcome.

I have a question: is phplib found on the www.phpxml.org site is


Florent Gilles
This message has been sent through the <phpXML/> user discussion list. To unsubscribe, 
please visit https:[EMAIL PROTECTED]/

Reply via email to