The W3C XQuery and XSLT Working Groups have updated five working drafts:
Changes in XPath 2.0 include:
xdt:untypedAny
has been renamed
xdt:untyped
.
Value comparisons now return ()
if either operand is ()
.
The precedence of the cast
and treat
operators in the grammar has been increased.
The precedence of unary arithmetic operators has been increased.
A new component has been added to the static context: context item static type.
The specification now clearly distinguishes between "statically-known namespaces" (a static property of an expression) and "in-scope namespaces" (a dynamic property of an element).
XPath allows host languages to specify whether they recognize the concept of a namespace node. XQuery does not recognize namespace nodes. Instead, it recognizes an "in-scope namespaces" property of an element node.
Changes in XQuery include:
An ordering
declaration has been added to the Prolog, which affects the ordering semantics of path expressions, FLWOR expressions, and union
, intersect
, and except
expressions. In addition, ordered
and unordered
operators have been introduced that permit ordering semantics to be controlled at the expression level within a query.
Validation has been separated from construction. Validation now occurs only as a result of an explicit validate
expression. Validation modes are strict
and lax
, and are specified on the validate
expression. New construction modes strip
and preserve
have been defined and are declared in the Prolog. The notion of
"validation context" has been deleted. The XQuery definition of
validation has been converged with the definition used in XSLT.
User defined function overloading: that is, multiple user-defined functions can have the same name as long as they have different numbers of arguments.
Computed namespace constructors are now completely static and are allowed only inside a computed element constructor. Namespace declarations in a computed element constructor must come before the element content, and must consist entirely of literals. The namespace prefix is optional. If absent, it has the effect of setting the default namespace for elements and types within the scope of the constructed element.
The precedence of the cast
and treat
operators has increased.
The precedence of unary arithmetic operators has increased.
Variable initialization in the Prolog now uses an assignment operator (":=
"). Also, circularities in variable initialization are now considered to be a static errors.
Module imports and schema imports now accept multiple location hints, representing multiple physical resources in the same module or schema.
CData Sections are no longer considered to be constructors, but are simply a notational convenience for embedding special characters in the content of an element or attribute constructor.
Three new components have been added to the static context: XQuery Flagger status, XQuery Static Flagger status, and context item static type.
An order by
clause may now accept values of mixed type
if they have a common type that is reachable by numeric promotion
and/or moving up the type derivation hierarchy, and if this common type
has a gt
operator.
In element and document node constructors, if the content sequence contains a document node, that node is replaced by its children (this was previously treated as an error).
It is now implementation-defined whether undeclaration of namespace prefixes in an element constructor is supported. If supported, this feature conforms to the semantics of Namespaces 1.1. In other words, if an element constructor binds a namespace prefix to the zero-length string, any binding of that prefix defined at an outer level is suspended within the scope of the constructed element.