Skip navigation links

Oracle® Database XML Java API Reference
12c Release 1 (12.1)

E15981-09


oracle.xml.xquery
Class OXQEntityResolver

java.lang.Object
  extended by oracle.xml.xquery.OXQEntityResolver


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:

Default Schema Resolution (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

Default Parser Factory Resolution (OXQEntityKind.XML_PARSER_FACTORY)

The default entity resolver returns javax.xml.stream.XMLInputFactory.newInstance().

Default DOM Factory Resolution (OXQEntityKind.DOM_FACTORY)

The default entity resolver returns javax.xml.parsers.DocumentBuilderFactory.newInstance().

Default Collation Resolution (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:

The parameter binding syntax is of the form "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.

For example, "http://xmlns.oracle.com/xdk/xquery/collation/oracle?sortRule=XGERMAN;strength=SECONDARY" would return a German collator "SECONDARY" strength.

Since:
12.1
See Also:
OXQStaticContext.setEntityResolver(OXQEntityResolver), OXQConnection.setEntityResolver(OXQEntityResolver)

Method Summary
abstract  OXQEntity resolveEntity(OXQEntityKind kind, OXQEntityLocator locator, OXQEntityResolverRequestOptions options)
          Called by the XQuery processor to obtain an entity (e.g. schema, module, document, etc.).

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

resolveEntity

public abstract OXQEntity resolveEntity(OXQEntityKind kind,
                                        OXQEntityLocator locator,
                                        OXQEntityResolverRequestOptions options)
                                 throws XQException,
                                        java.io.IOException
Called by the XQuery processor to obtain an entity (e.g. schema, module, document, etc.). The entity 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.
Parameters:
kind - The kind of entity to be resolved.
locator - The location of the entity to be resolved.
options - Additional options for resolving the entity.
Returns:
the entity or null if it could not be resolved
Throws:
java.io.IOException
XQException

Skip navigation links

Oracle® Database XML Java API Reference
12c Release 1 (12.1)

E15981-09


Copyright © 2003, 2014, Oracle and/or its affiliates. All rights reserved.