System Programming Interfaces
In the Configuration class, many
of the getters and setters for individual configuration properties have been removed,
relying instead on the general-purpose methods getConfigurationProperty()
and setConfigurationProperty()
. To make these easier to use in the common
case of boolean properties, the new methods getBooleanProperty()
and
setBooleanProperty()
are introduced. Property names that are only relevant
to Saxon-PE or Saxon-EE are now generally recognized only by a ProfessionalConfiguration
or EnterpriseConfiguration
respectively; previously some were also recognized by a Saxon-HE
configuration while others were not.
The classes ValueRepresentation
and Value
have been replaced
by the new class Sequence. In some interfaces
Sequence
also replaces SequenceIterator, since passing a
LazySequence
(which implements Sequence
) has all the same performance
benefits as passing a SequenceIterator
, while still allowing an Item
to be passed directly, without wrapping.
The change affects (simplifies) the interface for integrated extension functions,
where arguments and result values are now passed as Sequence
objects rather than
as SequenceIterator
instances.
In the NodeInfo interface, the two methods
getTypedValue()
and atomize()
for obtaining the typed value of a
node have been unified into a single method, atomize()
, which returns the new
type AtomicSequence. In the vast majority of cases the typed value is a single
atomic value, and this case works efficiently because AtomicValue
implements AtomicSequence.
Also in the NodeInfo interface, the method
getAttributeValue(fingerprint)
has been dropped; callers should use getAttributeValue(uri, local)
instead.
The OutputURIResolver interface has been changed:
a new method newInstance()
is added.
This change is made because xsl:result-document
is now multi-threaded by default, and since it's likely
that existing implementations of OutputURIResolver
won't be thread-safe, making an interface change is better
than a semantic change that will cause the code to break in difficult-to-diagnose ways. The new method typically returns
a new instance of the OutputURIResolver
class, so that each instance of the class only needs to remember information
about one result document, and is automatically thread-safe.
In the Java classes that implement the schema component model (in package com.saxonica.schema
)
many of the methods that return an Iterator
have been replaced by methods that return a Set
or a List
.
This simplifies processing by enabling use of the Java for-each
construct, and is more
convenient when the saxon:schema
extension function is used to process schema components
in the form of XPath functions.
The toString()
method on the Expression class has been more carefully defined and implemented
in an attempt to achieve the result that (for an Expression within the scope of XPath) the result
is a legal and equivalent XPath 3.0 expression with no dependencies on namespace prefixes
other than (a) the binding of the prefix "xs" to the standard Schema namespace, and (b) the
assumption that the XPath functions namespace is the default function namespace. In other cases
QNames are expanded using EQName notation Q{uri}local
. There may be a few remaining
cases where the output does not yet satisfy these intentions.