Class XQueryResolver
Provides a base class that is used for file resolution policy. Implementations of this class are used for URI resolution, or for public and system id resolution. XQueryResolver implementations are identified for use using RegisterResolver(XQueryResolver).
Inheritance
Implements
Inherited Members
Namespace: Figaro
Assembly: Figaro.dll
Syntax
public abstract class XQueryResolver : IDisposable
Remarks
The XQueryResolver class allows applications to provide named access to application-specific objects, such as documents, collections of documents, DTDs, and XML schema. Figaro can resolve references to names within a container, or a file system; applications can create XQueryResolver instances that can resolve entities in other locations.
If an application uses multiple threads, custom implementations of
XQueryResolver
must be free threaded, and allow multiple,
simultaneous calls for resolution.
For an example of a XQueryResolver implementation, see the SDK samples.
Constructors
View SourceXQueryResolver(Uri)
Initializes a new instance of the XQueryResolver class.
Declaration
protected XQueryResolver(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | The unique identifier for the resolver. |
Properties
View SourceUri
Gets the unique identifier for the resolver.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Methods
View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
ResolveCollection(XmlTransaction, XmlManager, String, XmlResults)
Resolve a custom collection external to XQuery and the Figaro XML Database containers.
Declaration
public abstract bool ResolveCollection(XmlTransaction txn, XmlManager mgr, string uri, XmlResults collection)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The owning XmlManager object. |
System.String | uri | The URI of the collection to resolve. |
XmlResults | collection | The XmlResults object to add collection items to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ResolveDocument(XmlTransaction, XmlManager, String)
Resolve a document referenced in an XQuery query.
Declaration
public abstract XmlDocument ResolveDocument(XmlTransaction txn, XmlManager mgr, string uri)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The owning XmlManager object. |
System.String | uri | The URI of the XmlDocument to resolve. |
Returns
Type | Description |
---|---|
XmlDocument | The referenced XmlDocument, or |
ResolveEntity(XmlTransaction, XmlManager, String, String)
Resolve an external entity in an XQuery query.
Declaration
public abstract XmlInputStream ResolveEntity(XmlTransaction txn, XmlManager mgr, string systemId, string publicId)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The owning XmlManager object. |
System.String | systemId | The system ID of the referenced entity. |
System.String | publicId | The public ID of the referenced entity. |
Returns
Type | Description |
---|---|
XmlInputStream | The referenced entity, or |
ResolveExternalFunction(XmlTransaction, XmlManager, String, String, UInt64)
Resolve the URI, name and number of arguments to an XmlExternalFunction
implementation. If the external function cannot be resolved by this
XQueryResolver, then the method should return null
.
The returned XmlExternalFunction
will be adopted by Figaro, and disposed of when it's been used.
Declaration
public abstract XmlExternalFunction ResolveExternalFunction(XmlTransaction txn, XmlManager mgr, string uri, string name, ulong numArgs)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The XmlManager object associated with the operation. |
System.String | uri | The URI of the function to resolve. |
System.String | name | The XQuery function name. |
System.UInt64 | numArgs | The number of XQuery function arguments. |
Returns
Type | Description |
---|---|
XmlExternalFunction | A new XmlExternalFunction instance, or |
Remarks
caution
If the resolver successfully locates the XmlExternalFunction, return a new instance of the XmlExternalFunction object.
ResolveModule(XmlTransaction, XmlManager, String, String)
When implemented, should resolve a module location (URI) and namespace to a
new XmlInputStream. If the location and namespace cannot be resolved by
this resolver, this method should return null
.
Declaration
public abstract XmlInputStream ResolveModule(XmlTransaction txn, XmlManager mgr, string moduleLocation, string nameSpace)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The XmlManager object associated with the operation. |
System.String | moduleLocation | The module location. |
System.String | nameSpace | The module namespace. |
Returns
Type | Description |
---|---|
XmlInputStream | an XmlInputStream instance containing the loaded XQuery module. |
Remarks
The XmlInputStream object will be deleted by the caller, and should not be reused.
ResolveModuleLocation(XmlTransaction, XmlManager, String, XmlResults)
Resolve the XQuery module location(s) according to the nameSpace
Declaration
public abstract bool ResolveModuleLocation(XmlTransaction txn, XmlManager mgr, string nameSpace, XmlResults moduleLocations)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The XmlManager object associated with the operation. |
System.String | nameSpace | The namespace of the module(s) to resolve. |
XmlResults | moduleLocations | The XmlResults object to store the location(s) of the XQuery module(s).s |
Returns
Type | Description |
---|---|
System.Boolean |
|
ResolveSchema(XmlTransaction, XmlManager, String, String)
Resolve schemas referenced in XQuery queries.
Declaration
public abstract XmlInputStream ResolveSchema(XmlTransaction txn, XmlManager mgr, string schemaLocation, string nameSpace)
Parameters
Type | Name | Description |
---|---|---|
XmlTransaction | txn | If a transaction is in force, a reference to the XmlTransaction object; otherwise, |
XmlManager | mgr | The XmlManager object associated with the operation. |
System.String | schemaLocation | The location of the resolved schema. |
System.String | nameSpace | The namespace of the module(s) to resolve. |
Returns
Type | Description |
---|---|
XmlInputStream | The XmlInputStream containing the referenced schema, or |