public abstract class OXQEntityResolver
extends java.lang.Object
Used by the XQuery processor to obtain different kinds of resource entities. Users may extend this in order to provide schemas, modules, documents, etc. to the XQuery processor. An OXQEntityResolver may be set on the connection or on the static context.
Note: Implementations of OXQEntityResolver must be thread-safe if multiple expressions obtained from the same connection will be evaluated concurrently by different threads.
In general, the processor will not receive an entity unless an OXQEntityResovler is specified. For example, if no entity resolver is specified, a call to the fn:doc function will certainly fail no matter what the input URI is. However, there is an internal default entity resolver for certain entity kinds. The following sections describe what will be returned by the default entity resolver:
OXQEntityKind.SCHEMA)The following table describes the schemas that will be returned by the default entity resolver given a target namespace and location:
| Target namespace | System ID (location) | Schema returned |
|---|---|---|
http://www.w3.org/XML/1998/namespace |
http://www.w3.org/2001/xml.xsd |
A schema that describes the XML namespace, in a form suitable for import by other schema documents. |
http://www.w3.org/2001/XMLSchema |
http://www.w3.org/2001/XMLSchema.xsd |
The XML Schema schema for XML Schemas |
OXQEntityKind.XML_PARSER_FACTORY)The default entity resolver returns javax.xml.stream.XMLInputFactory.newInstance().
OXQEntityKind.DOM_FACTORY)The default entity resolver returns javax.xml.parsers.DocumentBuilderFactory.newInstance().
OXQEntityKind.COLLATION)If the system ID is "http://www.w3.org/2005/xpath-functions/collation/codepoint" then the code point collator will be returned.
If the system ID is "http://xmlns.oracle.com/xdk/xquery/collation", a java.text.Collator corresponding to the JVM default Locale will be returned. Additionally, the following URI query parameters may be used to select a different Collator:
language - the ISO-639 language code. See java.util.Localecountry - the ISO-3166 country code. See java.util.Localestrength - the strength of the Collator. Must be one of "PRIMARY", "SECONDARY", "TERTIARY", or "IDENTICAL". See java.text.Collator#setStrength(int).decomposition - the decomposition mode of the Collator. Must be one of "NO_DECOMPOSITION", "CANONICAL_DECOMPOSITION", "FULL_DECOMPOSITION". See java.text.Collator#setDecomposition(int)."NAME=VALUE" where each binding may be separated by either ';' or '&'. For example, "http://xmlns.oracle.com/xdk/xquery/collation?language=de;strength=SECONDARY" would return a German collator at "SECONDARY" strength.
If the system ID is "http://xmlns.oracle.com/xdk/xquery/collation/oracle", a oracle.i18n.text.OraCollator corresponding to the JVM default Locale will be returned. Additionally, the following URI query parameters may be used to select a different OraCollator.
language - the ISO-639 language code. See java.util.Localecountry - the ISO-3166 country code. See java.util.LocalesortRule - Oracle sort rule name See oracle.i18n.text.OraCollator#getInstance(String, String)charSet - Oracle database character set See oracle.i18n.text.OraCollator#getInstance(String, String)strength - the strength of the collator. Must be one of "PRIMARY", "SECONDARY", or "TERTIARY". See oracle.i18n.text.OraCollator#setStrength(int)composition - the composition mode. Must be one of "CANONICAL_COMPOSITION" or "NO_COMPOSITION". See oracle.i18n.text.OraCollator#setComposition(int)"http://xmlns.oracle.com/xdk/xquery/collation/oracle?sortRule=XGERMAN;strength=SECONDARY" would return a German collator "SECONDARY" strength.| Modifier and Type | Method and Description |
|---|---|
abstract OXQEntity |
resolveEntity(OXQEntityKind kind, OXQEntityLocator locator, OXQEntityResolverRequestOptions options)
Called by the XQuery processor to obtain an entity (e.g. schema, module, document, etc.).
|
public abstract OXQEntity resolveEntity(OXQEntityKind kind, OXQEntityLocator locator, OXQEntityResolverRequestOptions options) throws XQException, java.io.IOException
kind parameter indicates what information will be present in the locator and what may be returned in the OXQEntity. For more details, see OXQEntityLocator and OXQEntity.kind - The kind of entity to be resolved.locator - The location of the entity to be resolved.options - Additional options for resolving the entity.null if it could not be resolvedjava.io.IOExceptionXQException