Schema-aware XSLT and XQuery processing
Schema-awareness is now a property of a compiled query, stylesheet, or XPath expression. By default, these executables
are schema-aware if they contain an import schema declaration in the source code, or if a schema was imported
programmatically into the static context for the compilation. If the executable is not schema-aware, then all the data
supplied at run-time must be untyped. The reason for this is that there is a considerable performance penalty if it is not
known statically whether data will be typed or untyped; therefore, code that is not explicitly declared to be schema-aware
is now compiled to handle untyped data only. (This allows the type annotations xs:untyped
, xs:anyType
,
and xs:untypedAtomic
. Of these, xs:anyType
will appear only in nodes constructed from within a
query, and only when construction mode is "preserve".)
For XSLT a transformation can be set to be schema-aware, even if it does not import a schema, by setting the Configuration property XSLT_SCHEMA_AWARE to true. For XQuery, the same effect can be achieved by setting the Configuration property XQUERY_SCHEMA_AWARE.
The command-line interfaces Transform
and Query
will now load an enterprise configuration if they
can (that is, if Saxon-EE and a valid license file can be located). The -sa
option is now needed only to enable
schema-awareness in a transformation or query that does not import a schema. This might be needed, for example, if the
transformation or query uses untyped input but validates its output. The option is no longer needed to enable other
Saxon-EE features such as advanced optimization or streaming.