Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 855 Bytes

XPathReview.md

File metadata and controls

39 lines (26 loc) · 855 Bytes

Top things we need to do with XPath

Consult resources:

XPath steps

  • Axes:
    • child::
    • attribute:: @
    • descendant:: // and .// in a predicate
    • self:: .
    • parent:: ..
    • ancestor::
    • preceding-sibling::
    • following-sibling::
    • preceding::
    • following::

Main Kinds of XML nodes to reach

  • Element
  • Attribute
  • Document node(s)
  • Comment (yes, you can XPath to your <!-- XML comments -->
  • Processing-instruction (like your Relax NG schema line)

Writing predicate filters

  • //node()[@type="something" ]
  • //element[descendant::something/@type]