|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
|---|---|
| Driver | Represents a driver for querying XML files with XPath expressions. |
| XPathConnection | Represents a connection to an XML file. |
| XPathQueryExecutor | Executor for XPath queries. |
| Exception Summary | |
|---|---|
| XPathProviderException | Thrown to indicate a problem with XML file querying. |
| Driver class: | scriptella.driver.xpath.Driver |
| URL: | XML file URL. URIs are resolved relative to a script file directory. |
| Runtime dependencies: | None |
| Name | Description | Required |
|---|---|---|
| trim | Value of true specifies that the leading and trailing
whitespaces in text file lines should be omitted..
| No, the default value is true. |
The query is executed on a XML Document and produces a rowset for matched nodes. The attribute and element values can be referenced from nested scripts/queries. The following example illustrates querying mechanism:
Example:
XPath: /A selects root element <A>
<A B="1">
<B>2</B>
<C>3</C>
</A>
Available variables for matched element <A>:
| Name | Value |
|---|---|
| A | 2 3 |
| B | 1 |
| C | 3 |
Additional notes:
<connection id="in" driver="xpath" url="data.xml"/>
<connection id="out" driver="text" url="report.csv"/>
<query connection-id="in">
/HTML/BODY/TABLE/TR
<script connection-id="out">
$rownum;${td[0]};${td[1]}
</script>
</query>
Extracts rows from tables in data.xml file and produces report.csv.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||