Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Most of these types were described fully in Chapter 5, but two are worth a special mention.
Note that the
QName
must be the name of an atomic type, not merely a simple type. Simple types, in the XML schema classification, also include list types and union types. Atomic values contained in an XPath sequence always belong to an atomic type, not a list or union type, and a sequence type descriptor is therefore constrained to use atomic types. This rules out types such as
xs:NMTOKENS
,
xs:IDREFS
, and
xs:ENTITIES
, which are list types, as well as
xs:anyType
, which is a complex type.
Matching Nodes
All other sorts of
ItemType
are used to match nodes. These all come under the umbrella of the
KindTest
construct.
I'll dispose of the simple kinds of node first, and then move on to elements and attributes, which is where the real complexity comes.
Expression | Syntax |
KindTest | AnyKindTest | DocumentTest | ElementTest | AttributeTest | CommentTest | TextTest | PITest |
AnyKindTest | node ( ) |
DocumentTest | document-node ( ElementTest? ) |
CommentTest | comment ( ) |