2005/5/9

     
 

class LibXMLNode

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

acdk::xml::libxmldom::LibXMLNode Class Reference

#include <LibXMLNode.h>

Inheritance diagram for acdk::xml::libxmldom::LibXMLNode:

acdk::lang::Object org::w3c::dom::Node acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::xml::libxmldom::LibXMLAttr acdk::xml::libxmldom::LibXMLCharacterData acdk::xml::libxmldom::LibXMLDocument acdk::xml::libxmldom::LibXMLDocumentFragment acdk::xml::libxmldom::LibXMLDocumentType acdk::xml::libxmldom::LibXMLElement acdk::xml::libxmldom::LibXMLEntity acdk::xml::libxmldom::LibXMLEntityReference acdk::xml::libxmldom::LibXMLNotation acdk::xml::libxmldom::LibXMLProcessingInstruction List of all members.

Public Member Functions

 LibXMLNode (xmlNodePtr np, FreeXmlNodePtrFuncPtr freeFuncPtr=0)
 ~LibXMLNode ()
RString getNodeName ()
 The name of this node, depending on its type; see the table above.

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

RString getLocalName ()
 Returns the local part of the qualified name of this node.

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

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

void setPrefix (IN(RString) prefix) throw ( org::w3c::dom::RDOMException )
RString getNodeValue () throw ( org::w3c::dom::RDOMException )
 The value of this node, depending on its type; see the table above.

void setNodeValue (IN(RString) nodeValue) throw ( org::w3c::dom::RDOMException )
short getNodeType ()
 A code representing the type of the underlying object, as defined above.

org::w3c::dom::RNode getParentNode ()
 The parent of this node.

org::w3c::dom::RNodeList getChildNodes ()
 A NodeList that contains all children of this node.

org::w3c::dom::RNode getFirstChild ()
 The first child of this node.

org::w3c::dom::RNode getLastChild ()
 The last child of this node.

org::w3c::dom::RNode getPreviousSibling ()
 The node immediately preceding this node.

org::w3c::dom::RNode getNextSibling ()
 The node immediately following this node.

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

org::w3c::dom::RDocument getOwnerDocument ()
 The Document object associated with this node.

org::w3c::dom::RNode insertBefore (IN(org::w3c::dom::RNode) newChild, IN(org::w3c::dom::RNode) refChild) throw ( org::w3c::dom::RDOMException )
org::w3c::dom::RNode replaceChild (IN(org::w3c::dom::RNode) newChild, IN(org::w3c::dom::RNode) oldChild) throw ( org::w3c::dom::RDOMException )
org::w3c::dom::RNode removeChild (IN(org::w3c::dom::RNode) oldChild) throw ( org::w3c::dom::RDOMException )
org::w3c::dom::RNode appendChild (IN(org::w3c::dom::RNode) newChild) throw ( org::w3c::dom::RDOMException )
bool hasChildNodes ()
 Returns whether this node has any children.

org::w3c::dom::RNode cloneNode (bool deep)
 Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.

void normalize ()
bool isSupported (IN(RString) feature, IN(RString) version)
bool hasAttributes ()
RString lookupPrefix (IN(RString) namespaceURI)
bool isDefaultNamespace (IN(RString) namespaceURI)
RString lookupNamespaceURI (IN(RString) prefix)
virtual bool isEqualNode (IN(org::w3c::dom::RNode) arg)
acdk::lang::Object getUserData (IN(RString) key)
 java 1.5 acdk::lang::Object setUserData(IN(RString) key, IN(RObject) data, IN(RUserDataHandler) handler) {

RString getTextContent () throw ( org::w3c::dom::RDOMException )
 This attribute returns the text content of this node and its descendants.

void setTextContent (IN(RString) textContent) throw ( org::w3c::dom::RDOMException )
RString toString ()
 return a string representation of this object Object::toString() return getName() by default

virtual org::w3c::dom::RNode selectNode (IN(RString) xpath)
virtual org::w3c::dom::RNodeList selectNodes (IN(RString) xpath)
acdk::lang::RString selectText (IN(acdk::lang::RString) xpath)
 select a string.

acdk::lang::RObject selectObject (IN(acdk::lang::RString) xpath)
 may return Node, NodeList, String Boolean or Number

acdk::lang::RBoolean selectBoolean (IN(acdk::lang::RString) xpath)
xmlNodePtr getNodePtr ()
virtual int getChildCount ()
 dom4j like extension return the number of child nodes

void _unshare (FreeXmlNodePtrFuncPtr freeFuncPtr)
RString toXML ()
 dom4j like extension

void write (IN(acdk::io::RWriter) out, int writeFlags=org::w3c::dom::NWFWDefaultFlags, int indentLevel=0, IN(RString) encoding=Nil)

Static Public Member Functions

RLibXMLNode newInstance (xmlDocPtr docPtr, xmlNodePtr nodePtr, int nodeType, bool ownsPtr=false)
RLibXMLNode newInstance (xmlNodePtr nodePtr, bool ownsPtr=false)

Static Protected Member Functions

int _mapLibXMLTypeToDomType (int tp)
int _mapDomTypeToLibXMLType (int tp)

Protected Attributes

XmlNodePtrHolder _nodePtr

Constructor & Destructor Documentation

acdk::xml::libxmldom::LibXMLNode::LibXMLNode xmlNodePtr  np,
FreeXmlNodePtrFuncPtr  freeFuncPtr = 0
 

acdk::xml::libxmldom::LibXMLNode::~LibXMLNode  ) 
 


Member Function Documentation

int acdk::xml::libxmldom::LibXMLNode::_mapDomTypeToLibXMLType int  tp  )  [static, protected]
 

int acdk::xml::libxmldom::LibXMLNode::_mapLibXMLTypeToDomType int  tp  )  [static, protected]
 

void acdk::xml::libxmldom::LibXMLNode::_unshare FreeXmlNodePtrFuncPtr  freeFuncPtr  )  [inline]
 

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::appendChild IN(org::w3c::dom::RNode newChild  )  throw ( org::w3c::dom::RDOMException )
 

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::cloneNode bool  deep  )  [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.

org::w3c::dom::RNamedNodeMap acdk::xml::libxmldom::LibXMLNode::getAttributes  )  [virtual]
 

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

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

RString acdk::xml::libxmldom::LibXMLNode::getBaseURI  )  [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 int acdk::xml::libxmldom::LibXMLNode::getChildCount  )  [virtual]
 

dom4j like extension return the number of child nodes

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

org::w3c::dom::RNodeList acdk::xml::libxmldom::LibXMLNode::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.

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::getFirstChild  )  [virtual]
 

The first child of this node.

If there is no such node, this returns null.

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

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::getLastChild  )  [virtual]
 

The last child of this node.

If there is no such node, this returns null.

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

RString acdk::xml::libxmldom::LibXMLNode::getLocalName  )  [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.

RString acdk::xml::libxmldom::LibXMLNode::getNamespaceURI  )  [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.

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::getNextSibling  )  [virtual]
 

The node immediately following this node.

If there is no such node, this returns null.

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

RString acdk::xml::libxmldom::LibXMLNode::getNodeName  )  [virtual]
 

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

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

xmlNodePtr acdk::xml::libxmldom::LibXMLNode::getNodePtr  )  [inline]
 

short acdk::xml::libxmldom::LibXMLNode::getNodeType  )  [virtual]
 

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

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

RString acdk::xml::libxmldom::LibXMLNode::getNodeValue  )  throw ( org::w3c::dom::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.

org::w3c::dom::RDocument acdk::xml::libxmldom::LibXMLNode::getOwnerDocument  )  [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.

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::getParentNode  )  [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.

RString acdk::xml::libxmldom::LibXMLNode::getPrefix  )  [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.

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::getPreviousSibling  )  [virtual]
 

The node immediately preceding this node.

If there is no such node, this returns null.

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

RString acdk::xml::libxmldom::LibXMLNode::getTextContent  )  throw ( org::w3c::dom::RDOMException ) [virtual]
 

This attribute returns the text content of this node and its descendants.

When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.
On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed and the returned string does not contain the white spaces in element content (see the attribute Text.isElementContentWhitespace). Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content.
The string returned is made of the text content of this node depending on its type, as defined below:
Node type Content
ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the node has no children.
TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null

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

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

acdk::lang::Object acdk::xml::libxmldom::LibXMLNode::getUserData IN(RString key  )  [inline]
 

java 1.5 acdk::lang::Object setUserData(IN(RString) key, IN(RObject) data, IN(RUserDataHandler) handler) {

}

bool acdk::xml::libxmldom::LibXMLNode::hasAttributes  ) 
 

bool acdk::xml::libxmldom::LibXMLNode::hasChildNodes  )  [virtual]
 

Returns whether this node has any children.

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

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

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::insertBefore IN(org::w3c::dom::RNode newChild,
IN(org::w3c::dom::RNode refChild
throw ( org::w3c::dom::RDOMException )
 

bool acdk::xml::libxmldom::LibXMLNode::isDefaultNamespace IN(RString namespaceURI  ) 
 

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

bool acdk::xml::libxmldom::LibXMLNode::isSupported IN(RString feature,
IN(RString version
 

RString acdk::xml::libxmldom::LibXMLNode::lookupNamespaceURI IN(RString prefix  ) 
 

RString acdk::xml::libxmldom::LibXMLNode::lookupPrefix IN(RString namespaceURI  ) 
 

RLibXMLNode acdk::xml::libxmldom::LibXMLNode::newInstance xmlNodePtr  nodePtr,
bool  ownsPtr = false
[static]
 

RLibXMLNode acdk::xml::libxmldom::LibXMLNode::newInstance xmlDocPtr  docPtr,
xmlNodePtr  nodePtr,
int  nodeType,
bool  ownsPtr = false
[static]
 

void acdk::xml::libxmldom::LibXMLNode::normalize  ) 
 

Reimplemented in acdk::xml::libxmldom::LibXMLElement.

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::removeChild IN(org::w3c::dom::RNode oldChild  )  throw ( org::w3c::dom::RDOMException )
 

org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::replaceChild IN(org::w3c::dom::RNode newChild,
IN(org::w3c::dom::RNode oldChild
throw ( org::w3c::dom::RDOMException )
 

acdk::lang::RBoolean acdk::xml::libxmldom::LibXMLNode::selectBoolean IN(acdk::lang::RString xpath  )  [virtual]
 

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

virtual org::w3c::dom::RNode acdk::xml::libxmldom::LibXMLNode::selectNode IN(RString xpath  )  [virtual]
 

virtual org::w3c::dom::RNodeList acdk::xml::libxmldom::LibXMLNode::selectNodes IN(RString xpath  )  [virtual]
 

See also:
implementation in acdk::xml::dom::NodeUtil::selectNodes

acdk::lang::RObject acdk::xml::libxmldom::LibXMLNode::selectObject IN(acdk::lang::RString xpath  )  [virtual]
 

may return Node, NodeList, String Boolean or Number

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

acdk::lang::RString acdk::xml::libxmldom::LibXMLNode::selectText IN(acdk::lang::RString xpath  )  [virtual]
 

select a string.

XPath has to select a text node, comment or attribute

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

void acdk::xml::libxmldom::LibXMLNode::setNodeValue IN(RString nodeValue  )  throw ( org::w3c::dom::RDOMException )
 

void acdk::xml::libxmldom::LibXMLNode::setPrefix IN(RString prefix  )  throw ( org::w3c::dom::RDOMException )
 

void acdk::xml::libxmldom::LibXMLNode::setTextContent IN(RString textContent  )  throw ( org::w3c::dom::RDOMException )
 

RString acdk::xml::libxmldom::LibXMLNode::toString  )  [inline, virtual]
 

return a string representation of this object Object::toString() return getName() by default

Reimplemented from acdk::lang::Object.

Reimplemented in acdk::xml::libxmldom::LibXMLAttr, acdk::xml::libxmldom::LibXMLCharacterData, acdk::xml::libxmldom::LibXMLDocument, acdk::xml::libxmldom::LibXMLDocumentType, acdk::xml::libxmldom::LibXMLElement, acdk::xml::libxmldom::LibXMLEntity, acdk::xml::libxmldom::LibXMLNotation, and acdk::xml::libxmldom::LibXMLProcessingInstruction.

RString acdk::xml::libxmldom::LibXMLNode::toXML  )  [virtual]
 

dom4j like extension

Todo:
implement in derived interfaces

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

Reimplemented in acdk::xml::libxmldom::LibXMLCDATASection, acdk::xml::libxmldom::LibXMLCharacterData, acdk::xml::libxmldom::LibXMLComment, acdk::xml::libxmldom::LibXMLDocument, acdk::xml::libxmldom::LibXMLDocumentType, acdk::xml::libxmldom::LibXMLElement, acdk::xml::libxmldom::LibXMLEntity, acdk::xml::libxmldom::LibXMLEntityReference, acdk::xml::libxmldom::LibXMLNotation, and acdk::xml::libxmldom::LibXMLText.

void acdk::xml::libxmldom::LibXMLNode::write IN(acdk::io::RWriter out,
int  writeFlags = org::w3c::dom::NWFWDefaultFlags,
int  indentLevel = 0,
IN(RString encoding = Nil
 


Member Data Documentation

XmlNodePtrHolder acdk::xml::libxmldom::LibXMLNode::_nodePtr [protected]