Some more functions

  • contains() — does the 1st param contain the 2nd param? (or, does the param2 occur in param1)?
    • contains( /TEI/@xml:id, 'song')
    • The string to be searched for is within quotes after the comma.
    • Note: straight quotes, never curly!
    • Question: why single quotes instead of double?
  • substring-after()
    • substring-after( @who, '#')
    • Returns the part of param1 that is after param2
    • Useful if you want to find everything after a specific, consistent prefix
    • Thus id( substring-after( ancestor::sp/@who,'#') ) gets you the <role> element of whoever is speaking at the moment (i.e., where the cursor is in oXygen), except fails silently when @who points to more than one speaker, e.g., for
        <sp who="#Indy #Sallah">
          <p>They’re digging in the wrong place!</p>
        </sp>
      it returns nothing.
Schematron in ODD slide 21 of 39
© 2026 Syd Bauman and the Women Writers Project This TEI-encoded XML file is available under the terms of the Creative Commons Attribution-ShareAlike 3.0 (Unported) license.