• Functions
  • for a complete list, see functions
  • variable examples
  • Predicates
    • Functions in the [] square brackets
    • = (EQUALS)
      • element=
        • child::chapter[child::chapterAuthor="Andrew Watt"] (This one is looking for an element named "chapterAuthor", not an attribute)
          • Working example for IE6
            • root6.htm the xsl document for IE6
      • attribute=
        • child::chapter[attribute::title="XPATH"]
          • Working example for IE6
            • root6.htm the xsl document for IE6
      • =first()
      • =last()
    • !- (NOT EQUAL)
      • not equal to
    • and
      • element
        • child::*[self::chapter and self::appendix](This will choose the <chapter> and <appendix> element children of our context node, whichever shows up first
          • Working example for IE6
            • root6.htm the xsl document for IE6
      • attribute
        • chapter[@number and @title] (selects only <chapter> children of the context node that have both a number attribute and a title attribute)
          • Working example for IE6
            • root6.htm the xsl document for IE6
    • or (OR | )
      • child::*[self::chapter or self::appendix][position()=last()] (This will choose either the <chapter> or <appendix> element children of our context node, whichever shows up first
        • Working example for IE6
          • root6.htm the xsl document for IE6
    • position() is the default function
      • Unabbreviated functions (just the number listed):
        • child::paragraph[position()=1]
        • child::paragraph[position()=last()>1]
        • child::chapter[position()=3][attribute::number] (choose the third <chapter> element that is a child of our context node. If it has an attribute named number, we will use it).
          • Working example for IE6
            • root6.htm the xsl document for IE6
      • Abbreviated functions (just the number listed):
        • paragraph[1] (gets the first <paragraph> child element of the context node)
        • /book/chapters/chapter[2][@security='confidential'] (selects the fourth <paragraph> child of the context node if it has a security attribute equal to "confidential"
          • Working example for IE6
            • root6.htm the xsl document for IE6
        • /book/chapters/chapter/section[1]/paragraph[3] (selects the third child <paragraph> element of the first <section> element node that is a child of the <chapter> element)
          • Working example for IE6
            • root6.htm the xsl document for IE6
  • NodeTests
    • position()
      • default nodetest
      • //paragraph[1] (selects all descendant <paragraph> elements that are the first <paragraph> children of their parents)
    • *
      • * (selects all element nodes that are children of the context node)
      • */paragraph (gets all grandchildren <paragraph> element nodes of the context node) (equivalent to child::*/child::paragraph)
    • node()
      • /child::node() also gets the comment node
    • text()
      • text() (selects the text node of the context node)
    • count()
      • Source for XML
      • Working example for IE6
      • root6.htm the xsl document for IE6
    • name()
      • returns name of the node, if applied to a node-set, node parameter can identify the node reequired. If more than one matches, you need a loop
    • substring-after (.,' ')
      • returns the next word after the first space
        • Source for XML
        • Working example for IE6
        • root6.htm the xsl document for IE6