# XQuery 1.0 Changes

The prolog declaration `declare xmlspace` is changed to `declare boundary-space`.

The syntax for the `inherit-namespaces` prolog declaration has been changed to align with the February 2005 specification. However, the `no-preserve` option is not yet implemented.

The `import schema` declaration now allows a list of schema locations to be specified. The processor attempts to read them all, and to combine the contents of the various schema documents found; if one of the locations cannot be read, this is treated as a warning, but if any location contains an invalid schema, or if there are conflicts across the schema documents, this is an error.

The old syntax for `declare variable` (using curly braces rather than `:=`) is no longer recognized.

Saxon supports the new syntax for option declarations in the query prolog: `declare option QName "string-literal";`. The declaration is ignored unless the namespace of the QName is the Saxon namespace `http://saxon.sf.net/".`

Serialization parameters can be set using the option declaration `declare option saxon:output "keyword = value"`, for example `declare option saxon:output "method=html"`. All serialization parameters defined in the serialization specification are available (with the exception of `normalize-unicode`), as well as additional Saxon serialization parameters, for example `saxon:indent-spaces = 2`.

Default values for external variables can be set using the option declaration `declare option saxon:default "expression"`. This default applies to all following external variable declarations until the next `saxon:default` declaration. The value is an XPath expression: if the default value is a string literal, then two sets of quotation marks are needed. Since this expression is written within quotes, any use of the delimiting quotes within the expression must be doubled. For example: `declare option saxon:default "'Did you say ""boo""?'";` sets the default value to the string `Did you say "boo"?`.

Support for the old syntax for pragmas and must-understand extensions written in the form `(:: pragma ::)` has been dropped. This means that any pragmas in existing queries will now be treated as comments and ignored.

Saxon now permits the new syntax for extension expressions `(# QName pragma #){ expr }`. At present Saxon does not define or recognize any specific extensions, so the pragma is always ignored (in fact, the QName is not even validated.)

If the function name in a function declaration is unprefixed, it is now taken to be in the default namespace for functions. This is an error if the default namespace for functions has not been changed, that is, if it is the system namespace `http://www.w3.org/2005/02/xpath-functions`.

When query results are output in wrapped format (the -wrap option on the command line), the way atomic values are presented has changed. The `type` attribute is renamed `xsi:type`, and its value is always a QName whose namespace prefix is properly declared. If the type is an anonymous type (which will happen when the value is obtained by taking the typed value of a node annotated with an anonymous type) then the anonymous type name allocated by Saxon is exposed - if this happens then the wrapped result file will not actually validate against any schema, because the schema processor will not recognize these QNames as valid names of types.

Expand | Up Next