Node

Overview

Node is a class in Aspose.Words FOSS for .NET.

Base class for all nodes of a Word document.

This class provides 12 methods for working with Node objects in .NET programs. Available methods include: Accept, Clone, GetAncestor, GetAncestorOf, GetText, NextPreOrder, NodeTypeToString, PreviousPreOrder, Remove, ToString. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package. Properties: CustomNodeId, Document, IsComposite, NextSibling, NodeType, ParentNode, and 2 more.

Properties

NameTypeAccessDescription
NodeTypeNodeTypeReadGets the type of this node.
ParentNodeCompositeNodeReadGets the immediate parent of this node.
DocumentDocumentBaseReadGets the document to which this node belongs.
PreviousSiblingNodeReadGets the node immediately preceding this node.
NextSiblingNodeReadGets the node immediately following this node.
IsCompositeboolReadReturns true if this node can contain other nodes.
RangeRangeReadReturns a Range object that represents the portion of a document that is contained in this node.
CustomNodeIdintRead/WriteSpecifies custom node identifier.

Methods

SignatureDescription
Clone(isCloneChildren: bool)You should use the Clone(bool, INodeCloningListener) overload when the node cloning is a part of another (usually composite) node cloning process.
Accept(visitor: DocumentVisitor)Calls Accept(visitor) on this Node instance.
GetText()Gets the text of this node and of all its children.
GetAncestor(ancestorType: Type)Gets the first ancestor of the specified object type.
GetAncestorOf()Calls GetAncestorOf on this Node instance.
GetAncestor(ancestorType: NodeType)Gets the first ancestor of the specified NodeType.
Remove()Removes itself from the parent.
NextPreOrder(rootNode: Node)Gets next node according to the pre-order tree traversal algorithm.
PreviousPreOrder(rootNode: Node)Gets the previous node according to the pre-order tree traversal algorithm.
ToString(saveFormat: SaveFormat)Exports the content of the node into a string in the specified format.
ToString(saveOptions: SaveOptions)Exports the content of the node into a string using the specified save options.
NodeTypeToString(nodeType: NodeType)A utility method that converts a node type enum value into a user friendly string.

See Also