SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
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
| Introduction
| XSLT 2.0 conformance
» | XPath 2.0 conformance
| XQuery 1.0 Conformance
| Conformance with XML Schema 1.0
| Serialization
| Conformance with other specifications
| Character Encodings Supported
| JAXP 1.3 Conformance

# XPath 2.0 conformance

This release of Saxon implements the full XPath 2.0 language as defined in the Candidate Recommendation of 3 November 2005.

There are some minor non-conformances in XPath 2.0 regular expression support, both caused by bugs or restrictions in the underlying platform:

- On the Java platform, there are some inconsistencies in the way the "i" flag is interpreted. Consider the Kelvin sign, x212A. This character should match the expression `[A-Z]`, because the lower-case variant of the Kelvin sign is "k", which is also the lower-case variant of a character in the range A-Z. Currently it does not match. This issue is awaiting resolution of a Java bug report raised by Saxonica: reference 568554.

- On the .NET platform, there are some inconsistencies in the way the "i" flag is interpreted. These are under investigation.

All the functions defined in the Functions and Operators specification are implemented. Information about the way they are implemented is provided in functions reference.

There is a non-conformance in the implementation of the `collection()` function: the results are not guaranteed to be stable. That is, when the same collection URI is used more than once, both the contents of the collection and the contents of the documents within the collection may be different on each occasion.

Implementation-defined aspects of Functions and Operators

The Functions and Operators specification includes a number of implementation-defined behaviors. This section describes how these are implemented in Saxon.

1. The destination of the trace for fn:trace() output is implementation-defined.

   By default trace output is sent to the standard error output. It can be redirected in various ways: by redirecting System.err, by supplying a user-written MessageEmitter, or by changing the output destination of the standard MessageEmitter to a defined output stream or writer.

2. For [overflow during] xs:integer operations, implementations that support limited-precision integer operations must either raise an error [err:FOAR0002] or provide an implementation-defined mechanism that allows users to choose between raising an error and returning a result that is modulo the largest representable integer value.

   Saxon supports unlimited-precision integer arithmetic, so this provision does not apply.

3. For xs:decimal values the number of digits of precision returned by the numeric operators is implementation-defined. If the number of digits in the result exceeds the number of digits that the implementation supports, the result is truncated or rounded in an implementation-defined manner.

   Saxon supports unlimited-precision decimal arithmetic. For addition, subtraction, and multiplication, no rounding or truncation occurs; the full precision of the result is maintained. For division, the number of digits in the result is: the number of digits in the numerator, the number of digits in the divisor, or 18, whichever is greatest. Rounding of values in the range .0 to .5 inclusive is towards zero, otherwise away from zero.

4. It is implementation-defined which version of Unicode is supported by the features defined in this specification, but it is recommended that the most recent version of Unicode be used.

   Some functions such as the implementations of `upper-case()` and `lower-case()` are delegated to the Java VM, and the result therefore depends on the Unicode version supported by the Java VM. In JDK 5.0 this is Unicode version 4.0.

   Other functions such as `normalize-unicode()` are implemented natively within Saxon. The character tables used for this are derived from the Unicode 4.0 database.

5. For normalize-unicode(), conforming implementations must support normalization form "NFC" and may support normalization forms "NFD", "NFKC", "NFKD", "FULLY-NORMALIZED". They may also support other normalization forms with implementation-defined semantics.

   Saxon currently supports normalization forms NFC, NFD, NFKC, and NFKD.

6. The ability to decompose strings into collation units suitable for substring matching is an implementation-defined property of a collation.

   Saxon supports this capability for a collation implemented using a Java `RuleBasedCollator`. Any Java `Comparator` can be used to implement a collation, but the substring matching functions will fail (error FOCH0004) if the `Comparator` is not a `RuleBasedCollator`.

   Saxon also supports this capability on the .NET platform. However, the results delivered by the collation support on the .NET platform do not appear to be 100% aligned with the XPath specification.

7. All minimally conforming processors must support year values with a minimum of 4 digits (i.e., YYYY) and a minimum fractional second precision of 1 millisecond or three digits (that is, s.sss). However, conforming processors may set larger implementation-defined limits on the maximum number of digits they support in these two situations.

   Saxon allows the year to be any 32-bit signed integer. Computations involving negative years are not encouraged because of speculation in the XML Schema specification about future changes to the semantics of the data type. Seconds are supported to a fractional precision of six digits (that is, microsecond precision).

8. Various aspects of the processing provided by `doc()` are implementation-defined. Implementations may provide external configuration options that allow any aspect of the processing to be controlled by the user.

   Saxon allows the URI dereferencing to be performed using a user-supplied `URIResolver`, as defined in the JAXP specification, or using an `XmlResolver` on the .NET platform. Saxon also provides various options to control whitespace stripping, validation using a DTD or schema, handling of errors, and support for XML 1.1. If appropriate configuration options are set, then query parameters are recognized in the URI to control some of these decisions.

Next