Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php xpath

Status
Not open for further replies.

stasJohn

Programmer
May 6, 2004
155
US
Hopefully someone can answer this.

I'm using the class, class XML, written by Michael P. Mehl, back in 2001.


xml
Code:
...
<item>
  <name>Grapes and Water</name>
  ...
</item>
...

xpath query
Code:
//item/[name/.='Grapes and Water']

When I execute the query, nothing is actually returned. I've done a ton of testing setting the "name" element to other values (such as "grapes","grapes water","grapes like water") and updating the query to correspond and they all worked fine.

I did some tracing and found that the class breaks apart the string (well I think it does) and then when the parser encounters the word "and", it actually see's it as the and operator, so a boolean operation is performed.

I'm trying to figure out if this is a bug in the class or within php itself. If it is the class, are there any good php classes out there??

thanks in advance.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top