The <resources> element
The resources
element in the configuration file defines a number of resources that can be preloaded into the configuration. It contains
child elements as detailed below, in any order; most of them can appear more than once.
Element |
Applies to |
Values |
Effect |
externalObjectModel |
HE PE EE |
Class that implements the ExternalObjectModel interface |
Defines an external object model that can be used to provide input to Saxon (and in some cases receive output): for example DOM, JDOM, XOM, etc. |
extensionFunction |
HE PE EE |
Class that implements the ExtensionFunctionDefinition interface |
Defines an "integrated extension function" written to a specific Saxon API. |
schemaDocument |
EE |
Relative or absolute URI |
A schema document to be preloaded into the Saxon schema cache. |
schemaComponentModel |
EE |
Relative or absolute URI |
A schema component model document (previously exported by Saxon) allowing fast loading of a compiled schema. |
The resources
element may also contain zero or more fileExtension
elements as detailed below.
These are used to define a mapping from file extensions to media types.
Each fileExtension
element must have the following attributes, to define one pair in the mapping:
Attribute |
Applies to |
Values |
Effect |
extension |
HE PE EE |
An extension type, e.g. "xq" |
A file extension. |
mediaType |
HE PE EE |
A media type, e.g. "text/plain" |
The media type corresponding to the file extension. The media types that are recognised by default are: application/xml, text/xml, application/html, text/html, application/atom, application/xml+xslt, and application/xml+xsd (which return an XML node); text/plain, and application/java (which return a string); application/binary (returns base64Binary); and application/json (returns the result of parsing the JSON, typically a map or array). |