INode
Definition
Namespace:Telerik.Windows.Documents.FormatProviders.Html.Parsing.Dom
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public interface INode
Properties
A
<pre><code class="lang-csharp">NamedNodeMap</code></pre>
containing the attributes of this node (if it is an
<pre><code class="lang-csharp">Element</code></pre>
) or
<pre><code class="lang-csharp">null</code></pre>
otherwise.
INamedNodeMap Attributes { get; }
A
<pre><code class="lang-csharp">NodeList</code></pre>
that contains all children of this node. If there are no children, this is a
<pre><code class="lang-csharp">NodeList</code></pre>
containing no nodes.
INodeList ChildNodes { get; }
The first child of this node. If there is no such node, this returns
<pre><code class="lang-csharp">null</code></pre>
.
INode FirstChild { get; }
The last child of this node. If there is no such node, this returns
<pre><code class="lang-csharp">null</code></pre>
.
INode LastChild { get; }
string NamespaceURI { get; }
The node immediately following this node. If there is no such node, this returns
<pre><code class="lang-csharp">null</code></pre>
.
INode NextSibling { get; }
The name of this node, depending on its type; see the table above.
string NodeName { get; }
A code representing the type of the underlying object, as defined above.
NodeType NodeType { get; }
The value of this node, depending on its type; see the table above. When it is defined to be
<pre><code class="lang-csharp">null</code></pre>
, setting it has no effect.
string NodeValue { get; set; }
NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
DOMSTRING_SIZE_ERR: Raised when it would return more characters than
fit in a
<pre><code class="lang-csharp">DOMString</code></pre>
variable on the implementation platform.
The
<pre><code class="lang-csharp">Document</code></pre>
object associated with this node. This is also the
<pre><code class="lang-csharp">Document</code></pre>
object used to create new nodes. When this node is a
<pre><code class="lang-csharp">Document</code></pre>
or a
DocumentType
which is not used with any
<pre><code class="lang-csharp">Document</code></pre>
yet, this is
<pre><code class="lang-csharp">null</code></pre>
.
IDocument OwnerDocument { get; }
The parent of this node. All nodes, except
<pre><code class="lang-csharp">Attr</code></pre>
,
<pre><code class="lang-csharp">Document</code></pre>
,
<pre><code class="lang-csharp">DocumentFragment</code></pre>
,
<pre><code class="lang-csharp">Entity</code></pre>
, and
<pre><code class="lang-csharp">Notation</code></pre>
may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is
<pre><code class="lang-csharp">null</code></pre>
.
INode ParentNode { get; }
The node immediately preceding this node. If there is no such node, this returns
<pre><code class="lang-csharp">null</code></pre>
.
INode PreviousSibling { get; }
Methods
Adds the node
<pre><code class="lang-csharp">newChild</code></pre>
to the end of the list of children of this node. If the
<pre><code class="lang-csharp">newChild</code></pre>
is already in the tree, it is first removed.
INode AppendChild(INode newChild)
The node added.
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the
<pre><code class="lang-csharp">newChild</code></pre>
node, or if
the node to append is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if
<pre><code class="lang-csharp">newChild</code></pre>
was created
from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
Returns whether this node (if it is an element) has any attributes.
bool HasAttributes()
true
if this node has any attributes,
<pre><code class="lang-csharp">false</code></pre>
otherwise.
Returns whether this node has any children.
bool HasChildNodes()
true
if this node has any children,
<pre><code class="lang-csharp">false</code></pre>
otherwise.
Inserts the node
<pre><code class="lang-csharp">newChild</code></pre>
before the existing child node
<pre><code class="lang-csharp">refChild</code></pre>
. If
<pre><code class="lang-csharp">refChild</code></pre>
is
null
, insert
<pre><code class="lang-csharp">newChild</code></pre>
at the end of the list of children.
If
<pre><code class="lang-csharp">newChild</code></pre>
is a
DocumentFragment
object, all of its children are inserted, in the same order, before
<pre><code class="lang-csharp">refChild</code></pre>
. If the
<pre><code class="lang-csharp">newChild</code></pre>
is already in the tree, it is first removed.
INode InsertBefore(INode newChild, INode refChild)
The node being inserted.
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the
<pre><code class="lang-csharp">newChild</code></pre>
node, or if
the node to insert is one of this node's ancestors.
WRONG_DOCUMENT_ERR: Raised if
<pre><code class="lang-csharp">newChild</code></pre>
was created
from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if
<pre><code class="lang-csharp">refChild</code></pre>
is not a child of this node.
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
Puts all
<pre><code class="lang-csharp">Text</code></pre>
nodes in the full depth of the sub-tree underneath this
<pre><code class="lang-csharp">Node</code></pre>
, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates
<pre><code class="lang-csharp">Text</code></pre>
nodes, i.e., there are neither adjacent
<pre><code class="lang-csharp">Text</code></pre>
nodes nor empty
Text
nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.In cases where the document contains
<pre><code class="lang-csharp">CDATASections</code></pre>
, the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
<pre><code class="lang-csharp">Text</code></pre>
nodes and
CDATASection
nodes.
void Normalize()
Removes the child node indicated by
<pre><code class="lang-csharp">oldChild</code></pre>
from the list of children, and returns it.
INode RemoveChild(INode oldChild)
The node removed.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
<br />NOT_FOUND_ERR: Raised if
<pre><code class="lang-csharp">oldChild</code></pre>
is not a child of this node.