XPath predicates

  • Also known as filter expressions. They are optional and used to refine the set of addressed nodes. 

    A predicate may include one or more XPaths (and thus also predicates)

    e.g.   
    1. All books from the year 1992
    //book[@year="1992"]

    2. All book element nodes without title
    //book[not (@title)] 

    3. The first author element node in the XML document
    //author[1]  = //author[position() = 1]
    //book[lang("en")]

    Report Place comment