The attribute axis selects an attribute node contained by the
context node.
For example, the XPointer
/descendant::SPOUSE/attribute::IDREF
IDREF
attributes of all SPOUSE elements in the document. The attribute
axis can be abbreviated by an @ sign.
//SPOUSE/@IDREF
IDREF attributes of all
SPOUSE elements in the document. @* is a general
abbreviation for an attribute with any name. Thus
//SPOUSE/@*
SPOUSE elements.For another example, to find all PERSON elements in the document
http://www.theharolds.com/genealogy.xml whose FATHER
attribute is Jean Francois Bellau (ID p2), you could write
//PERSON[@FATHER="p2"].