<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>DocumentBuilder</title> <meta name="keywords" content="Saxon.Api.DocumentBuilder 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 DocumentBuilder </h2> <hr> <dl> <dt><pre>public class DocumentBuilder</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> The <code>DocumentBuilder</code> class enables XDM documents to be built from various sources. The class is always instantiated using the <code>NewDocumentBuilder</code> method on the <code>Processor</code> object. </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> XmlResolver</code></td> <td><code><b><a href="#XmlResolver">XmlResolver</a></b></code><p> An XmlResolver, which will be used to resolve URIs of documents being loaded and of references to external entities within those documents (including any external DTD). </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.boolean(VS.80).aspx">bool</a></code></td> <td><code><b><a href="#IsLineNumbering">IsLineNumbering</a></b></code><p> Determines whether line numbering is enabled for documents loaded using this <code>DocumentBuilder</code>. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="SchemaValidationMode.html">SchemaValidationMode</a></code></td> <td><code><b><a href="#SchemaValidationMode">SchemaValidationMode</a></b></code><p> Determines whether schema validation is applied to documents loaded using this <code>DocumentBuilder</code>, and if so, whether it is strict or lax. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="QName.html">QName</a></code></td> <td><code><b><a href="#TopLevelElementName">TopLevelElementName</a></b></code><p> The required name of the top level element in a document instance being validated against a schema. </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.boolean(VS.80).aspx">bool</a></code></td> <td><code><b><a href="#DtdValidation">DtdValidation</a></b></code><p> Determines whether DTD validation is applied to documents loaded using this <code>DocumentBuilder</code>. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="WhitespacePolicy.html">WhitespacePolicy</a></code></td> <td><code><b><a href="#WhitespacePolicy">WhitespacePolicy</a></b></code><p> Determines the whitespace stripping policy applied when loading a document using this <code>DocumentBuilder</code>. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="TreeModel.html">TreeModel</a></code></td> <td><code><b><a href="#TreeModel">TreeModel</a></b></code><p> The Tree Model implementation to be used for the constructed document. By default the TinyTree is used. The main reason for using the LinkedTree alternative is if updating is required (the TinyTree is not updateable). </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> Uri</code></td> <td><code><b><a href="#BaseUri">BaseUri</a></b></code><p> The base URI of a document loaded using this <code>DocumentBuilder</code>. This is used for resolving any relative URIs appearing within the document, for example in references to DTDs and external entities. </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> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Build(System.Uri)">Build</a></b>(System.Uri uri)</code><p> Load an XML document, retrieving it via a URI. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Build(System.IO.Stream)">Build</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input)</code><p> Load an XML document supplied as raw (lexical) XML on a Stream. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Build(System.IO.TextReader)">Build</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.textreader(VS.80).aspx">System.IO.TextReader</a> input)</code><p> Load an XML document supplied using a TextReader. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Build(System.Xml.XmlReader)">Build</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreader(VS.80).aspx">System.Xml.XmlReader</a> reader)</code><p> Load an XML document, delivered using an XmlReader. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Build(System.Xml.XmlNode)">Build</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlnode(VS.80).aspx">System.Xml.XmlNode</a> source)</code><p> Load an XML DOM document, supplied as an <code>XmlNode</code>, into a Saxon XdmNode. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#Wrap(System.Xml.XmlDocument)">Wrap</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument(VS.80).aspx">System.Xml.XmlDocument</a> doc)</code><p> Wrap an XML DOM document, supplied as an <code>XmlNode</code>, as a Saxon XdmNode. </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="XmlResolver"></a><h3>XmlResolver</h3><pre>public XmlResolver <b>XmlResolver</b> {get; set; }</pre><dl> <dd> <p> An XmlResolver, which will be used to resolve URIs of documents being loaded and of references to external entities within those documents (including any external DTD). </p> <p>By default an <code>XmlUrlResolver</code> is used. This means that the responsibility for resolving and dereferencing URIs rests with the .NET platform (and not with the GNU Classpath). </p> <p>When Saxon invokes a user-written <code>XmlResolver</code>, the <code>GetEntity</code> method may return any of: a <code>System.IO.Stream</code>; a <code>System.IO.TextReader</code>; or a <code>java.xml.transform.Source</code>. However, if the <code>XmlResolver</code> is called by the XML parser to resolve external entity references, then it must return an instance of <code>System.IO.Stream</code>. </p> </dd> </dl> <hr><a name="IsLineNumbering"></a><h3>IsLineNumbering</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.boolean(VS.80).aspx">bool</a> <b>IsLineNumbering</b> {get; set; }</pre><dl> <dd> <p> Determines whether line numbering is enabled for documents loaded using this <code>DocumentBuilder</code>. </p> <p>By default, line numbering is disabled.</p> <p>Line numbering is not available for all kinds of source: in particular, it is not available when loading from an existing XmlDocument. </p> <p>The resulting line numbers are accessible to applications using the extension function saxon:line-number() applied to a node. </p> <p>Line numbers are maintained only for element nodes; the line number returned for any other node will be that of the most recent element. </p> </dd> </dl> <hr><a name="SchemaValidationMode"></a><h3>SchemaValidationMode</h3><pre>public <a href="SchemaValidationMode.html">SchemaValidationMode</a> <b>SchemaValidationMode</b> {get; set; }</pre><dl> <dd> <p> Determines whether schema validation is applied to documents loaded using this <code>DocumentBuilder</code>, and if so, whether it is strict or lax. </p> <p>By default, no schema validation takes place.</p> <p>This option requires the schema-aware version of the Saxon product (Saxon-SA).</p> </dd> </dl> <hr><a name="TopLevelElementName"></a><h3>TopLevelElementName</h3><pre>public <a href="QName.html">QName</a> <b>TopLevelElementName</b> {get; set; }</pre><dl> <dd> <p> The required name of the top level element in a document instance being validated against a schema. </p> <p>If this property is set, and if schema validation is requested, then validation will fail unless the outermost element of the document has the required name. </p> <p>This option requires the schema-aware version of the Saxon product (Saxon-SA).</p> </dd> </dl> <hr><a name="DtdValidation"></a><h3>DtdValidation</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.boolean(VS.80).aspx">bool</a> <b>DtdValidation</b> {get; set; }</pre><dl> <dd> <p> Determines whether DTD validation is applied to documents loaded using this <code>DocumentBuilder</code>. </p> <p>By default, no DTD validation takes place.</p> </dd> </dl> <hr><a name="WhitespacePolicy"></a><h3>WhitespacePolicy</h3><pre>public <a href="WhitespacePolicy.html">WhitespacePolicy</a> <b>WhitespacePolicy</b> {get; set; }</pre><dl> <dd> <p> Determines the whitespace stripping policy applied when loading a document using this <code>DocumentBuilder</code>. </p> <p>By default, whitespace text nodes appearing in element-only content are stripped, and all other whitespace text nodes are retained. </p> </dd> </dl> <hr><a name="TreeModel"></a><h3>TreeModel</h3><pre>public <a href="TreeModel.html">TreeModel</a> <b>TreeModel</b> {get; set; }</pre><dl> <dd> <p> The Tree Model implementation to be used for the constructed document. By default the TinyTree is used. The main reason for using the LinkedTree alternative is if updating is required (the TinyTree is not updateable). </p> </dd> </dl> <hr><a name="BaseUri"></a><h3>BaseUri</h3><pre>public Uri <b>BaseUri</b> {get; set; }</pre><dl> <dd> <p> The base URI of a document loaded using this <code>DocumentBuilder</code>. This is used for resolving any relative URIs appearing within the document, for example in references to DTDs and external entities. </p> <p> This information is required when the document is loaded from a source that does not provide an intrinsic URI, notably when loading from a Stream or a TextReader. </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="Build(System.Uri)"></a><h3>Build</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Build</b>(System.Uri uri)</pre><dl> <dd> <p> Load an XML document, retrieving it via a URI. </p> <p>Note that the type <code>Uri</code> requires an absolute URI. </p> <p>The URI is dereferenced using the registered <code>XmlResolver</code>. </p> <p>This method takes no account of any fragment part in the URI.</p> <p>The <code>role</code> passed to the <code>GetEntity</code> method of the <code>XmlResolver</code> is "application/xml", and the required return type is <code>System.IO.Stream</code>. </p> <p>The document located via the URI is parsed using the <code>System.Xml</code> parser. </p> <p>Note that the Microsoft <code>System.Xml</code> parser does not report whether attributes are defined in the DTD as being of type <code>ID</code> and <code>IDREF</code>. This is true whether or not DTD-based validation is enabled. This means that such attributes are not accessible to the <code>id()</code> and <code>idref()</code> functions. </p> <b>Parameters:</b><dl> <dt><code>uri</code> - </dt> <dd>The URI identifying the location where the document can be found. This will also be used as the base URI of the document (regardless of the setting of the <code>BaseUri</code> property). </dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>. This will be the document node at the root of the tree of the resulting in-memory document. </dd> </dl> </dd> </dl> <hr><a name="Build(System.IO.Stream)"></a><h3>Build</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Build</b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input)</pre><dl> <dd> <p> Load an XML document supplied as raw (lexical) XML on a Stream. </p> <p>The document is parsed using the Microsoft <code>System.Xml</code> parser if the "http://saxon.sf.net/feature/preferJaxpParser" property on the <code>Processor</code> is set to false; otherwise it is parsed using the Apache Xerces XML parser. </p> <p>Before calling this method, the <code>BaseUri</code> property must be set to identify the base URI of this document, used for resolving any relative URIs contained within it. </p> <p>Note that the Microsoft <code>System.Xml</code> parser does not report whether attributes are defined in the DTD as being of type <code>ID</code> and <code>IDREF</code>. This is true whether or not DTD-based validation is enabled. This means that such attributes are not accessible to the <code>id()</code> and <code>idref()</code> functions. </p> <b>Parameters:</b><dl> <dt><code>input</code> - </dt> <dd>The Stream containing the XML source to be parsed</dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>, the document node at the root of the tree of the resulting in-memory document </dd> </dl> </dd> </dl> <hr><a name="Build(System.IO.TextReader)"></a><h3>Build</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Build</b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.textreader(VS.80).aspx">System.IO.TextReader</a> input)</pre><dl> <dd> <p> Load an XML document supplied using a TextReader. </p> <p>The document is parsed using the Microsoft <code>System.Xml</code> parser if the "http://saxon.sf.net/feature/preferJaxpParser" property on the <code>Processor</code> is set to false; otherwise it is parsed using the Apache Xerces XML parser. </p> <p>Before calling this method, the <code>BaseUri</code> property must be set to identify the base URI of this document, used for resolving any relative URIs contained within it. </p> <p>Note that the Microsoft <code>System.Xml</code> parser does not report whether attributes are defined in the DTD as being of type <code>ID</code> and <code>IDREF</code>. This is true whether or not DTD-based validation is enabled. This means that such attributes are not accessible to the <code>id()</code> and <code>idref()</code> functions. </p> <b>Parameters:</b><dl> <dt><code>input</code> - </dt> <dd>The <code>TextReader</code> containing the XML source to be parsed </dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>, the document node at the root of the tree of the resulting in-memory document </dd> </dl> </dd> </dl> <hr><a name="Build(System.Xml.XmlReader)"></a><h3>Build</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Build</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> Load an XML document, delivered using an XmlReader. </p> <p>The XmlReader is responsible for parsing the document; this method builds a tree representation of the document (in an internal Saxon format) and returns its document node. The XmlReader is not required to perform validation but it must expand any entity references. Saxon uses the properties of the <code>XmlReader</code> as supplied. </p> <p>Use of a plain <code>XmlTextReader</code> is discouraged, because it does not expand entity references. This should only be used if you know in advance that the document will contain no entity references (or perhaps if your query or stylesheet is not interested in the content of text and attribute nodes). Instead, with .NET 1.1 use an <code>XmlValidatingReader</code> (with <code>ValidationType</code> set to <code>None</code>). The constructor for <code>XmlValidatingReader</code> is obsolete in .NET 2.0, but the same effect can be achieved by using the <code>Create</code> method of <code>XmlReader</code> with appropriate <code>XmlReaderSettings</code> </p> <p>Conformance with the W3C specifications requires that the <code>Normalization</code> property of an <code>XmlTextReader</code> should be set to <code>true</code>. However, Saxon does not insist on this. </p> <p>If the <code>XmlReader</code> performs schema validation, Saxon will ignore any resulting type information. Type information can only be obtained by using Saxon's own schema validator, which will be run if the <code>SchemaValidationMode</code> property is set to <code>Strict</code> or <code>Lax</code> </p> <p>Note that the Microsoft <code>System.Xml</code> parser does not report whether attributes are defined in the DTD as being of type <code>ID</code> and <code>IDREF</code>. This is true whether or not DTD-based validation is enabled. This means that such attributes are not accessible to the <code>id()</code> and <code>idref()</code> functions. </p> <p>Note that setting the <code>XmlResolver</code> property of the <code>DocumentBuilder</code> has no effect when this method is used; if an <code>XmlResolver</code> is required, it must be set on the <code>XmlReader</code> itself. </p> <b>Parameters:</b><dl> <dt><code>reader</code> - </dt> <dd>The XMLReader that supplies the parsed XML source</dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>, the document node at the root of the tree of the resulting in-memory document </dd> </dl> </dd> </dl> <hr><a name="Build(System.Xml.XmlNode)"></a><h3>Build</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Build</b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlnode(VS.80).aspx">System.Xml.XmlNode</a> source)</pre><dl> <dd> <p> Load an XML DOM document, supplied as an <code>XmlNode</code>, into a Saxon XdmNode. </p> <p> The returned document will contain only the subtree rooted at the supplied node. </p> <p> This method copies the DOM tree to create a Saxon tree. See the <code>Wrap</code> method for an alternative that creates a wrapper around the DOM tree, allowing it to be modified in situ. </p> <b>Parameters:</b><dl> <dt><code>source</code> - </dt> <dd>The DOM Node to be copied to form a Saxon tree</dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>, the document node at the root of the tree of the resulting in-memory document </dd> </dl> </dd> </dl> <hr><a name="Wrap(System.Xml.XmlDocument)"></a><h3>Wrap</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Wrap</b>(<a href="http://msdn.microsoft.com/en-us/library/system.xml.xmldocument(VS.80).aspx">System.Xml.XmlDocument</a> doc)</pre><dl> <dd> <p> Wrap an XML DOM document, supplied as an <code>XmlNode</code>, as a Saxon XdmNode. </p> <p> This method must be applied at the level of the Document Node. Unlike the <code>Build</code> method, the original DOM is not copied. This saves memory and time, but it also means that it is not possible to perform operations such as whitespace stripping and schema validation. </p> <b>Parameters:</b><dl> <dt><code>doc</code> - </dt> <dd>The DOM document node to be wrapped</dd> </dl> <dl> <dt>returns</dt> <dd>An <code>XdmNode</code>, the Saxon document node at the root of the tree of the resulting in-memory document </dd> </dl> </dd> </dl> <hr> </div> </body> </html>