<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>SchemaManager</title> <meta name="keywords" content="Saxon.Api.SchemaManager class"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> </head> <body> <div style="width:20%; float:left; background-color:#c1cede; overflow:auto; height:100%"> <h2>Saxon.Api</h2> <div style="position:relative; height:4pt"> <p>Class <a href="DocumentBuilder.html">DocumentBuilder</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DomDestination.html">DomDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DynamicContext.html">DynamicContext</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DynamicError.html">DynamicError</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="EmptyEnumerator.html">EmptyEnumerator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="ExtensionFunctionCall.html">ExtensionFunctionCall</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="ExtensionFunctionDefinition.html">ExtensionFunctionDefinition</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="NullDestination.html">NullDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="Processor.html">Processor</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="QName.html">QName</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="SchemaManager.html">SchemaManager</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="SchemaValidator.html">SchemaValidator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="Serializer.html">Serializer</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="StaticContext.html">StaticContext</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="StaticError.html">StaticError</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="TextWriterDestination.html">TextWriterDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathCompiler.html">XPathCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathExecutable.html">XPathExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathSelector.html">XPathSelector</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryCompiler.html">XQueryCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryEvaluator.html">XQueryEvaluator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryExecutable.html">XQueryExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyFunctionType.html">XdmAnyFunctionType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyItemType.html">XdmAnyItemType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyNodeType.html">XdmAnyNodeType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAtomicType.html">XdmAtomicType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAtomicValue.html">XdmAtomicValue</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmDestination.html">XdmDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmEmptySequence.html">XdmEmptySequence</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmFunctionItem.html">XdmFunctionItem</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmItem.html">XdmItem</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmItemType.html">XdmItemType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmNode.html">XdmNode</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmNodeKind.html">XdmNodeKind</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmSequenceType.html">XdmSequenceType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmValue.html">XdmValue</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XmlDestination.html">XmlDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltCompiler.html">XsltCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltExecutable.html">XsltExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltTransformer.html">XsltTransformer</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="RecoveryPolicy.html">RecoveryPolicy</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="SchemaValidationMode.html">SchemaValidationMode</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="TreeModel.html">TreeModel</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="WhitespacePolicy.html">WhitespacePolicy</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="XdmAxis.html">XdmAxis</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IMessageListener.html">IMessageListener</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IQueryResolver.html">IQueryResolver</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IResultDocumentHandler.html">IResultDocumentHandler</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IXdmEnumerator.html">IXdmEnumerator</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IXmlLocation.html">IXmlLocation</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="SchemaResolver.html">SchemaResolver</a></p> </div> </div> <div style="width:5%; float:left; background-color:#e4eef0; overflow:auto; height:100%"> </div> <div style="float:left; width:75%; overflow:auto; height:100%;"> <h2><font size="-1">Saxon.Api</font><br>Class SchemaManager </h2> <hr> <dl> <dt><pre>public class SchemaManager</pre></dt> <dt> implements <a href="http://msdn.microsoft.com/en-us/library/system.object(VS.80).aspx">object</a></dt> </dl> <dl> <dd> <p> A <code>SchemaManager</code> is responsible for compiling schemas and maintaining a cache of compiled schemas that can be used for validating instance documents. </p> <p>To obtain a <code>SchemaManager</code>, use the <code>SchemaManager</code> property of the <code>Processor</code> object. </p> <p>In a schema-aware Processor there is exactly one <code>SchemaManager</code> (in a non-schema-aware Processor there is none). </p> <p>The cache of compiled schema definitions can include only one schema component (for example a type, or an element declaration) with any given name. An attempt to compile two different schemas in the same namespace will usually therefore fail. </p> <p>As soon as a type definition or element declaration is used for the first time in a validation episode, it is marked as being "sealed": this prevents subsequent modifications to the component. Examples of modifications that are thereby disallowed include adding to the substitution group of an existing element declaration, adding subtypes to an existing type, or redefining components using <xs:redefine> </p> </dd> </dl> <hr><a name="property_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Property Summary</b></font></th> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a></code></td> <td><code><b><a href="#XsdVersion">XsdVersion</a></b></code><p> The version of the W3C XML Schema Specification handled by this SchemaManager </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="SchemaResolver.html">SchemaResolver</a></code></td> <td><code><b><a href="#SchemaResolver">SchemaResolver</a></b></code><p> 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 <code>xs:import</code>, <code>xs:include</code>, and <code>xs:redefine</code>; to references from an instance document to a schema in <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code>, to <code>xsl:import-schema</code> in XSLT, and to the <code>import schema</code> declaration in XQuery. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="http://msdn.microsoft.com/en-us/library/system.collections.ilist(VS.80).aspx">IList</a></code></td> <td><code><b><a href="#ErrorList">ErrorList</a></b></code><p> List of errors. The caller may supply an empty list before calling Compile; the processor will then populate the list with error information obtained during the schema compilation. Each error will be included as an object of type StaticError. If no error list is supplied by the caller, error information will be written to the standard error stream. </p> </td> </tr> </table> <a name="method_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Method Summary</b></font></th> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#Compile(System.IO.Stream,System.Uri)">Compile</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input, System.Uri baseUri)</code><p> Compile a schema supplied as a Stream. The resulting schema components are added to the cache. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#Compile(System.Uri)">Compile</a></b>(System.Uri uri)</code><p> Compile a schema, retrieving the source using a URI. The resulting schema components are added to the cache. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#Compile(System.Xml.XmlReader)">Compile</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader(VS.80).aspx">System.Xml.XmlReader</a> reader)</code><p> Compile a schema, delivered using an XmlReader. The resulting schema components are added to the cache. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#Compile(Saxon.Api.XdmNode)">Compile</a></b>(<a href="XdmNode.html">XdmNode</a> node)</code><p> Compile a schema document, located at an XdmNode. This may be a document node whose child is an <code>xs:schema</code> element, or it may be the <code>xs:schema</code> element itself. The resulting schema components are added to the cache. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="SchemaValidator.html">SchemaValidator</a></code></td> <td><code><b><a href="#NewSchemaValidator()">NewSchemaValidator</a></b>()</code><p> Create a new <code>SchemaValidator</code>, which may be used for validating instance documents. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmAtomicType.html">XdmAtomicType</a></code></td> <td><code><b><a href="#GetAtomicType(Saxon.Api.QName)">GetAtomicType</a></b>(<a href="QName.html">QName</a> qname)</code><p> Factory method to get an <code>AtomicType</code> object representing the atomic type with a given QName. </p> </td> </tr> </table> <a name="property_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Property Detail</b></font></th> </tr> </table><a name="XsdVersion"></a><h3>XsdVersion</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a> <b>XsdVersion</b> {get; set; }</pre><dl> <dd> <p> The version of the W3C XML Schema Specification handled by this SchemaManager </p> <p>The value must be "1.0" (indicating XML Schema 1.0) or "1.1" (indicating XML Schema 1.1. The default is "1.0". New constructs defined in XSD 1.1 are rejected unless this property is set to "1.1" before compiling the schema. </p> </dd> </dl> <hr><a name="SchemaResolver"></a><h3>SchemaResolver</h3><pre>public <a href="SchemaResolver.html">SchemaResolver</a> <b>SchemaResolver</b> {get; set; }</pre><dl> <dd> <p> 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 <code>xs:import</code>, <code>xs:include</code>, and <code>xs:redefine</code>; to references from an instance document to a schema in <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code>, to <code>xsl:import-schema</code> in XSLT, and to the <code>import schema</code> declaration in XQuery. </p> </dd> </dl> <hr><a name="ErrorList"></a><h3>ErrorList</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.collections.ilist(VS.80).aspx">IList</a> <b>ErrorList</b> {get; set; }</pre><dl> <dd> <p> List of errors. The caller may supply an empty list before calling Compile; the processor will then populate the list with error information obtained during the schema compilation. Each error will be included as an object of type StaticError. If no error list is supplied by the caller, error information will be written to the standard error stream. </p> <p>By supplying a custom List with a user-written add() method, it is possible to intercept error conditions as they occur. </p> <p>Note that this error list is used only for errors detected during the compilation of the schema. It is not used for errors detected when using the schema to validate a source document. </p> </dd> </dl> <hr><a name="method_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Method Detail</b></font></th> </tr> </table><a name="Compile(System.IO.Stream,System.Uri)"></a><h3>Compile</h3><pre>public void <b>Compile</b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input, System.Uri baseUri)</pre><dl> <dd> <p> Compile a schema supplied as a Stream. The resulting schema components are added to the cache. </p><b>Parameters:</b><dl> <dt><code>input</code> - </dt> <dd>A stream containing the source text of the schema. This method will consume the supplied stream. It is the caller's responsibility to close the stream after use. </dd> </dl> <dl> <dt><code>baseUri</code> - </dt> <dd>The base URI of the schema document, for resolving any references to other schema documents </dd> </dl> </dd> </dl> <hr><a name="Compile(System.Uri)"></a><h3>Compile</h3><pre>public void <b>Compile</b>(System.Uri uri)</pre><dl> <dd> <p> Compile a schema, retrieving the source using a URI. The resulting schema components are added to the cache. </p> <p> The document located via the URI is parsed using the <code>System.Xml</code> parser. </p><b>Parameters:</b><dl> <dt><code>uri</code> - </dt> <dd>The URI identifying the location where the schema document can be found </dd> </dl> </dd> </dl> <hr><a name="Compile(System.Xml.XmlReader)"></a><h3>Compile</h3><pre>public void <b>Compile</b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader(VS.80).aspx">System.Xml.XmlReader</a> reader)</pre><dl> <dd> <p> Compile a schema, delivered using an XmlReader. The resulting schema components are added to the cache. </p> <p> The <code>XmlReader</code> is responsible for parsing the document; this method builds a tree representation of the document (in an internal Saxon format) and compiles it. The <code>XmlReader</code> is used as supplied; it is the caller's responsibility to ensure that its settings are appropriate for parsing a schema document (for example, that entity references are expanded and whitespace is retained.) </p><b>Parameters:</b><dl> <dt><code>reader</code> - </dt> <dd>The XmlReader (that is, the XML parser) used to supply the source schema document</dd> </dl> </dd> </dl> <hr><a name="Compile(Saxon.Api.XdmNode)"></a><h3>Compile</h3><pre>public void <b>Compile</b>(<a href="XdmNode.html">XdmNode</a> node)</pre><dl> <dd> <p> Compile a schema document, located at an XdmNode. This may be a document node whose child is an <code>xs:schema</code> element, or it may be the <code>xs:schema</code> element itself. The resulting schema components are added to the cache. </p><b>Parameters:</b><dl> <dt><code>node</code> - </dt> <dd>The document node or the outermost element node of a schema document.</dd> </dl> </dd> </dl> <hr><a name="NewSchemaValidator()"></a><h3>NewSchemaValidator</h3><pre>public <a href="SchemaValidator.html">SchemaValidator</a> <b>NewSchemaValidator</b>()</pre><dl> <dd> <p> Create a new <code>SchemaValidator</code>, which may be used for validating instance documents. </p> <p>The <code>SchemaValidator</code> uses the cache of schema components held by the <code>SchemaManager</code>. It may also add new components to this cache (for example, when the instance document references a schema using <code>xsi:schemaLocation</code>). It is also affected by changes to the schema cache that occur after the <code>SchemaValidator</code> is created. </p> <p>When schema components are used for validating instance documents (or for compiling schema-aware queries and stylesheets) they are <i>sealed</i> to prevent subsequent modification. The modifications disallowed once a component is sealed include adding to the substitution group of an element declaration, adding subtypes derived by extension to an existing complex type, and use of <code><xs:redefine></code> </p> </dd> </dl> <hr><a name="GetAtomicType(Saxon.Api.QName)"></a><h3>GetAtomicType</h3><pre>public <a href="XdmAtomicType.html">XdmAtomicType</a> <b>GetAtomicType</b>(<a href="QName.html">QName</a> qname)</pre><dl> <dd> <p> Factory method to get an <code>AtomicType</code> object representing the atomic type with a given QName. </p> <p> It is undefined whether two calls on this method supplying the same QName will return the same <code>XdmAtomicType</code> object instance. </p><b>Parameters:</b><dl> <dt><code>qname</code> - </dt> <dd>The QName of the required type</dd> </dl> <dl> <dt>returns</dt> <dd>An <code>AtomicType</code> object representing this type if it is present in this schema (and is an atomic type); otherwise, null. </dd> </dl> </dd> </dl> <hr> </div> </body> </html>