… preceding (preceding:: and preceding-sibling::)

Classic tree diagram of generic XML document, elements only, with
                /*[1]/*[2]/*[2]/*[3] highlighted, its preceding siblings marked in red, and all its
                preceding elements (including the preceding siblings) surrounded with a red
                circle.

Preceding:: and preceding-sibling:: are a bit more complex, but are pretty self-explanatory once you think about them in the context of the document structure. In this diagram, the preceding:: nodes are circled, and the more specific preceding-sibling:: nodes are given a red border. The preceding-siblings are nodes that share the same parent node, and come before the current node in the document. The preceding:: node is any node that comes before the element in the document. So, if the current node were a persName in the 3rd paragraph of the second division of a text, the preceding nodes would be:

  • the first division and all of its descendants
  • the first two paragraphs of the second division
  • any complete elements that come before the persName in the third paragraph. If the persName element occurs inside of quote, the quote would not be considered preceding, even though its start tag occurs before persName Instead, it would be considered a parent or ancestor (depending on context).
XPath and Schematron for TEI Customization, slide 11 of 24