Navigating the Tree

Julia Flanders and Syd Bauman


This slide set builds on the previous XSLT tutorials by discussing XPath, which is a way of navigating an XML tree. It is particularly important for XSLT and publication because it allows the selection of specific elements depending on their context. So, for example, perhaps you want to render “quote” differently when it comes up in “epigraph” than when it occurs in “p.” XPath allows you to specify context for a given element, which makes transformations more nuanced.

  1. Identifying the element to match: simple identification
  2. Identifying the element to match: multiples
  3. Identifying the element to match: context
  4. Some other useful patterns: attribute values, order of siblings
  5. How to suppress parts of the input tree
  6. More complex navigation: the context node
  7. Navigating from the root of the tree
  8. Parents, ancestors, descendants, and children
  9. Following and preceding siblings
  10. Following and preceding nodes
  11. Axes
Navigating the Tree