SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
| Version 8.7 (2006-02-24)
| Version 8.6.1 (24 November 2005)
| Version 8.6 (3 November 2005)
| Version 8.5.1 (26 August 2005)
» | Version 8.5 (2 August 2005)
| Version 8.4 (4 April 2005)
| Version 8.3 (11 February 2005)
| Version 8.2 (21 December 2004)
| Version 8.1.1 (8 October 2004)
| Version 8.1 (24 September 2004)
| Version 8.0 (1 June 2004)
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
The XPath API
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# XQuery changes

The prolog option `declare copy-namespaces no-preserve` is now implemented.

The encoding specified in the query prolog is now recognized. Saxon first attempts to determine the encoding from any HTTP header (relevant only if the query is referenced via an HTTP URL). It then tries to read a byte-order-mark: if present this will identify the file as UTF-16 (big-endian or little-endian) or UTF-8. Failing this, it tries to read the encoding declaration. This works only if the actual encoding is a superset of ASCII. If no encoding declaration is present, UTF-8 is assumed. Note that Saxon previously defaulted to using the Java default encoding for the platform, typically ISO-8859-1 or Windows CP1252 (depending on the platform and the country). Queries that contain non-ASCII characters may therefore need to have an encoding declaration added.

Line endings in a query are now normalized to x0A, using the XML 1.1 rules, wherever they occur. Previously line endings were normalized only in node constructor content. The specification in this area has changed. Also, Saxon did not implement the previous specification as written: for example Saxon 8.4 normalized line endings in comments (which the specification did not require) while failing to normalize them in string literals (which the specification did require).

Whitespace characters such as tab and newline appearing in attribute content are now normalized to x20. For example, a newline in attribute content within a direct element constructor is treated as a single space. This occurs after the newline normalization mentioned above.

XQuery now uses the XML serialization method unless a different method is explicitly requested. Previously it followed XSLT by using the HTML serialization method if the first element output was an HTML element. Generally, the default serialization parameters now match those in Appendix C.2 of the XQuery specification, with one exception: when running from the command line, the default is `indent=yes` which produces indented output. This can be changed by use of the command-line option `!indent=no`.

When an xs:QName is supplied as the node name in a computed element constructor or computed attribute constructor, the prefix part of the xs:QName is now retained in the name of the generated node, where possible. This will always be possible for element nodes, but for attribute nodes, a different prefix will be generated in two situations: (a) if there is a conflict among the prefixes allocated to different attributes, or (b) if the attribute is in a namespace but the xs:QName value contains no prefix.

The construct `text{()}` now returns an empty sequence rather than a text node containing a zero-length string.

When a query is run from the command line, or using the `run()` method on the `XQueryExpression` object, the output is now piped into the serializer without materializing the result tree in memory. This was previously done only if the outermost level of the query expression was an element constructor. This change can result in a substantial reduction in the memory used to transform large documents, and also in the execution speed of such transformations.

Minor changes have been made to the way that namespace prefixes are allocated to constructed elements and attributes in cases where a prefix needs to be invented.

Next