Sdílet prostřednictvím


INode Interface

Definition

The Node interface is the primary datatype for the entire Document Object Model.

[Android.Runtime.Register("org/w3c/dom/Node", "", "Org.W3c.Dom.INodeInvoker")]
public interface INode : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("org/w3c/dom/Node", "", "Org.W3c.Dom.INodeInvoker")>]
type INode = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.

The attributes nodeName, nodeValue and attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (e.g., nodeValue for an Element or attributes for a Comment ), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.

The values of nodeName, nodeValue, and attributes vary according to the node type as follows: <table border='1' cellpadding='3'> <tr> <th>Interface</th> <th>nodeName</th> <th>nodeValue</th> <th>attributes</th> </tr> <tr> <td valign='top' rowspan='1' colspan='1'> Attr</td> <td valign='top' rowspan='1' colspan='1'>same as Attr.name</td> <td valign='top' rowspan='1' colspan='1'>same as Attr.value</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>CDATASection</td> <td valign='top' rowspan='1' colspan='1'> "#cdata-section"</td> <td valign='top' rowspan='1' colspan='1'>same as CharacterData.data, the content of the CDATA Section</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Comment</td> <td valign='top' rowspan='1' colspan='1'> "#comment"</td> <td valign='top' rowspan='1' colspan='1'>same as CharacterData.data, the content of the comment</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Document</td> <td valign='top' rowspan='1' colspan='1'> "#document"</td> <td valign='top' rowspan='1' colspan='1'>null</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'> DocumentFragment</td> <td valign='top' rowspan='1' colspan='1'>"#document-fragment"</td> <td valign='top' rowspan='1' colspan='1'> null</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>DocumentType</td> <td valign='top' rowspan='1' colspan='1'>same as DocumentType.name</td> <td valign='top' rowspan='1' colspan='1'>null</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'> Element</td> <td valign='top' rowspan='1' colspan='1'>same as Element.tagName</td> <td valign='top' rowspan='1' colspan='1'>null</td> <td valign='top' rowspan='1' colspan='1'> NamedNodeMap</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Entity</td> <td valign='top' rowspan='1' colspan='1'>entity name</td> <td valign='top' rowspan='1' colspan='1'>null</td> <td valign='top' rowspan='1' colspan='1'> null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>EntityReference</td> <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td> <td valign='top' rowspan='1' colspan='1'> null</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Notation</td> <td valign='top' rowspan='1' colspan='1'>notation name</td> <td valign='top' rowspan='1' colspan='1'> null</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>ProcessingInstruction</td> <td valign='top' rowspan='1' colspan='1'>same as ProcessingInstruction.target</td> <td valign='top' rowspan='1' colspan='1'>same as ProcessingInstruction.data</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> <tr> <td valign='top' rowspan='1' colspan='1'>Text</td> <td valign='top' rowspan='1' colspan='1'> "#text"</td> <td valign='top' rowspan='1' colspan='1'>same as CharacterData.data, the content of the text node</td> <td valign='top' rowspan='1' colspan='1'>null</td> </tr> </table>

See also the Document Object Model (DOM) Level 3 Core Specification.

Java documentation for org.w3c.dom.Node.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Fields

AttributeNode

The node is an Attr.

CdataSectionNode

The node is a CDATASection.

CommentNode

The node is a Comment.

DocumentFragmentNode

The node is a DocumentFragment.

DocumentNode

The node is a Document.

DocumentPositionContainedBy

The node is contained by the reference node.

DocumentPositionContains

The node contains the reference node.

DocumentPositionDisconnected

The two nodes are disconnected.

DocumentPositionFollowing

The node follows the reference node.

DocumentPositionImplementationSpecific

The determination of preceding versus following is implementation-specific.

DocumentPositionPreceding

The second node precedes the reference node.

DocumentTypeNode

The node is a DocumentType.

ElementNode

The node is an Element.

EntityNode

The node is an Entity.

EntityReferenceNode

The node is an EntityReference.

NotationNode

The node is a Notation.

ProcessingInstructionNode

The node is a ProcessingInstruction.

TextNode

The node is a Text node.

Properties

Attributes

A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.

BaseURI

The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.

ChildNodes

A NodeList that contains all children of this node.

FirstChild

The first child of this node.

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
HasAttributes

Returns whether this node (if it is an element) has any attributes.

HasChildNodes

Returns whether this node has any children.

JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
LastChild

The last child of this node.

LocalName

Returns the local part of the qualified name of this node.

NamespaceURI

The namespace URI of this node, or null if it is unspecified (see ).

NextSibling

The node immediately following this node.

NodeName

The name of this node, depending on its type; see the table above.

NodeType

A code representing the type of the underlying object, as defined above.

NodeValue

The value of this node, depending on its type; see the table above.

OwnerDocument

The Document object associated with this node.

ParentNode

The parent of this node.

PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)
Prefix

The namespace prefix of this node, or null if it is unspecified.

PreviousSibling

The node immediately preceding this node.

TextContent

This attribute returns the text content of this node and its descendants.

Methods

AppendChild(INode)

Adds the node newChild to the end of the list of children of this node.

CloneNode(Boolean)

Returns a duplicate of this node, i.

CompareDocumentPosition(INode)

Compares the reference node, i.

Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
GetFeature(String, String)

This method returns a specialized object which implements the specialized APIs of the specified feature and version, as specified in .

GetUserData(String)

Retrieves the object associated to a key on a this node.

InsertBefore(INode, INode)

Inserts the node newChild before the existing child node refChild.

IsDefaultNamespace(String)

This method checks if the specified namespaceURI is the default namespace or not.

IsEqualNode(INode)

Tests whether two nodes are equal.

IsSameNode(INode)

Returns whether this node is the same node as the given one.

IsSupported(String, String)

Tests whether the DOM implementation implements a specific feature and that feature is supported by this node, as specified in .

LookupNamespaceURI(String)

Look up the namespace URI associated to the given prefix, starting from this node.

LookupPrefix(String)

Look up the prefix associated to the given namespace URI, starting from this node.

Normalize()

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.

RemoveChild(INode)

Removes the child node indicated by oldChild from the list of children, and returns it.

ReplaceChild(INode, INode)

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.

SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
SetUserData(String, Object, IUserDataHandler)

Associate an object to a key on this node.

UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to