library: libXMLParser #include "TXMLNode.h"

# TXMLNode

class description - source file - inheritance tree (.pdf)

## class TXMLNode : public TObject

| Inheritance Chart:
`TObject`
| <- | `TXMLNode` |

        public:

                                    TXMLNode(_xmlNode* node)
                                    TXMLNode(const TXMLNode&)
                            virtual ~TXMLNode()
                     static TClass* Class()
                             TList* GetAttributes() const
                          TXMLNode* GetChildren() const
                        const char* GetContent() const
                        const char* GetNamespaceHref() const
                        const char* GetNamespacePrefix() const
                          TXMLNode* GetNextNode() const
                        const char* GetNodeName() const
          TXMLNode::EXMLElementType GetNodeType() const
                          TXMLNode* GetParent() const
                          TXMLNode* GetPreviousNode() const
                        const char* GetText() const
                             Bool_t HasAttributes() const
                             Bool_t HasChildren() const
                             Bool_t HasNextNode() const
                             Bool_t HasParent() const
                             Bool_t HasPreviousNode() const
                    virtual TClass* IsA() const
                          TXMLNode& operator=(const TXMLNode&)
                       virtual void ShowMembers(TMemberInspector& insp, char* parent)
                       virtual void Streamer(TBuffer& b)
                               void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          _xmlNode* fXMLNode  libxml node

        public:

          static const TXMLNode::EXMLElementType kXMLElementNode
          static const TXMLNode::EXMLElementType kXMLAttributeNode
          static const TXMLNode::EXMLElementType kXMLTextNode
          static const TXMLNode::EXMLElementType kXMLCommentNode

## Class Description

     TXMLNode

     TXMLNode contains a pointer to xmlNode, which is a node under the
     DOM tree. A node can be an Element, an Attribute, a Text Node
     or a Comment Node.
     One can navigate the DOM tree by accessing the siblings and
     parent or child nodes. Also retriving the Attribute or the Text in
     an Element node.

TXMLNode(xmlNode *node) : fXMLNode(node)

     TXMLNode constructor.

~TXMLNode()

     Destructor. It releases the xml node.

const char* GetNodeName() const

     Returns the node's name.

TXMLNode* GetChildren() const

     Returns the node's child if any, returns 0 if no child.

TXMLNode* GetParent() const

     Returns the node's parent if any, returns 0 if no parent.

const char* GetContent() const

     Returns the content if any, or 0.

TList* GetAttributes() const

     Returns a list of node's attribute if any,
     returns 0 if no attribute.

TXMLNode* GetNextNode() const

     Returns the next sibling XMLNode in the DOM tree, if any
     return 0 if no previous node.

TXMLNode* GetPreviousNode() const

     Returns the previous sibling XMLNode in the DOM tree, if any
     return 0 if no previous node

const char* GetText() const

     Returns the content of a Text node if node is a TextNode, 0 otherwise.

Bool_t HasChildren() const

     Returns true if node has children.

Bool_t HasNextNode() const

     Returns true if has next node.

Bool_t HasParent() const

     Returns true if node has parent.

Bool_t HasPreviousNode() const

     Returns true if has previous node.

Bool_t HasAttributes() const

     Returns true if Element node has attribute.

const char* GetNamespaceHref() const

     Returns the URL for the namespace, or 0 if no namespace.

const char* GetNamespacePrefix() const

     Returns prefix for the namespace, or 0 if no namespace.

### Inline Functions

            TXMLNode::EXMLElementType GetNodeType() const
                              TClass* Class()
                              TClass* IsA() const
                                 void ShowMembers(TMemberInspector& insp, char* parent)
                                 void Streamer(TBuffer& b)
                                 void StreamerNVirtual(TBuffer& b)
                             TXMLNode TXMLNode(const TXMLNode&)
                            TXMLNode& operator=(const TXMLNode&)

Author: Jose Lo 12/4/2005
Last update: root/xmlparser:$Name: $:$Id: TXMLNode.cxx,v 1.1 2005/05/11 13:19:50 rdm Exp $
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *