<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>XdmNode</title> <meta name="keywords" content="Saxon.Api.XdmNode 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 XdmNode </h2> <hr> <dl> <dt><pre>public class XdmNode</pre></dt> <dt> extends <a href="XdmItem.html">XdmItem</a></dt> </dl> <dl> <dd> <p> The class <code>XdmNode</code> represents a Node in the XDM Data Model. A Node is an <code>XdmItem</code>, and is therefore an <code>XdmValue</code> in its own right, and may also participate as one item within a sequence value. </p> <p>An <code>XdmNode</code> is implemented as a wrapper around an object of type <code>net.sf.saxon.NodeInfo</code>. Because this is a key interface within Saxon, it is exposed via this API, even though it is a Java interface that is not part of the API proper. </p> <p>The <code>XdmNode</code> interface exposes basic properties of the node, such as its name, its string value, and its typed value. Navigation to other nodes is supported through a single method, <code>EnumerateAxis</code>, which allows other nodes to be retrieved by following any of the XPath axes. </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="QName.html">QName</a></code></td> <td><code><b><a href="#NodeName">NodeName</a></b></code><p> The name of the node, as a <code>QName</code>. Returns null in the case of unnamed nodes. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> XmlNodeType</code></td> <td><code><b><a href="#NodeKind">NodeKind</a></b></code><p> The kind of node, as an instance of <code>System.Xml.XmlNodeType</code>. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmValue.html">XdmValue</a></code></td> <td><code><b><a href="#TypedValue">TypedValue</a></b></code><p> The typed value of the node, as an instance of <code>XdmValue</code>. </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.string(VS.80).aspx">String</a></code></td> <td><code><b><a href="#StringValue">StringValue</a></b></code><p> The string value of the node. </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="#Parent">Parent</a></b></code><p> Get the parent of this node. </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="#Root">Root</a></b></code><p> Get the root of the tree containing this node. </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 the node. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> Uri</code></td> <td><code><b><a href="#DocumentUri">DocumentUri</a></b></code><p> The Document URI of the node. </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.string(VS.80).aspx">String</a></code></td> <td><code><b><a href="#OuterXml">OuterXml</a></b></code><p> Return a serialization of this node as lexical XML </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> NodeInfo</code></td> <td><code><b><a href="#Implementation">Implementation</a></b></code><p> Escape hatch to the underlying class in the Java implementation </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="http://msdn.microsoft.com/en-us/library/system.boolean(VS.80).aspx">bool</a></code></td> <td><code><b><a href="#IsAtomic()">IsAtomic</a></b>()</code><p> Determine whether the item is an atomic value </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.string(VS.80).aspx">String</a></code></td> <td><code><b><a href="#GetAttributeValue(Saxon.Api.QName)">GetAttributeValue</a></b>(<a href="QName.html">QName</a> name)</code><p> Get a the string value of a named attribute of this element. </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.ienumerator(VS.80).aspx">IEnumerator</a></code></td> <td><code><b><a href="#EnumerateAxis(Saxon.Api.XdmAxis)">EnumerateAxis</a></b>(<a href="XdmAxis.html">XdmAxis</a> axis)</code><p> Get an enumerator that supplies all the nodes on one of the XPath axes, starting with this node. </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.ienumerator(VS.80).aspx">IEnumerator</a></code></td> <td><code><b><a href="#EnumerateAxis(Saxon.Api.XdmAxis,Saxon.Api.QName)">EnumerateAxis</a></b>(<a href="XdmAxis.html">XdmAxis</a> axis, <a href="QName.html">QName</a> nodeName)</code><p> Get an enumerator that selects all the nodes on one of the XPath axes, provided they have a given name. The nodes selected are those of the principal node kind (elements for most axes, attributes for the attribute axis, namespace nodes for the namespace axis) whose name matches the name given in the second argument. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#WriteTo(System.Xml.XmlWriter)">WriteTo</a></b>(System.Xml.XmlWriter writer)</code><p> Send the node (that is, the subtree rooted at this node) to an <code>XmlWriter</code> </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="#Equals(object)">Equals</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.object(VS.80).aspx">object</a> obj)</code><p> Two instances of XdmNode are equal if they represent the same node. That is, the Equals() method returns the same result as the XPath "is" operator. </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.int32(VS.80).aspx">int</a></code></td> <td><code><b><a href="#GetHashCode()">GetHashCode</a></b>()</code><p> The hashCode of a node reflects the equality relationship: if two XdmNode instances represent the same node, then they have the same hashCode </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.string(VS.80).aspx">String</a></code></td> <td><code><b><a href="#ToString()">ToString</a></b>()</code><p> Return a string representation of the node. </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="NodeName"></a><h3>NodeName</h3><pre>public <a href="QName.html">QName</a> <b>NodeName</b> {get; }</pre><dl> <dd> <p> The name of the node, as a <code>QName</code>. Returns null in the case of unnamed nodes. </p> </dd> </dl> <hr><a name="NodeKind"></a><h3>NodeKind</h3><pre>public XmlNodeType <b>NodeKind</b> {get; }</pre><dl> <dd> <p> The kind of node, as an instance of <code>System.Xml.XmlNodeType</code>. </p> <p>For a namespace node in the XDM model, the value XmlNodeType.None is returned. </p> </dd> </dl> <hr><a name="TypedValue"></a><h3>TypedValue</h3><pre>public <a href="XdmValue.html">XdmValue</a> <b>TypedValue</b> {get; }</pre><dl> <dd> <p> The typed value of the node, as an instance of <code>XdmValue</code>. </p> </dd> </dl> <hr><a name="StringValue"></a><h3>StringValue</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a> <b>StringValue</b> {get; }</pre><dl> <dd> <p> The string value of the node. </p> </dd> </dl> <hr><a name="Parent"></a><h3>Parent</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Parent</b> {get; }</pre><dl> <dd> <p> Get the parent of this node. </p> <p> Returns either a document node, and element node, or null in the case where this node has no parent. </p> </dd> </dl> <hr><a name="Root"></a><h3>Root</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>Root</b> {get; }</pre><dl> <dd> <p> Get the root of the tree containing this node. </p> <p> Returns the root of the tree containing this node (which might be this node itself). </p> </dd> </dl> <hr><a name="BaseUri"></a><h3>BaseUri</h3><pre>public Uri <b>BaseUri</b> {get; }</pre><dl> <dd> <p> The Base URI of the node. </p> </dd> </dl> <hr><a name="DocumentUri"></a><h3>DocumentUri</h3><pre>public Uri <b>DocumentUri</b> {get; }</pre><dl> <dd> <p> The Document URI of the node. </p> </dd> </dl> <hr><a name="OuterXml"></a><h3>OuterXml</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a> <b>OuterXml</b> {get; }</pre><dl> <dd> <p> Return a serialization of this node as lexical XML </p> <p>In the case of an element node, the result will be a well-formed XML document serialized as defined in the W3C XSLT/XQuery serialization specification, using options method="xml", indent="yes", omit-xml-declaration="yes". </p> <p>In the case of a document node, the result will be a well-formed XML document provided that the document node contains exactly one element child, and no text node children. In other cases it will be a well-formed external general parsed entity. </p> <p>In the case of an attribute node, the output is a string in the form <code>name="value"</code>. The name will use the original namespace prefix. </p> <p>Other nodes, such as text nodes, comments, and processing instructions, are represented as they would appear in lexical XML. </p> </dd> </dl> <hr><a name="Implementation"></a><h3>Implementation</h3><pre>public NodeInfo <b>Implementation</b> {get; }</pre><dl> <dd> <p> Escape hatch to the underlying class in the Java implementation </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="IsAtomic()"></a><h3>IsAtomic</h3><pre>public override <a href="http://msdn.microsoft.com/en-us/library/system.boolean(VS.80).aspx">bool</a> <b>IsAtomic</b>()</pre><dl> <dd> <p> Determine whether the item is an atomic value </p> <dl> <dt>returns</dt> <dd> false (the item is not an atomic value) </dd> </dl> </dd> </dl> <hr><a name="GetAttributeValue(Saxon.Api.QName)"></a><h3>GetAttributeValue</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a> <b>GetAttributeValue</b>(<a href="QName.html">QName</a> name)</pre><dl> <dd> <p> Get a the string value of a named attribute of this element. </p> <p> Returns null if this node is not an element, or if this element has no attribute with the specified name. </p><b>Parameters:</b><dl> <dt><code>name</code> - </dt> <dd>The name of the attribute whose value is required</dd> </dl> </dd> </dl> <hr><a name="EnumerateAxis(Saxon.Api.XdmAxis)"></a><h3>EnumerateAxis</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator(VS.80).aspx">IEnumerator</a> <b>EnumerateAxis</b>(<a href="XdmAxis.html">XdmAxis</a> axis)</pre><dl> <dd> <p> Get an enumerator that supplies all the nodes on one of the XPath axes, starting with this node. </p> <p> The nodes are returned in axis order: that is, document order for a forwards axis, reverse document order for a reverse axis. </p><b>Parameters:</b><dl> <dt><code>axis</code> - </dt> <dd> The axis to be navigated, for example <code>XdmAxis.Child</code> for the child axis. </dd> </dl> </dd> </dl> <hr><a name="EnumerateAxis(Saxon.Api.XdmAxis,Saxon.Api.QName)"></a><h3>EnumerateAxis</h3><pre>public <a href="http://msdn.microsoft.com/en-us/library/system.collections.ienumerator(VS.80).aspx">IEnumerator</a> <b>EnumerateAxis</b>(<a href="XdmAxis.html">XdmAxis</a> axis, <a href="QName.html">QName</a> nodeName)</pre><dl> <dd> <p> Get an enumerator that selects all the nodes on one of the XPath axes, provided they have a given name. The nodes selected are those of the principal node kind (elements for most axes, attributes for the attribute axis, namespace nodes for the namespace axis) whose name matches the name given in the second argument. </p> <p> The nodes are returned in axis order: that is, document order for a forwards axis, reverse document order for a reverse axis. </p><b>Parameters:</b><dl> <dt><code>axis</code> - </dt> <dd> The axis to be navigated, for example <code>XdmAxis.Child</code> for the child axis. </dd> </dl> <dl> <dt><code>nodeName</code> - </dt> <dd> The name of the required nodes, for example <code>new QName("", "item")</code> to select nodes with local name "item", in no namespace. </dd> </dl> </dd> </dl> <hr><a name="WriteTo(System.Xml.XmlWriter)"></a><h3>WriteTo</h3><pre>public void <b>WriteTo</b>(System.Xml.XmlWriter writer)</pre><dl> <dd> <p> Send the node (that is, the subtree rooted at this node) to an <code>XmlWriter</code> </p> <p> Note that a <code>XmlWriter</code> can only handle a well-formed XML document. This method will therefore signal an exception if the node is a document node with no children, or with more than one element child. </p><b>Parameters:</b><dl> <dt><code>writer</code> - </dt> <dd> The <code>XmlWriter</code> to which the node is to be written </dd> </dl> </dd> </dl> <hr><a name="Equals(object)"></a><h3>Equals</h3><pre>public override <a href="http://msdn.microsoft.com/en-us/library/system.boolean(VS.80).aspx">bool</a> <b>Equals</b>(<a href="http://msdn.microsoft.com/en-us/library/system.object(VS.80).aspx">object</a> obj)</pre><dl> <dd> <p> Two instances of XdmNode are equal if they represent the same node. That is, the Equals() method returns the same result as the XPath "is" operator. </p><b>Parameters:</b><dl> <dt><code>obj</code> - </dt> <dd>The object node to be compared</dd> </dl> </dd> </dl> <hr><a name="GetHashCode()"></a><h3>GetHashCode</h3><pre>public override <a href="http://msdn.microsoft.com/en-us/library/system.int32(VS.80).aspx">int</a> <b>GetHashCode</b>()</pre><dl> <dd> <p> The hashCode of a node reflects the equality relationship: if two XdmNode instances represent the same node, then they have the same hashCode </p> </dd> </dl> <hr><a name="ToString()"></a><h3>ToString</h3><pre>public override <a href="http://msdn.microsoft.com/en-us/library/system.string(VS.80).aspx">String</a> <b>ToString</b>()</pre><dl> <dd> <p> Return a string representation of the node. </p> <p> This currently returns the same as the <code>OuterXml</code> property. To get the string value as defined in XPath, use the <code>StringValue</code> property. </p> </dd> </dl> <hr> </div> </body> </html>