Saxon.Api

 

 

Saxon.Api

Interface SchemaResolver


public interface SchemaResolver

The SchemaResolver is a user-supplied class used for resolving references to schema documents. It applies to references from one schema document to another appearing in xs:import, xs:include, and xs:redefine; to references from an instance document to a schema in xsi:schemaLocation and xsi:noNamespaceSchemaLocation, to xsl:import-schema in XSLT, and to the import schema declaration in XQuery.

Method Summary

 object GetEntity(Uri absoluteUri)

Dereference a URI returned by GetSchemaDocuments to retrieve a Stream containing the actual XML schema document.

 Uri[] GetSchemaDocuments(string targetNamespace, Uri baseUri, string[] locationHints)

Given a target namespace and a set of location hints, return a set of schema documents.

 

Method Detail

GetEntity

public object GetEntity(Uri absoluteUri)

Dereference a URI returned by GetSchemaDocuments to retrieve a Stream containing the actual XML schema document.

Parameters:

absoluteUri - A URI returned by the GetSchemaDocuments method.

Returns:

Either a Stream or a String containing the schema text. The supplied URI will be used as the base URI of the schema document.

GetSchemaDocuments

public Uri[] GetSchemaDocuments(string targetNamespace,
Uri baseUri,
string[] locationHints)

Given a target namespace and a set of location hints, return a set of schema documents.

Parameters:

targetNamespace - The target namespace of the required schema components
baseUri - The base URI of the module containing the reference to a schema document declaration
locationHints - The sequence of URIs (if any) listed as location hints. In most cases there will only be one; but the import schema declaration in XQuery permits several.

Returns:

A set of absolute URIs identifying the schema documents to be loaded. There is no requirement that these correspond one-to-one with the URIs defined in the locationHints. The returned URIs will be dereferenced by calling the GetEntity method.