XQuery 1.0 implementation
The syntax for
declare option saxon:output "parameter=value" now allows the value to be zero-length.
The default serialization options have been changed to align with the defaults in Appendix C.3 of the W3C specification:
specifically, the default for
indent is now "no". The old default of "yes" can be achieved by setting the value
from the command line, from the Java API, from the Query prolog, or from the Saxon configuration file.
For the two serialization parameters
supplying "" (a zero-length string) as the value of the parameter is taken as setting the parameter to "absent". This is equivalent
to omitting the parameter. For example, this allows a value set
in the query prolog to be overridden from the API or from the command line (where the syntax is simply
doc-available() function, when it returns false, now ensures that the document remains unavailable
for the rest of the query: previously, if called repeatedly it would check repeatedly, and therefore could
return different results on different calls. Also, once
doc-available() has returned false, subsequent
doc() are now guaranteed to fail. A call on
that returns false does not prevent the document being created using
put(), but any such
document will not be available during the same query.
The new function
element-with-id(), introduced in the errata for Functions and Operators, is available.
It behaves the same as the
id() function, except in the case of ID-valued elements, where it returns the
parent of the element having the
is-ID property, rather than the element itself.
A query that does not use an
import schema declaration is now (by default) compiled with
schema-awareness disabled. This means that it will not be able to handle schema-typed input documents, or to
validate temporary trees created within the query, though it can still validate the final output tree. This
is for performance reasons: generating code to handle typed input data when it will not be encountered
adds to the execution cost. It is possible to override this setting from the s9api API on Java or from the Saxon.Api
on .NET, or from the configuration file. From the command line, schema-awareness is set automatically if the -sa option
or any other option implying schema-awareness is used (for example
-val:strict). With XQJ, schema-awareness is set automatically
if Saxon-EE is loaded.
The amount of compile-time checking when schema-awareness is used has been further increased. In particular, if the expected type of a constructed element is known, Saxon now attempts to check (a) that the sequence constructor delivering the content of the element is capable of delivering a sequence of elements that matches the content model (previously it only checked that each child element could legitimately belong to the content model), and (b) that the sequence constructor is capable of creating each mandatory attribute required by the complex type of the element.