In xPath1.0, evaluation of expression will return one of the four basic results, one is node-set the others are atomic types
boolean, number,string
In xPath2.0, every value is a sequence. the value of every expression is a sequence of zero or more items.
Atomic value is just a special case of a sequence: it is a sequence of length one.
Nodes
- The document node (one per document) - /
- Element nodes
- Attribute nodes
- Text nodes
- Comment nodes
- Processing instruction nodes
- Namespace nodes
Element node
Attribute node
Node Test
Atomic values
xPath2.0 support all the basic datatypes in xml schema
xs:string - you can convert anything to a string by using string() function.
xs:boolean - you can use true() and false() function to evaluate the value
xs:decimal
xs:float and xs:double
xs:integer
xs:duration
xs:date - YYYY-MM-DD
xs:time- hh:mm:ss.sss
xs:dateTime
you can have a +|- sign to indicate time difference from UTC, like -05:00 after date or time
dateTime is the combination of xs:date and xs:time, separated by a single character T 1995-04-21T17:38:22.183-05:00
XML Schema defines the datatypes xs:gYearMonth, xs:gYear, xs:gMonthDay, gDay, and gMonth.
Examples of these values, in order, are 1995-04 for April, 1995; 1995 for the year 1995; --04-21 for the 21st day of April; ---21 for the 21st day of a month; and --04 for April.
more datatypes:
xs:hexBinary and xs:base64Binary
xs:anyURI
xs:QName
xs:anyType and xs:anySimpleType
xs:yearMonthDuration and xs:dayTimeDuration
xs:untyped and xs:untypedAtomic
xs:anyAtomicType