|
|
| CL_DomAttr () |
| Constructs a DOM Attr handle. More...
|
|
| CL_DomAttr (CL_DomDocument doc, const CL_DomString &name, const CL_DomString &namespace_uri=CL_DomString()) |
| Constructs a DomAttr. More...
|
|
| CL_DomAttr (const CL_SharedPtr< CL_DomNode_Generic > &impl) |
| Constructs a DomAttr. More...
|
|
| ~CL_DomAttr () |
|
|
CL_DomString | get_name () const |
| Returns the name of this attribute. More...
|
|
bool | get_specified () const |
| If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false. More...
|
|
CL_DomString | get_value () const |
| Returns the value of the attribute. More...
|
|
void | set_value (const CL_DomString &value) |
| Sets the value of the attribute. More...
|
|
CL_DomElement | get_owner_element () const |
| Returns the attribute's owner element. More...
|
|
|
bool | operator== (const CL_DomNode &other) const |
| Compare operator. More...
|
|
bool | operator!= (const CL_DomNode &other) const |
| Compare operator. More...
|
|
void | normalize () |
| Merges any adjacent Text nodes. More...
|
|
CL_DomNode | insert_before (CL_DomNode &new_child, CL_DomNode &ref_child) |
| Inserts the node new_child before the existing child node ref_child. More...
|
|
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. More...
|
|
CL_DomNode | remove_child (CL_DomNode &old_child) |
| Removes the child node indicated by old_child from the list of children, and returns it. More...
|
|
CL_DomNode | append_child (CL_DomNode new_child) |
| Adds the node new_child to the end of the list of children of this node. More...
|
|
CL_DomNode | clone_node (bool deep) const |
| Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. More...
|
|
CL_DomElement | to_element () const |
| Returns the Element interface to this node. More...
|
|
CL_DomAttr | to_attr () const |
| Returns the Attribute interface to this node. More...
|
|
CL_DomText | to_text () const |
| Returns the Text interface to this node. More...
|
|
CL_DomCDATASection | to_cdata_section () const |
| Returns the CDATA Section interface to this node. More...
|
|
CL_DomEntityReference | to_entity_reference () const |
| Returns the Entity Reference interface to this node. More...
|
|
CL_DomEntity | to_entity () const |
| Returns the Entity interface to this node. More...
|
|
CL_DomProcessingInstruction | to_processing_instruction () const |
| Returns the Processing Instruction interface to this node. More...
|
|
CL_DomComment | to_comment () const |
| Returns the Comment interface to this node. More...
|
|
CL_DomDocument | to_document () const |
| Returns the Document interface to this node. More...
|
|
CL_DomDocumentType | to_document_type () const |
| Returns the Document Type interface to this node. More...
|
|
CL_DomDocumentFragment | to_document_fragment () const |
| Returns the Document Fragment interface to this node. More...
|
|
CL_DomNotation | to_notation () const |
| Returns the Notation interface to this node. More...
|
|
CL_DomNode | named_item (const CL_DomString &name) const |
| Returns the first child node with the specified node name. More...
|
|
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. More...
|
|
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. More...
|
|
CL_DomString | find_prefix (const CL_DomString &namespace_uri) const |
| Searches the node tree upwards for the prefix name for the namespace URI. More...
|
|
std::vector< CL_DomNode > | select_nodes (const CL_DomString &xpath_expression) const |
| Returns all the nodes matching the specified xpath expression using this node as the context node. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
|
CL_DomString | get_node_name () const |
| Returns the node name. More...
|
|
CL_DomString | get_namespace_uri () const |
| Returns the namespace URI of this node. More...
|
|
CL_DomString | get_prefix () const |
| Returns the namespace prefix of the node. More...
|
|
void | set_prefix (const CL_DomString &prefix) |
| Sets the namespace prefix of the node. More...
|
|
CL_DomString | get_local_name () const |
| Returns local part of the qualified name of this node. More...
|
|
CL_DomString | get_node_value () const |
| Returns the node value. More...
|
|
void | set_node_value (const CL_DomString &value) |
| Sets the node value. More...
|
|
unsigned short | get_node_type () const |
| Returns the node type (one of those in the NodeType enum). More...
|
|
CL_DomNode | get_parent_node () const |
| Returns the parent of this node. More...
|
|
CL_DomNodeList | get_child_nodes () const |
| Returns a NodeList that contains all children of this node. More...
|
|
CL_DomNode | get_first_child () const |
| The first child of this node. More...
|
|
CL_DomNode | get_last_child () const |
| The last child of this node. More...
|
|
CL_DomNode | get_previous_sibling () const |
| The node immediately preceding this node. More...
|
|
CL_DomNode | get_next_sibling () const |
| The node immediately following this node. More...
|
|
CL_DomNamedNodeMap | get_attributes () const |
| A NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise. More...
|
|
CL_DomDocument | get_owner_document () const |
| The Document object associated with this node. More...
|
|
bool | is_null () const |
| Returns true if this is a null node. More...
|
|
bool | is_element () const |
| Returns true if this is an element node. More...
|
|
bool | is_attr () const |
| Returns true if this is an attribute node. More...
|
|
bool | is_text () const |
| Returns true if this is a text node. More...
|
|
bool | is_cdata_section () const |
| Returns true if this is a CDATA section node. More...
|
|
bool | is_entity_reference () const |
| Returns true if this is an entity reference node. More...
|
|
bool | is_entity () const |
| Returns true if this is an entity node. More...
|
|
bool | is_processing_instruction () const |
| Returns true if this is a processing instruction node. More...
|
|
bool | is_comment () const |
| Returns true if this is a comment node. More...
|
|
bool | is_document () const |
| Returns true if this is a document node. More...
|
|
bool | is_document_type () const |
| Returns true if this is a document type node. More...
|
|
bool | is_document_fragment () const |
| Returns true if this is a document fragment node. More...
|
|
bool | is_notation () const |
| Returns true if this is a notation node. More...
|
|
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. More...
|
|
bool | has_attributes () const |
| Returns true if this node (if its an element) has any attributes. More...
|
|
bool | has_child_nodes () const |
| Returns true if this node has any children. More...
|
|
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...
|
|
DOM Attribute class.
The Attr interface represents an attribute in an Element object. Typically the allowable values for the attribute are defined in a document type definition.
Attr objects inherit the Node interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the Node attributes parentNode, previousSibling, and nextSibling have a null value for Attr objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type. Furthermore, Attr nodes may not be immediate children of a DocumentFragment. However, they can be associated with Element nodes contained within a DocumentFragment. In short, users and implementors of the DOM need to be aware that Attr nodes have some things in common with other objects inheriting the Node interface, but they also are quite distinct.
The attribute's effective value is determined as follows: if this attribute has been explicitly assigned any value, that value is the attribute's effective value; otherwise, if there is a declaration for this attribute, and that declaration includes a default value, then that default value is the attribute's effective value; otherwise, the attribute does not exist on this element in the structure model until it has been explicitly added. Note that the nodeValue attribute on the Attr instance can also be used to retrieve the string version of the attribute's value(s).
In XML, where the value of an attribute can contain entity references, the child nodes of the Attr node provide a representation in which entity references are not expanded. These child nodes may be either Text or EntityReference nodes. Because the attribute type may be unknown, there are no tokenized attribute values.
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.
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.