Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
| Tutorials - How To Use XPath to Set and Get Element Values |
Page 1 of 3 |
If an element’s content consists entirely of text, we can think of the text as the element’s “value.” You can use XPath-style syntax to both obtain and assign element values.
XPath use tokens divided by the forward slash ‘/’ character to identify nodes is a document. In Tectonic, this is known as the “accessor” operator, and it’s used in much the same way. Let’s say we have an element “distance” used to represent the distance between two points. An instance of such an element might look like this

We can extract the value of “length” using the statement…

Once the value is extracted, the “write” statement is used to display it. |
|
|