XPath query with PHP

Try this:

//lemonade[@id="1"]/price

or

//lemonade[@supplier="mother"]/price

Without the “@” it looks for child elements with that name instead of attributes.

Leave a Comment