https://www.w3.org/TR/xpath-31/
- EQName - but not in all cases handling namespaces properly yet
-
XPath 1.0 compatibility mode. No implementation plans
-
Statically known namespaces
-
Default element/type namespace
-
Default function namespace
-
In-scope schema definitions. No schema support at all yet
-
In-scope variables
-
Context item static type. No static typing at all yet
-
Statically known function signatures. Only built-in functions
-
Statically known collations
-
Default collation
-
Statically known documents.
-
Statically known collections.
-
Statically known default collection type
-
Statically known decimal formats
-
Context item
-
Context position
-
Context size
-
Variable values
-
Named functions. Not sure how this is dynamic?
-
Current dateTime
-
Implicit timezone
-
Default language
-
Default calendar
-
Default place
-
Available documents
-
Available text resources
-
Available collections
-
Default collection
-
Available URI collections
-
Default URI collection
-
Environment variables
- Type annotation in XDM. No schema support yet, everything untypedAtomic
-
Static error if name is unknown.
-
Normalization of operation tree to make atomization and effective boolean value extraction explicit. We don't do it this way, but we do extract this information. We may consider making this explicit in the IR if it helps with static analysis.
-
Static typing feature. No static typing yet. Would be nice, but not required for conformance. Saxon doesn't have it and it would introduce compatibility problems if implemented.
- Raise type error if operand has dynamic type that is incorrect.
-
Static errors
-
Dynamic errors
- Unique error codes
-
Dynamic errors are raised
-
error function. Not complete yet
No optimization yet
- Nodes have document order
-
Atomic value is returned
-
Typed value of node is returned Only untypedAtomic without schema support
-
Function raises error May be wrong error code
-
If item is array, atomize each item
Atomization is applied to:
-
Arithmetic expressions
-
Comparison expressions
-
Inline function call arguments
-
Inline function call returns
-
Built-in function calls
-
Cast expressions
-
Empty sequence returns false
-
Sequence with first item node, true
-
Singleton of type
xs:booleanreturns boolean -
Singleton derived from
xs:booleanreturns boolean -
Singleton of type
xs:string,xs:untypedAtomicreturns true if length > 0 -
Singleton of
xs:anyURIis true if length > 0 -
Singleton of numeric type, returns true if not zero
-
Singleton of numeric type returns true if not NaN
-
Type error in other cases
Used in:
-
Logical expressions
-
fn:not -
In certain predicates such as
a[b] -
Conditional expressions
if -
Quantified expressions
-
XPath 1.0 mode for general comparisons
-
Input sources support via variety of functions
-
Input via variable or context item
-
Verification of valid URI in BracedURILiteral
-
Whitespace normalization of URI literal
- Resolving a relative URI reference
-
Schema types
-
Generalized atomic type
-
pure union type
-
xs:untyped -
xs:untypedAtomicBut not yet in inline function definitions -
xs:dayTimeDuration
-
xs:yearMonthDuration
-
xs:anyAtomicTypeBut not yet in inline function definitions -
xs:error
-
xs:QName -
xs:NOTATION
-
Untyped nodes are xs:untypedAtomic
-
Typed value for node besides xs:untypedAtomic
-
String value for node
-
Detailed rules of getting typed value for nodes as described here
- Parsing sequence types
derives-from pseudo function
-
error if ET not present in in scope-schema definitions
-
AT is ET
-
ET is base type of AT
-
ET is a pure union type of which AT is a member type
-
Recursion via intermediate type MT
-
no postfix, xs:int
-
optional postfix, xs:int?
-
0 or more items postfix, xs:int*
-
1 or more items postfix, xs:int+
-
Matching with EQName
-
item() -
node() -
text() -
processing-instruction() -
processing-instruction(N) -
comment() -
namespace-node() -
document-node() -
item type that is a test
-
map(K, V) -
map(*) -
array(T) -
array(*)
-
Use in type system
-
Use in NodeTest
-
element()andelement(*) -
element(ElementName) -
element(ElementName, TypeName) -
element(ElementName, TypeName?) -
element(*, TypeName) -
element(*, TypeName?)
- Schema element test
-
attribute()andattribute(*) -
attribute(AttributeName) -
attribute(AttributeName, TypeName) -
attribute(*, TypeName)
- Schema attribute test
-
function(*) -
function()with argument types and return value
- Map test But details for instance of still to be done
- Array test
- The judgement
subtype(A, B)
Note: detailed rules of 36 items, may spell it out when implementing.
- The judgement
subtype-itemtype(Ai, Bi)
-
xs:errortype
- Comments are parsed and ignored
-
Integer literals
-
Decimal literals
-
Double literals
-
String literals
-
Variable references
-
Variable scoping
- Parenthesized expressions
- Context item expression
.
-
Static function calls
-
Static function call argument type checking
-
Partial function application
-
Static function lookup
-
Dynamic function lookup
-
Application of function conversion rules for inline function arguments
-
Application of function conversion rules for built-in functions. In as much as implemented
-
Partial function application
-
map function
-
inline function evaluation
-
inline function evaluation conversion rules for return value
-
non-local variable bindings for inline functions
-
argument values for built-in functions
-
non-local variable bindings for built-in functions
-
static and dynamic context for built-in functions
-
XPath 1.0 compatibility mode
-
Atomization for built-in functions
-
untypedAtomiccast to expected function. Casting still limited -
numeric item type promotion
-
anyURItype promotion -
TypedFunctionTestcauses function coercion -
Type error if coercion fails
- Function coercion
- Named function references
-
Inline function expressions
-
Non-local variable bindings
-
Type signature support
-
Function coercion
- Enclosed expressions
-
Filter expressions
-
Predicate if numeric is compared to context position
-
Predicate as boolean value otherwise
- Dynamic function calls
-
/at beginning -
//at beginning -
treat asin/and//(but only needed for static typing)
- Relative path expressions
- Path operator
/
-
child -
descendant -
parent -
ancestor -
following-sibling -
preceding-sibling -
following -
preceding -
attribute -
self -
descendant-or-self -
ancestor-or-self -
namespaceBut not required for conformance
-
Name test
-
Wildcard name test
-
Kind test (see 2.5.4 and 2.5.5)
- Predicates within steps
- Unabbreviated syntax
- Abbreviated syntax
-
sequence constructions
-
range expressions
-
Union
-
Intersection
-
+ -
- -
* -
div -
idiv -
mod -
unary
+ -
unary
- -
XPath 1.0 compatibility mode operand evaluation
-
Atomization during operand evaluation
- String concatenation
||
-
Atomization
-
Empty sequence means empty sequence result
-
Atomization length > 1 means type error
-
untypedAtomiccast to string -
Values are of different types:
xs:string/xs:anyURI -
Values are of different types:
xs:decimal/xs:float -
Values are of different types
xs:decimal,xs:float,xs:double
-
XPath 1.0 compatibility mode
-
Atomization for each operand
-
Both
untypedAtomicare cast toxs:string -
untypedAtomiccast toxs:double -
untypedAtomiccast toxs:daytimeDuration -
untypedAtomiccast toxs:yearMonthDuration -
untypedAtomiccast from primitive base type
-
isoperator -
<<operator -
>>operator
-
or -
and -
XPath 1.0 compatibility mode
- For expressions
- Let expressions
- Map constructors
- Map lookup using function call syntax
- Array constructors
- Array lookup using function call syntax
- Unary Lookup
- Postfix Lookup
- Conditional expressions
-
some -
every
-
instance of
-
cast as
-
castable as
- Constructor functions
-
treat asno effect without stating typing, maybe should do instance of
- Simple map operator
- Arrow operator
- Grammar (a few details remain)
-
Leading-lone-slash
-
xml-version
-
reserved-function-names
-
occurrence-indicators
-
parens
-
comments
- Terminal symbols
-
distinguish delimiting terminal symbols from non-delimiting ones
-
comment and whitespace symbol separators
-
symbol separator between two non-delimiting terminal symbols
-
symbol separator after NCName and "." and "-"
-
symbol separator between numeric literal and "." and vice versa
TDB
- whitespace rules
- explicit whitespace handling inside various literals
- reserved function names
- Implemented grammar so should follow precedence order
-
Numeric type promotion for operators
-
Numeric type promotion for function calls
-
URI type promotion for operators
-
URI type promotion for function calls
-
subtype substitution, see 2.5.5.1
-
Operator mapping for numeric arithmetic
-
Operator mapping for date time arithmetic
-
Complete handling of all operator mapping in big table
See static context components in 2.1.1
See dynamic context components in 2.1.2