Download Delve® SOA Fast-Prototyping Toolkit (Beta 1.0)
| Tutorials - How To Use XPath to Get Attributes Globally |
Page 1 of 1 |
In “How to Use XPath to Get Elements Globally,” we took a look at how the accessor operator can be used to gather XML element contents from throughout a structured document. In this lesson, we’ll explore how to do the same thing with attribute values.
First Page Main Text:
The global accessor can be used to obtain attribute values in much the same way it can be used to gather a set of value from like-named elements.
Let’s revisit the “parts” element instance used in a couple of earlier lessons.

Several different elements, at a couple different levels of the document, have “units” attributes. To obtain the values of all of them, we can use the following statement.

|
|
|