#include <cxxtools/xml/node.h>

Public Types | |
| enum | Type { Unknown = 0, StartDocument = 1, DocType = 2, EndDocument = 3, StartElement = 4, EndElement = 5, Characters = 6, Comment, ProcessingInstruction } |
Public Member Functions | |
| Node (Type type) | |
| Constructs a new Node object with the specified node type. | |
| virtual | ~Node () |
| Empty destructor. | |
| Type | type () const |
| Returns the type of this Node that can be used to determine what specific Node this object is. | |
| virtual bool | operator== (const Node &node) const |
| Compares this Node object with the given node. | |
| virtual Node * | clone () const =0 |
For every supported node type (except "Unknown") a specialized class exists that is derived from this Node class. Those classes contain more data and access methods to allow the user to determine the information specific to the node, for example the tag name for a StartElement.
This class mainly provides the method type() to determine the type of the Node. The user may use this information to determine to which specialized class that is associated with the type this object can be cast; for the Node::StartElement type the Node object can be cast to StartElement, for example.
| enum Type |
| Unknown | Unknown Node type (may not currently be supported). |
| StartDocument | Xml declaration (see class XmlDeclaration). |
| DocType | Doctype (see class DocType). |
| EndDocument | End of the document (see EndDocument). |
| StartElement | Start element aka opening tag (see StartElement). |
| EndElement | End element aka closing tag (see EndElement). |
| Characters | Parsed content of a tag's body (see Characters). |
| Comment | Comment (see Comment). |
| ProcessingInstruction | Processing instruction (see ProcessingInstruction). |
| Type type | ( | ) | const |
This information may be used to determine to which specialized Node class that is associated with the type, this Node object can be cast; for the Node::StartElement type the Node object can be cast to StartElement, for example.
| virtual bool operator== | ( | const Node & | node | ) | const [virtual] |
The return value of the generic operator== method is always false. Class which derive from this class should always override this method and provide a useful comparison, for example by comparing the node type and contents of the current and given Node object
Reimplemented in Characters, EndElement, and StartElement.