Try this:
//lemonade[@id="1"]/price
or
//lemonade[@supplier="mother"]/price
Without the “@” it looks for child elements with that name instead of attributes.
More Related Contents:
- SimpleXML: Selecting Elements Which Have A Certain Attribute Value
- Selecting a css class with xpath
- Implementing condition in XPath [duplicate]
- How can I set text value of SimpleXmlElement without using its parent?
- How do you parse and process HTML/XML in PHP?
- How to generate XML file dynamically using PHP?
- A simple program to CRUD node and node values of xml file [closed]
- Remove a child with a specific attribute, in SimpleXML for PHP
- PHP convert XML to JSON
- Forcing a SimpleXML Object to a string, regardless of context
- How to resolve cURL Error (7): couldn’t connect to host?
- How to parse SOAP XML?
- PHP namespace simplexml problems
- How do I capture PHP output into a variable?
- Remove empty tags from a XML with PHP
- Using SimpleXML to read RSS feed
- How to echo XML file in PHP
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- format xml string
- Send XML data to webservice using php curl
- Merge XML files in PHP
- Loop through an XML object with SimpleXML
- Simplify PHP DOM XML parsing – how?
- simplexml error handling php
- PHP SimpleXML Namespace Problem
- Regex / DOMDocument – match and replace text not in a link
- PHP Object as XML Document
- Remove & from string when writing to xml in PHP
- How to parse SOAP response without SoapClient
- How can I send SOAP XML via Curl and PHP?