artefaktur
software engineer &        architecture

 
 
 
 

class XMLNode

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::xml::dom::XMLNode Class Reference

#include <XMLNode.h>

Inheritance diagram for acdk::xml::dom::XMLNode:

acdk::lang::Object org::w3c::dom::Node acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::xml::dom::XMLAttr acdk::xml::dom::XMLCharacterData acdk::xml::dom::XMLDocument acdk::xml::dom::XMLElement acdk::xml::dom::XMLComment acdk::xml::dom::XMLText acdk::xml::dom::XMLCDATASection List of all members.

Detailed Description

API: org.w3c.dom<br>.

Author:
Roger Rene Kommer
Version:
Revision
1.14
Date:
Date
2005/02/05 10:45:36


Public Member Functions

 XMLNode (IN(RString) name, short type)
 ~XMLNode ()
RString toXML ()
 dom4j like extension

virtual RString getNodeName ()
 The name of this node, depending on its type; see the table above.

virtual acdk::lang::RString getNamespaceURI ()
 The namespace URI of this node, or null if it is unspecified (see ).

virtual acdk::lang::RString getLocalName ()
 Returns the local part of the qualified name of this node.

virtual acdk::lang::RString getBaseURI ()
 The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI.

virtual acdk::lang::RString getPrefix ()
 The namespace prefix of this node, or null if it is unspecified.

virtual void setPrefix (IN(acdk::lang::RString) prefix) throw ( RDOMException )
 The namespace prefix of this node, or null if it is unspecified.

virtual RString getNodeValue () throw ( RDOMException )
 The value of this node, depending on its type; see the table above.

virtual void setNodeValue (IN(RString) s) throw ( RDOMException )
virtual short getNodeType ()
 A code representing the type of the underlying object, as defined above.

virtual RNode getParentNode ()
 The parent of this node.

void setParentNode (IN(RNode) p)
virtual RNodeList getChildNodes ()
 A NodeList that contains all children of this node.

virtual RNode getFirstChild ()
 The first child of this node.

virtual RNode getLastChild ()
 The last child of this node.

virtual RNode getPreviousSibling ()
 The node immediately preceding this node.

virtual RNode getNextSibling ()
 The node immediately following this node.

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

virtual RDocument getOwnerDocument ()
 The Document object associated with this node.

virtual RNode insertBefore (IN(RNode) newChild, IN(RNode) refChild) throw ( RDOMException )
 Inserts the node newChild before the existing child node refChild.

virtual RNode replaceChild (IN(RNode) newChild, IN(RNode) oldChild) throw ( RDOMException )
 Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.

virtual RNode removeChild (IN(RNode) node) throw ( RDOMException )
 Removes the child node indicated by oldChild from the list of children, and returns it.

virtual RNode appendChild (IN(RNode) node) throw ( RDOMException )
 Adds the node newChild to the end of the list of children of this node.

virtual bool hasChildNodes ()
 Returns whether this node has any children.

virtual RNode cloneNode (bool flag)
 Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.

virtual RNode selectNode (IN(RString) xpath)
virtual RNodeList selectNodes (IN(RString) xpath)
RString _childsToString ()
virtual bool isEqualNode (IN(org::w3c::dom::RNode) arg)

Protected Attributes

RString _name
RString _value
short _nodeType
RNode _parent
acdk::lang::ref::SharedOwning _sharedRefs
RXMLNodeArray _childs

Constructor & Destructor Documentation

acdk::xml::dom::XMLNode::XMLNode IN(RString name,
short  type
[inline]
 

acdk::xml::dom::XMLNode::~XMLNode  ) 
 


Member Function Documentation

RString acdk::xml::dom::XMLNode::_childsToString  )  [inline]
 

virtual RNode acdk::xml::dom::XMLNode::appendChild IN(RNode node  )  throw ( RDOMException ) [virtual]
 

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

If the newChild is already in the tree, it is first removed.

Parameters:
newChild The node to add.If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node
Returns:
The node added.
Exceptions:
DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to append a second DocumentType or Element node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the previous parent of the node being inserted is readonly.
NOT_SUPPORTED_ERR: if the newChild node is a child of the Document node, this exception might be raised if the DOM implementation doesn't support the removal of the DocumentType child or Element child.
Version:
DOM Level 3

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::cloneNode bool  flag  )  [virtual]
 

Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.

The duplicate node has no parent ( parentNode is null) and no user data. User data associated to the imported node is not carried over. However, if any UserDataHandlers has been specified along with the associated data these handlers will be called with the appropriate parameters before this method returns.
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any children it contains unless it is a deep clone. This includes text contained in an the Element since the text is contained in a child Text node. Cloning an Attr directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute (specified is true). Cloning an Attr always clones its children, since they represent its value, no matter whether this is a deep clone or not. Cloning an EntityReference automatically constructs its subtree if a corresponding Entity is available, no matter whether this is a deep clone or not. Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly . In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.

Parameters:
deep If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.

Implements org::w3c::dom::Node.

virtual RNamedNodeMap acdk::xml::dom::XMLNode::getAttributes  )  [inline, virtual]
 

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

Implements org::w3c::dom::Node.

Reimplemented in acdk::xml::dom::XMLElement.

virtual acdk::lang::RString acdk::xml::dom::XMLNode::getBaseURI  )  [inline, virtual]
 

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

This value is computed as described in . However, when the Document supports the feature HTML [DOM Level 2 HTML] , the base URI is computed using first the value of the href attribute of the HTML BASE element if any, and the value of the documentURI attribute from the Document interface otherwise.

Since:
DOM Level 3

Implements org::w3c::dom::Node.

virtual RNodeList acdk::xml::dom::XMLNode::getChildNodes  )  [virtual]
 

A NodeList that contains all children of this node.

If there are no children, this is a NodeList containing no nodes.

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::getFirstChild  )  [inline, virtual]
 

The first child of this node.

If there is no such node, this returns null.

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::getLastChild  )  [inline, virtual]
 

The last child of this node.

If there is no such node, this returns null.

Implements org::w3c::dom::Node.

virtual acdk::lang::RString acdk::xml::dom::XMLNode::getLocalName  )  [inline, virtual]
 

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


For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as Document.createElement(), this is always null.

Since:
DOM Level 2

Implements org::w3c::dom::Node.

virtual acdk::lang::RString acdk::xml::dom::XMLNode::getNamespaceURI  )  [inline, virtual]
 

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


This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as Document.createElement(), this is always null. <p >Note: Per the Namespaces in XML Specification [XML Namespaces] an attribute does not inherit its namespace from the element it is attached to. If an attribute is not explicitly given a namespace, it simply has no namespace.

Since:
DOM Level 2

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::getNextSibling  )  [virtual]
 

The node immediately following this node.

If there is no such node, this returns null.

Implements org::w3c::dom::Node.

virtual RString acdk::xml::dom::XMLNode::getNodeName  )  [inline, virtual]
 

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

Implements org::w3c::dom::Node.

virtual short acdk::xml::dom::XMLNode::getNodeType  )  [inline, virtual]
 

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

Implements org::w3c::dom::Node.

virtual RString acdk::xml::dom::XMLNode::getNodeValue  )  throw ( RDOMException ) [virtual]
 

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

When it is defined to be null, setting it has no effect, including if the node is read-only.

Exceptions:
DOMException DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

Implements org::w3c::dom::Node.

Reimplemented in acdk::xml::dom::XMLCharacterData.

virtual RDocument acdk::xml::dom::XMLNode::getOwnerDocument  )  [inline, virtual]
 

The Document object associated with this node.

This is also the Document object used to create new nodes. When this node is a Document or a DocumentType which is not used with any Document yet, this is null.

Version:
DOM Level 2

Implements org::w3c::dom::Node.

Reimplemented in acdk::xml::dom::XMLDocument, and acdk::xml::dom::XMLElement.

virtual RNode acdk::xml::dom::XMLNode::getParentNode  )  [inline, virtual]
 

The parent of this node.

All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may have a parent. However, if a node has just been created and not yet added to the tree, or if it has been removed from the tree, this is null.

Implements org::w3c::dom::Node.

virtual acdk::lang::RString acdk::xml::dom::XMLNode::getPrefix  )  [inline, virtual]
 

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

When it is defined to be null, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
Setting the prefix to null makes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

Since:
DOM Level 2

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::getPreviousSibling  )  [virtual]
 

The node immediately preceding this node.

If there is no such node, this returns null.

Implements org::w3c::dom::Node.

virtual bool acdk::xml::dom::XMLNode::hasChildNodes  )  [inline, virtual]
 

Returns whether this node has any children.

Returns:
Returns true if this node has any children, false otherwise.

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::insertBefore IN(RNode newChild,
IN(RNode refChild
throw ( RDOMException ) [virtual]
 

Inserts the node newChild before the existing child node refChild.

If refChild is null, insert newChild at the end of the list of children.
If newChild is a DocumentFragment object, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed. <p >Note: Inserting a node before itself is implementation dependent.

Parameters:
newChild The node to insert.
refChild The reference node, i.e., the node before which the new node must be inserted.
Returns:
The node being inserted.
Exceptions:
DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to insert a second DocumentType or Element node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the insertion of a DocumentType or Element node.
Version:
DOM Level 3

Implements org::w3c::dom::Node.

virtual bool acdk::xml::dom::XMLNode::isEqualNode IN(org::w3c::dom::RNode arg  )  [virtual]
 

virtual RNode acdk::xml::dom::XMLNode::removeChild IN(RNode node  )  throw ( RDOMException ) [virtual]
 

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

Parameters:
oldChild The node being removed.
Returns:
The node removed.
Exceptions:
DOMException NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the removal of the DocumentType child or the Element child.
Version:
DOM Level 3

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::replaceChild IN(RNode newChild,
IN(RNode oldChild
throw ( RDOMException ) [virtual]
 

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


If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed. <p >Note: Replacing a node with itself is implementation dependent.

Parameters:
newChild The new node to put in the child list.
oldChild The node being replaced in the list.
Returns:
The node replaced.
Exceptions:
DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself, or if this node is of type Document and the result of the replacement operation would add a second DocumentType or Element on the Document node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of the new node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the replacement of the DocumentType child or Element child.
Version:
DOM Level 3

Implements org::w3c::dom::Node.

virtual RNode acdk::xml::dom::XMLNode::selectNode IN(RString xpath  )  [virtual]
 

virtual RNodeList acdk::xml::dom::XMLNode::selectNodes IN(RString xpath  )  [virtual]
 

virtual void acdk::xml::dom::XMLNode::setNodeValue IN(RString s  )  throw ( RDOMException ) [virtual]
 

void acdk::xml::dom::XMLNode::setParentNode IN(RNode p  )  [inline]
 

virtual void acdk::xml::dom::XMLNode::setPrefix IN(acdk::lang::RString prefix  )  throw ( RDOMException ) [inline, virtual]
 

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

When it is defined to be null, setting it has no effect, including if the node is read-only.
Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
Setting the prefix to null makes it unspecified, setting it to an empty string is implementation dependent.
Note also that changing the prefix of an attribute that is known to have a default value, does not make a new attribute with the default value and the original prefix appear, since the namespaceURI and localName do not change.
For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null.

Exceptions:
DOMException INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character according to the XML version in use specified in the Document.xmlVersion attribute.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is null, if the specified prefix is xml and the namespaceURI of this node is different from http://www.w3.org/XML/1998/namespace, if this node is an attribute and the specified prefix is xmlns and the namespaceURI of this node is different from <a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>, or if this node is an attribute and the qualifiedName of this node is xmlns [XML Namespaces]
Since:
DOM Level 2

Implements org::w3c::dom::Node.

RString acdk::xml::dom::XMLNode::toXML  )  [virtual]
 

dom4j like extension

Todo:
implement in derived interfaces

Reimplemented from org::w3c::dom::Node.

Reimplemented in acdk::xml::dom::XMLCDATASection, acdk::xml::dom::XMLCharacterData, acdk::xml::dom::XMLComment, acdk::xml::dom::XMLDocument, acdk::xml::dom::XMLElement, and acdk::xml::dom::XMLText.


Member Data Documentation

RXMLNodeArray acdk::xml::dom::XMLNode::_childs [protected]
 

RString acdk::xml::dom::XMLNode::_name [protected]
 

Reimplemented in acdk::xml::dom::XMLAttr.

short acdk::xml::dom::XMLNode::_nodeType [protected]
 

RNode acdk::xml::dom::XMLNode::_parent [protected]
 

acdk::lang::ref::SharedOwning acdk::xml::dom::XMLNode::_sharedRefs [protected]
 

RString acdk::xml::dom::XMLNode::_value [protected]
 

Reimplemented in acdk::xml::dom::XMLAttr.

 
Last modified 2005-05-08 18:34 by SYSTEM By Artefaktur, Ing. Bureau Kommer