Saxon extensions to the W3C XSLT/XQuery specifications

The types of external objects returned by extension functions or extension instructions can now be represented using the actual Java class name. For example, a variable holding the value returned by the instruction sql:connect can be described with the attribute as="java:java.sql.Connection". The system will check that the actual value conforms to this type. The java prefix here must be bound to the namespace URI http://saxon.sf.net/java-type.

In mapping a Java class name to a QName with this namespace URI, any '$' signs in the class name are now mapped to '-' characters, to ensure that the resulting name is a legal QName.

A singleton atomic value can now be passed to an extension function that expects a List, a SequenceIterator, or a SequenceValue. (Saxon previously allowed sequences to be passed to such functions, but this failed in the special case where the sequence was a singleton).

I have added an extension function saxon:typeAnnotation for diagnostic use. It takes a node as argument, and returns a string representation of its type. In the case of an anonymous type, this will be a path identifying the type within the schema.