CL_DomElement Class Reference
[clanCore XML]

DOM Element class. More...

#include <dom_element.h>

Inheritance diagram for CL_DomElement:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Construction

 CL_DomElement ()
 Constructs a DOM Element handle.
 CL_DomElement (CL_DomDocument &doc, const CL_DomString &tag_name, const CL_DomString &namespace_uri=CL_DomString())
 CL_DomElement (const CL_SharedPtr< CL_DomNode_Generic > &impl)
 Constructs a DomElement.
 ~CL_DomElement ()
Attributes

CL_DomString get_tag_name () const
 Returns the name of the element.
Operations

bool has_attribute (const CL_DomString &name) const
 Returns true if the element has the specified attribute.
bool has_attribute_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name) const
 Returns true if the element has the specified attribute.
CL_DomString get_attribute (const CL_DomString &name) const
 Returns the specified attribute.
CL_DomString get_attribute (const CL_DomString &name, const CL_DomString &default_value) const
 Get attribute.
CL_DomString get_attribute_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name) const
 Returns the specified attribute.
CL_DomString get_attribute_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, const CL_DomString &default_value) const
void set_attribute (const CL_DomString &name, const CL_DomString &value)
 Adds a new attribute.
void set_attribute_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, const CL_DomString &value)
void remove_attribute (const CL_DomString &name)
 Removes an attribute by name.
void remove_attribute_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name)
CL_DomAttr get_attribute_node (const CL_DomString &name) const
 Get attribute node.
CL_DomAttr get_attribute_node_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name) const
CL_DomAttr set_attribute_node (const CL_DomAttr &attr)
 Set attribute node.
CL_DomAttr set_attribute_node_ns (const CL_DomAttr &attr)
 Set attribute node ns.
CL_DomNodeList get_elements_by_tag_name (const CL_DomString &name)
 Returns a NodeList of all descendant elements with a given tag name.
CL_DomNodeList get_elements_by_tag_name_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name)
CL_String get_text () const
 Returns the text of all child Text nodes appended together.
CL_DomString get_child_string (const CL_DomString &name, const CL_DomString &default_value=CL_DomString()) const
 Returns the text value of the child node with the given tag name.
CL_DomString get_child_string_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, const CL_DomString &default_value=CL_DomString()) const
 Returns the text value of the child node with the given local name and namespace.
int get_child_int (const CL_DomString &name, int default_value=0) const
 Returns the integer value of the child node with the given tag name.
int get_child_int_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, int default_value=0) const
 Returns the integer value of the child node with the given local name and namespace.
bool get_child_bool (const CL_DomString &name, bool default_value=false) const
 Returns the boolean value of the child node with the given tag name.
bool get_child_bool_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, bool default_value=false) const
 Returns the boolean value of the child node with the given local name and namespace.
void set_child_string (const CL_DomString &name, const CL_DomString &value)
 Sets the child node with the specified tag name to the given text value.
void set_child_string_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, const CL_DomString &value)
 Sets the child node with the specified qualified name and namespace to the given text value.
void set_child_int (const CL_DomString &name, int value)
 Sets the child node with the specified tag name to the given integer value.
void set_child_int_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, int value)
 Sets the child node with the specified qualified name and namespace to the given integer value.
void set_child_bool (const CL_DomString &name, bool value)
 Sets the child node with the specified tag name to the given boolean value.
void set_child_bool_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, bool value)
 Sets the child node with the specified qualified name and namespace to the given boolean value.
CL_DomElement get_first_child_element () const
 Returns the first child node that is an element node.
CL_DomElement get_next_sibling_element () const
 Returns the next sibling node that is an element node.
int get_attribute_int (const CL_DomString &name, int default_value=0) const
 Returns the integer value of the attribute node with the given tag name.
int get_attribute_int_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, int default_value=0) const
 Returns the integer value of the attribute node with the given local name and namespace.
bool get_attribute_bool (const CL_DomString &name, bool default_value=false) const
 Returns the boolean value of the attribute node with the given tag name.
bool get_attribute_bool_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, bool default_value=false) const
 Returns the boolean value of the attribute node with the given local name and namespace.
float get_attribute_float (const CL_DomString &name, float default_value=0.0f) const
 Returns the floating-point value of the attribute node with the given tag name.
float get_attribute_float_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name, float default_value=0.0f) const
 Returns the floating-point value of the attribute node with the given local name and namespace.
void set_attribute_int (const CL_DomString &name, int value)
 Sets the attribute node with the specified tag name to the given integer value.
void set_attribute_int_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, int value)
 Sets the attribute node with the specified qualified name and namespace to the given integer value.
void set_attribute_bool (const CL_DomString &name, bool value)
 Sets the attribute node with the specified tag name to the given boolean value.
void set_attribute_bool_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, bool value)
 Sets the attribute node with the specified qualified name and namespace to the given boolean value.
void set_attribute_float (const CL_DomString &name, float value, int num_decimal_places=6)
 Sets the attribute node with the specified tag name to the given floating-point value.
void set_attribute_float_ns (const CL_DomString &namespace_uri, const CL_DomString &qualified_name, float value, int num_decimal_places=6)
 Sets the attribute node with the specified qualified name and namespace to the given floating-point value.
Operations

bool operator== (const CL_DomNode &other) const
 Compare operator.
bool operator!= (const CL_DomNode &other) const
 Compare operator.
void normalize ()
 Merges any adjacent Text nodes.
CL_DomNode insert_before (CL_DomNode &new_child, CL_DomNode &ref_child)
 Inserts the node new_child before the existing child node ref_child.
CL_DomNode replace_child (CL_DomNode &new_child, CL_DomNode &old_child)
 Replaces the child node old_child with new_child in the list of children.
CL_DomNode remove_child (CL_DomNode &old_child)
 Removes the child node indicated by old_child from the list of children, and returns it.
CL_DomNode append_child (CL_DomNode new_child)
 Adds the node new_child to the end of the list of children of this node.
CL_DomNode clone_node (bool deep) const
 Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
CL_DomElement to_element () const
 Returns the Element interface to this node.
CL_DomAttr to_attr () const
 Returns the Attribute interface to this node.
CL_DomText to_text () const
 Returns the Text interface to this node.
CL_DomCDATASection to_cdata_section () const
 Returns the CDATA Section interface to this node.
CL_DomEntityReference to_entity_reference () const
 Returns the Entity Reference interface to this node.
CL_DomEntity to_entity () const
 Returns the Entity interface to this node.
CL_DomProcessingInstruction to_processing_instruction () const
 Returns the Processing Instruction interface to this node.
CL_DomComment to_comment () const
 Returns the Comment interface to this node.
CL_DomDocument to_document () const
 Returns the Document interface to this node.
CL_DomDocumentType to_document_type () const
 Returns the Document Type interface to this node.
CL_DomDocumentFragment to_document_fragment () const
 Returns the Document Fragment interface to this node.
CL_DomNotation to_notation () const
 Returns the Notation interface to this node.
CL_DomNode named_item (const CL_DomString &name) const
 Returns the first child node with the specified node name.
CL_DomNode named_item_ns (const CL_DomString &namespace_uri, const CL_DomString &local_name) const
 Retrieves the first child node with the specified namespace URI and local name.
CL_DomString find_namespace_uri (const CL_DomString &qualified_name) const
 Searches the node tree upwards for the namespace URI of the given qualified name.
CL_DomString find_prefix (const CL_DomString &namespace_uri) const
 Searches the node tree upwards for the prefix name for the namespace URI.
std::vector< CL_DomNodeselect_nodes (const CL_DomString &xpath_expression) const
 Returns all the nodes matching the specified xpath expression using this node as the context node.
CL_DomNode select_node (const CL_DomString &xpath_expression) const
 Returns the first node matching the specified xpath expression using this node as the context node.
CL_String select_string (const CL_DomString &xpath_expression) const
 Returns the first node value matching the specified xpath expression using this node as the context node.
int select_int (const CL_DomString &xpath_expression) const
 Returns the first node value (as integer) matching the specified xpath expression using this node as the context node.
float select_float (const CL_DomString &xpath_expression) const
 Returns the first node value (as float) matching the specified xpath expression using this node as the context node.
bool select_bool (const CL_DomString &xpath_expression) const
 Returns the first node value (as boolean) matching the specified xpath expression using this node as the context node.

Attributes



CL_DomString get_node_name () const
 Returns the node name.
CL_DomString get_namespace_uri () const
 Returns the namespace URI of this node.
CL_DomString get_prefix () const
 Returns the namespace prefix of the node.
void set_prefix (const CL_DomString &prefix)
 Sets the namespace prefix of the node.
CL_DomString get_local_name () const
 Returns local part of the qualified name of this node.
CL_DomString get_node_value () const
 Returns the node value.
void set_node_value (const CL_DomString &value)
 Sets the node value.
unsigned short get_node_type () const
 Returns the node type (one of those in the NodeType enum).
CL_DomNode get_parent_node () const
 Returns the parent of this node.
CL_DomNodeList get_child_nodes () const
 Returns a NodeList that contains all children of this node.
CL_DomNode get_first_child () const
 The first child of this node.
CL_DomNode get_last_child () const
 The last child of this node.
CL_DomNode get_previous_sibling () const
 The node immediately preceding this node.
CL_DomNode get_next_sibling () const
 The node immediately following this node.
CL_DomNamedNodeMap get_attributes () const
 A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise.
CL_DomDocument get_owner_document () const
 The Document object associated with this node.
bool is_null () const
 Returns true if this is a null node.
bool is_element () const
 Returns true if this is an element node.
bool is_attr () const
 Returns true if this is an attribute node.
bool is_text () const
 Returns true if this is a text node.
bool is_cdata_section () const
 Returns true if this is a CDATA section node.
bool is_entity_reference () const
 Returns true if this is an entity reference node.
bool is_entity () const
 Returns true if this is an entity node.
bool is_processing_instruction () const
 Returns true if this is a processing instruction node.
bool is_comment () const
 Returns true if this is a comment node.
bool is_document () const
 Returns true if this is a document node.
bool is_document_type () const
 Returns true if this is a document type node.
bool is_document_fragment () const
 Returns true if this is a document fragment node.
bool is_notation () const
 Returns true if this is a notation node.
bool is_supported (const CL_DomString &feature, const CL_DomString &version) const
 Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
bool has_attributes () const
 Returns true if this node (if its an element) has any attributes.
bool has_child_nodes () const
 Returns true if this node has any children.
enum  NodeType {
  NULL_NODE = 0, ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3,
  CDATA_SECTION_NODE = 4, ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7,
  COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11,
  NOTATION_NODE = 12
}
 

An integer indicating which type of node this is.

More...

Implementation



CL_SharedPtr< CL_DomNode_Generic > impl
class CL_DomDocument
class CL_DomNamedNodeMap

Detailed Description

DOM Element class.

By far the vast majority of objects (apart from text) that authors encounter when traversing a document are Element nodes. Assume the following XML document:

       <elementExample id="demo">
        <subelement1/>
        <subelement2><subsubelement/></subelement2>
       </elementExample/gt;
       

When represented using DOM, the top node is an Element node for "elementExample", which contains two child Element nodes, one for "subelement1" and one for "subelement2". "subelement1" contains no child nodes.

Elements may have attributes associated with them; since the Element interface inherits from Node, the generic Node interface method getAttributes may be used to retrieve the set of all attributes for an element. There are methods on the Element interface to retrieve either an Attr object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an Attr object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value.


Member Enumeration Documentation

enum CL_DomNode::NodeType [inherited]

An integer indicating which type of node this is.

Enumerator:
NULL_NODE 
ELEMENT_NODE 
ATTRIBUTE_NODE 
TEXT_NODE 
CDATA_SECTION_NODE 
ENTITY_REFERENCE_NODE 
ENTITY_NODE 
PROCESSING_INSTRUCTION_NODE 
COMMENT_NODE 
DOCUMENT_NODE 
DOCUMENT_TYPE_NODE 
DOCUMENT_FRAGMENT_NODE 
NOTATION_NODE 

Constructor & Destructor Documentation

CL_DomElement::CL_DomElement (  ) 

Constructs a DOM Element handle.

CL_DomElement::CL_DomElement ( CL_DomDocument doc,
const CL_DomString tag_name,
const CL_DomString namespace_uri = CL_DomString() 
)
CL_DomElement::CL_DomElement ( const CL_SharedPtr< CL_DomNode_Generic > &  impl  ) 

Constructs a DomElement.

Parameters:
impl = Shared Ptr
CL_DomElement::~CL_DomElement (  ) 

Member Function Documentation

CL_DomNode CL_DomNode::append_child ( CL_DomNode  new_child  )  [inherited]

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

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

CL_DomNode CL_DomNode::clone_node ( bool  deep  )  const [inherited]

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

The duplicate node has no parent.

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 text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning any other type of node simply returns a copy of this node.

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). retval: The duplicate node.
CL_DomString CL_DomNode::find_namespace_uri ( const CL_DomString qualified_name  )  const [inherited]

Searches the node tree upwards for the namespace URI of the given qualified name.

CL_DomString CL_DomNode::find_prefix ( const CL_DomString namespace_uri  )  const [inherited]

Searches the node tree upwards for the prefix name for the namespace URI.

CL_DomString CL_DomElement::get_attribute ( const CL_DomString name  )  const

Returns the specified attribute.

CL_DomString CL_DomElement::get_attribute ( const CL_DomString name,
const CL_DomString default_value 
) const

Get attribute.

Parameters:
name = Dom String
default_value = Dom String
Returns:
Dom String
bool CL_DomElement::get_attribute_bool ( const CL_DomString name,
bool  default_value = false 
) const

Returns the boolean value of the attribute node with the given tag name.

bool CL_DomElement::get_attribute_bool_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
bool  default_value = false 
) const

Returns the boolean value of the attribute node with the given local name and namespace.

float CL_DomElement::get_attribute_float ( const CL_DomString name,
float  default_value = 0.0f 
) const

Returns the floating-point value of the attribute node with the given tag name.

float CL_DomElement::get_attribute_float_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
float  default_value = 0.0f 
) const

Returns the floating-point value of the attribute node with the given local name and namespace.

int CL_DomElement::get_attribute_int ( const CL_DomString name,
int  default_value = 0 
) const

Returns the integer value of the attribute node with the given tag name.

int CL_DomElement::get_attribute_int_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
int  default_value = 0 
) const

Returns the integer value of the attribute node with the given local name and namespace.

CL_DomAttr CL_DomElement::get_attribute_node ( const CL_DomString name  )  const

Get attribute node.

Parameters:
name = Dom String
Returns:
Dom Attr
CL_DomAttr CL_DomElement::get_attribute_node_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
) const
CL_DomString CL_DomElement::get_attribute_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
) const

Returns the specified attribute.

CL_DomString CL_DomElement::get_attribute_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
const CL_DomString default_value 
) const
CL_DomNamedNodeMap CL_DomNode::get_attributes (  )  const [inherited]

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

bool CL_DomElement::get_child_bool ( const CL_DomString name,
bool  default_value = false 
) const

Returns the boolean value of the child node with the given tag name.

Finds the first child node with the specified tag name, then returns the content of its first child text node as an boolean

bool CL_DomElement::get_child_bool_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
bool  default_value = false 
) const

Returns the boolean value of the child node with the given local name and namespace.

Finds the first child node with the specified local name and namespace, then returns the content of its first child text node as an boolean

int CL_DomElement::get_child_int ( const CL_DomString name,
int  default_value = 0 
) const

Returns the integer value of the child node with the given tag name.

Finds the first child node with the specified tag name, then returns the content of its first child text node as an integer

int CL_DomElement::get_child_int_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
int  default_value = 0 
) const

Returns the integer value of the child node with the given local name and namespace.

Finds the first child node with the specified local name and namespace, then returns the content of its first child text node as an integer

CL_DomNodeList CL_DomNode::get_child_nodes (  )  const [inherited]

Returns a NodeList that contains all children of this node.

If there are no children, this is a NodeList containing no nodes. The content of the returned NodeList is "live" in the sense that, for instance, changes to the children of the node object that it was created from are immediately reflected in the nodes returned by the NodeList accessors; it is not a static snapshot of the content of the node. This is true for every NodeList, including the ones returned by the getElementsByTagName method.

CL_DomString CL_DomElement::get_child_string ( const CL_DomString name,
const CL_DomString default_value = CL_DomString() 
) const

Returns the text value of the child node with the given tag name.

Finds the first child node with the specified tag name, then returns the content of its first child text node

CL_DomString CL_DomElement::get_child_string_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name,
const CL_DomString default_value = CL_DomString() 
) const

Returns the text value of the child node with the given local name and namespace.

Finds the first child node with the specified local name and namespace, then returns the content of its first child text node

CL_DomNodeList CL_DomElement::get_elements_by_tag_name ( const CL_DomString name  ) 

Returns a NodeList of all descendant elements with a given tag name.

The descendant elements are returned in the order in which they would be encountered in a preorder traversal of the Element tree.

CL_DomNodeList CL_DomElement::get_elements_by_tag_name_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
)
CL_DomNode CL_DomNode::get_first_child (  )  const [inherited]

The first child of this node.

If there is no such node, this returns a null node.

CL_DomElement CL_DomElement::get_first_child_element (  )  const

Returns the first child node that is an element node.

CL_DomNode CL_DomNode::get_last_child (  )  const [inherited]

The last child of this node.

If there is no such node, this returns a null node.

CL_DomString CL_DomNode::get_local_name (  )  const [inherited]

Returns 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 create_element from the Document interface, this is always an empty string.

CL_DomString CL_DomNode::get_namespace_uri (  )  const [inherited]

Returns the namespace URI of this node.

CL_DomNode CL_DomNode::get_next_sibling (  )  const [inherited]

The node immediately following this node.

If there is no such node, this returns a null node.

CL_DomElement CL_DomElement::get_next_sibling_element (  )  const

Returns the next sibling node that is an element node.

CL_DomString CL_DomNode::get_node_name (  )  const [inherited]

Returns the node name.

The return value vary according to the node type as follows:

  • Element: name of tag
  • Attr: name of attribute
  • Text: "#text"
  • CDataSection: "#cdata-section"
  • EntityReference: name of entity referenced
  • Entity: entity name
  • ProcessingInstruction: target
  • Comment: "#comment"
  • Document: "#document"
  • DocumentType: document type name
  • DocumentFragment: "#document-fragment"
  • Notation: notation name
unsigned short CL_DomNode::get_node_type (  )  const [inherited]

Returns the node type (one of those in the NodeType enum).

CL_DomString CL_DomNode::get_node_value (  )  const [inherited]

Returns the node value.

The return value vary according to the node type as follows:

  • Element: null
  • Attr: value of attribute
  • Text: content of text node
  • CDataSection: content of CDATA Section
  • EntityReference: null
  • Entity: null
  • ProcessingInstruction: entire content excluding the target
  • Comment: content of the comment
  • Document: null
  • DocumentType: null
  • DocumentFragment: null
  • Notation: null
CL_DomDocument CL_DomNode::get_owner_document (  )  const [inherited]

The Document object associated with this node.

This is also the Document object used to create new nodes. When this node is a Document this is null.

CL_DomNode CL_DomNode::get_parent_node (  )  const [inherited]

Returns the parent of this node.

All nodes, except Document, DocumentFragment, and Attr 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.

CL_DomString CL_DomNode::get_prefix (  )  const [inherited]

Returns the namespace prefix of the node.

For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as create_element from the Document interface, this is always an empty string.

CL_DomNode CL_DomNode::get_previous_sibling (  )  const [inherited]

The node immediately preceding this node.

If there is no such node, this returns a null node.

CL_DomString CL_DomElement::get_tag_name (  )  const

Returns the name of the element.

CL_String CL_DomElement::get_text (  )  const

Returns the text of all child Text nodes appended together.

bool CL_DomElement::has_attribute ( const CL_DomString name  )  const

Returns true if the element has the specified attribute.

bool CL_DomElement::has_attribute_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
) const

Returns true if the element has the specified attribute.

bool CL_DomNode::has_attributes (  )  const [inherited]

Returns true if this node (if its an element) has any attributes.

bool CL_DomNode::has_child_nodes (  )  const [inherited]

Returns true if this node has any children.

CL_DomNode CL_DomNode::insert_before ( CL_DomNode new_child,
CL_DomNode ref_child 
) [inherited]

Inserts the node new_child before the existing child node ref_child.

If refChild is a null node, inserts new_child 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 ref_child. If the new_child is already in the tree, it is first removed.

Parameters:
new_child The node to insert.
ref_child The reference node, i.e., the node before which the new node must be inserted. retval: The node being inserted.
bool CL_DomNode::is_attr (  )  const [inherited]

Returns true if this is an attribute node.

bool CL_DomNode::is_cdata_section (  )  const [inherited]

Returns true if this is a CDATA section node.

bool CL_DomNode::is_comment (  )  const [inherited]

Returns true if this is a comment node.

bool CL_DomNode::is_document (  )  const [inherited]

Returns true if this is a document node.

bool CL_DomNode::is_document_fragment (  )  const [inherited]

Returns true if this is a document fragment node.

bool CL_DomNode::is_document_type (  )  const [inherited]

Returns true if this is a document type node.

bool CL_DomNode::is_element (  )  const [inherited]

Returns true if this is an element node.

bool CL_DomNode::is_entity (  )  const [inherited]

Returns true if this is an entity node.

bool CL_DomNode::is_entity_reference (  )  const [inherited]

Returns true if this is an entity reference node.

bool CL_DomNode::is_notation (  )  const [inherited]

Returns true if this is a notation node.

bool CL_DomNode::is_null (  )  const [inherited]

Returns true if this is a null node.

bool CL_DomNode::is_processing_instruction (  )  const [inherited]

Returns true if this is a processing instruction node.

bool CL_DomNode::is_supported ( const CL_DomString feature,
const CL_DomString version 
) const [inherited]

Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.

bool CL_DomNode::is_text (  )  const [inherited]

Returns true if this is a text node.

CL_DomNode CL_DomNode::named_item ( const CL_DomString name  )  const [inherited]

Returns the first child node with the specified node name.

Returns a null node if no child is found.

CL_DomNode CL_DomNode::named_item_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
) const [inherited]

Retrieves the first child node with the specified namespace URI and local name.

void CL_DomNode::normalize (  )  [inherited]

Merges any adjacent Text nodes.

Puts all Text nodes in the full depth of the sub-tree underneath this node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.

This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer lookups) that depend on a particular document tree structure are to be used.

Note: In cases where the document contains CDATASections, the normalize operation alone may not be sufficient, since XPointers do not differentiate between Text nodes and CDATASection nodes.

bool CL_DomNode::operator!= ( const CL_DomNode other  )  const [inherited]

Compare operator.

bool CL_DomNode::operator== ( const CL_DomNode other  )  const [inherited]

Compare operator.

void CL_DomElement::remove_attribute ( const CL_DomString name  ) 

Removes an attribute by name.

If the removed attribute has a default value it is immediately replaced.

void CL_DomElement::remove_attribute_ns ( const CL_DomString namespace_uri,
const CL_DomString local_name 
)
CL_DomNode CL_DomNode::remove_child ( CL_DomNode old_child  )  [inherited]

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

CL_DomNode CL_DomNode::replace_child ( CL_DomNode new_child,
CL_DomNode old_child 
) [inherited]

Replaces the child node old_child with new_child in the list of children.

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

Parameters:
new_child The new node to put in the child list.
old_child The node being replaced in the list. retval: The node replaced.
bool CL_DomNode::select_bool ( const CL_DomString xpath_expression  )  const [inherited]

Returns the first node value (as boolean) matching the specified xpath expression using this node as the context node.

float CL_DomNode::select_float ( const CL_DomString xpath_expression  )  const [inherited]

Returns the first node value (as float) matching the specified xpath expression using this node as the context node.

int CL_DomNode::select_int ( const CL_DomString xpath_expression  )  const [inherited]

Returns the first node value (as integer) matching the specified xpath expression using this node as the context node.

CL_DomNode CL_DomNode::select_node ( const CL_DomString xpath_expression  )  const [inherited]

Returns the first node matching the specified xpath expression using this node as the context node.

std::vector<CL_DomNode> CL_DomNode::select_nodes ( const CL_DomString xpath_expression  )  const [inherited]

Returns all the nodes matching the specified xpath expression using this node as the context node.

CL_String CL_DomNode::select_string ( const CL_DomString xpath_expression  )  const [inherited]

Returns the first node value matching the specified xpath expression using this node as the context node.

void CL_DomElement::set_attribute ( const CL_DomString name,
const CL_DomString value 
)

Adds a new attribute.

If an attribute with that name is already present in the element, its value is changed to be that of the value parameter.

This value is a simple string, it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and is appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use set_attribute_node to assign it as the value of an attribute.

void CL_DomElement::set_attribute_bool ( const CL_DomString name,
bool  value 
)

Sets the attribute node with the specified tag name to the given boolean value.

void CL_DomElement::set_attribute_bool_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
bool  value 
)

Sets the attribute node with the specified qualified name and namespace to the given boolean value.

void CL_DomElement::set_attribute_float ( const CL_DomString name,
float  value,
int  num_decimal_places = 6 
)

Sets the attribute node with the specified tag name to the given floating-point value.

void CL_DomElement::set_attribute_float_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
float  value,
int  num_decimal_places = 6 
)

Sets the attribute node with the specified qualified name and namespace to the given floating-point value.

void CL_DomElement::set_attribute_int ( const CL_DomString name,
int  value 
)

Sets the attribute node with the specified tag name to the given integer value.

void CL_DomElement::set_attribute_int_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
int  value 
)

Sets the attribute node with the specified qualified name and namespace to the given integer value.

CL_DomAttr CL_DomElement::set_attribute_node ( const CL_DomAttr attr  ) 

Set attribute node.

Parameters:
attr = Dom Attr
Returns:
Dom Attr
CL_DomAttr CL_DomElement::set_attribute_node_ns ( const CL_DomAttr attr  ) 

Set attribute node ns.

Parameters:
attr = Dom Attr
Returns:
Dom Attr
void CL_DomElement::set_attribute_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
const CL_DomString value 
)
void CL_DomElement::set_child_bool ( const CL_DomString name,
bool  value 
)

Sets the child node with the specified tag name to the given boolean value.

Sets the first child node with the specified tag name, creating it if it does not exist, to the given boolean value

void CL_DomElement::set_child_bool_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
bool  value 
)

Sets the child node with the specified qualified name and namespace to the given boolean value.

Sets the first child node with the specified qualified name and namespace, creating it if it does not exist, to the given boolean value

void CL_DomElement::set_child_int ( const CL_DomString name,
int  value 
)

Sets the child node with the specified tag name to the given integer value.

Sets the first child node with the specified tag name, creating it if it does not exist, to the given integer value

void CL_DomElement::set_child_int_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
int  value 
)

Sets the child node with the specified qualified name and namespace to the given integer value.

Sets the first child node with the specified qualified name and namespace, creating it if it does not exist, to the given integer value

void CL_DomElement::set_child_string ( const CL_DomString name,
const CL_DomString value 
)

Sets the child node with the specified tag name to the given text value.

Sets the first child node with the specified tag name, creating it if it does not exist, to the given text value

void CL_DomElement::set_child_string_ns ( const CL_DomString namespace_uri,
const CL_DomString qualified_name,
const CL_DomString value 
)

Sets the child node with the specified qualified name and namespace to the given text value.

Sets the first child node with the specified qualified name and namespace, creating it if it does not exist, to the given text value

void CL_DomNode::set_node_value ( const CL_DomString value  )  [inherited]

Sets the node value.

void CL_DomNode::set_prefix ( const CL_DomString prefix  )  [inherited]

Sets the namespace prefix of the node.

Note that setting this attribute, when permitted, changes the node_name attribute, which holds the qualified name, as well as the tag_name and name attributes of the Element and Attr interfaces, when applicable.

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 namespace_uri and local_name do not change.

CL_DomAttr CL_DomNode::to_attr (  )  const [inherited]

Returns the Attribute interface to this node.

If the node is not an Attribute node, then it returns a null node.

CL_DomCDATASection CL_DomNode::to_cdata_section (  )  const [inherited]

Returns the CDATA Section interface to this node.

If the node is not a CDATA Section node, then it returns a null node.

CL_DomComment CL_DomNode::to_comment (  )  const [inherited]

Returns the Comment interface to this node.

If the node is not a Comment node, then it returns a null node.

CL_DomDocument CL_DomNode::to_document (  )  const [inherited]

Returns the Document interface to this node.

If the node is not a Document node, then it returns a null node.

CL_DomDocumentFragment CL_DomNode::to_document_fragment (  )  const [inherited]

Returns the Document Fragment interface to this node.

If the node is not a DocumentFragment node, then it returns a null node.

CL_DomDocumentType CL_DomNode::to_document_type (  )  const [inherited]

Returns the Document Type interface to this node.

If the node is not a Document Type node, then it returns a null node.

CL_DomElement CL_DomNode::to_element (  )  const [inherited]

Returns the Element interface to this node.

If the node is not an Element node, then it returns a null node.

CL_DomEntity CL_DomNode::to_entity (  )  const [inherited]

Returns the Entity interface to this node.

If the node is not an Entity node, then it returns a null node.

CL_DomEntityReference CL_DomNode::to_entity_reference (  )  const [inherited]

Returns the Entity Reference interface to this node.

If the node is not an Entity Reference node, then it returns a null node.

CL_DomNotation CL_DomNode::to_notation (  )  const [inherited]

Returns the Notation interface to this node.

If the node is not a Notation node, then it returns a null node.

CL_DomProcessingInstruction CL_DomNode::to_processing_instruction (  )  const [inherited]

Returns the Processing Instruction interface to this node.

If the node is not a Processing Instrucion node, then it returns a null node.

CL_DomText CL_DomNode::to_text (  )  const [inherited]

Returns the Text interface to this node.

If the node is not a Text node, then it returns a null node.


Friends And Related Function Documentation

friend class CL_DomDocument [friend, inherited]
friend class CL_DomNamedNodeMap [friend, inherited]

Member Data Documentation

CL_SharedPtr<CL_DomNode_Generic> CL_DomNode::impl [protected, inherited]

The documentation for this class was generated from the following file: