Use XPath to enhance your XSL transformations.
XPath defines a syntax for selecting parts of an XML document. It consists of syntax to select direct elements and their attributes, as well as a set of standard functions. XPath was released as a W3C recommendation in 1999 and is such a major element of XSL that without it, you will not be able to make XSL documents. This hack serves to dirty your hands with basic XPath syntax.
XPath syntax is a superset of the standard patterns that are used
to apply templates to XML elements using the
match attribute of the
xsl:template element. Patterns allow you to
say which nodes you do and do not wish to match for a transformation.
Basic patterns allow you to match nodes by element name, child elements,
descendants, and attributes. The XPath superset allows matching on much
more powerful expressions. These expressions can be used in any XSL
element that allows a
attribute. Currently, that means these tags:
In addition to being able to select a list of element nodes, XPath is able to produce Booleans, numbers, and strings.
The power of XPath lies in its ability to match on all the basic match pattern tests, as well as on ancestor, parent, sibling, preceding, and following nodes. Without the XPath capabilities of XSL, performing anything other than simple operations on XML would be impossible.