Guide Section: Processing Object Data | EASAP Tree: DATA PROCESSING → LIST
XPath is an industry-standard xml query language with many references and tutorials available on the internet.
XPATH supports XPath version 1.0.
![]() |
|
---|---|
Essential Parameters: | |
Query: | The XPath query to run, which may contain object references |
Optional Parameters: | |
Value: | This should be used if the xml to parse is in a SCALAR reference. |
File: | This should be used if the xml to parse is in a file. |
Show Complete Results: | If the query matches a node, this allows child nodes to be returned also. (default→TRUE). |
Show Attribute Values: | When matching an attribute the query can return: Name, Value or both. (default→Value). |
Use Namespaces: | For large xml files that do not use namespaces, setting this to FALSE can improve performance. |
Default Namespace Prefix: | If the xml file contains entries such as xmlns=”…, rather than xmlns:mynamespace=”…, then this parameter allows a default namespace to be specified and that namespace may be used within Xpath queries. |
Encoding: | This is used in conjunction with File: to specify the file type. The default type is 'UTF-8' |
Delimiter: | Character to delimit the SCALAR reference in Value:(default→%). |
Our example follows the example at the external page:
Download http://help.myeasa.com/resource/bookstore.xml shown below.
<?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title lang="en">Harry Potter</title> <price>29.99</price> </book> <book> <title lang="en">Learning XML</title> <price>39.95</price> </book> </bookstore>
File: → bookstore.xml example above | Output Values |
---|---|
Query:/bookstore/book[1]/title/child::text() | Harry Potter |
Query:/bookstore/book[1] | <book> <title> Harry Potter</title><price> 29.99</price></book> |
Query:/bookstore/book[1]/title/@lang | en |
Query:/bookstore/book[1]/title Show Complete Results: NO | <title lang=“en”/> |
The Tree and EASAP output for these four Query: parameters: