Aspose.Words represents a document as a tree of nodes. An integral feature of the tree is the ability to navigate between the nodes. This section shows how to explore and navigate the document tree in Aspose.Words.
When the sample fax document presented earlier is opened in DocumentExplorer (it is a demo project shipped with Aspose.Words), it shows the tree of nodes exactly as it is represented in Aspose.Words:
The nodes in the tree are said to have relationships between them. A node that contains another node is a parent and the contained node is a child. Children of the same parent are sibling nodes. The Document node is always the root node.
The nodes that can contain other nodes derive from the CompositeNode class and all nodes ultimately derive from the Node class. The two base classes provide common methods and properties to navigate and modify the tree structure.
The following UML class diagram shows the classes and methods we are going to explore in the remainder of this topic:
The UML object diagram below shows several nodes of the fax sample document and how they are connected to each other via the parent, child and sibling properties: