Class Element

Element node

Inherits from

Properties

Name Type Description
attrCount [get] int returns attribute count
child [set] Node returns child node by index
childCount [get] int returns child node count
firstChild [get] Node returns first child node
id [get] int return element tag id
lastChild [get] Node returns last child node
nsid [get] short return element namespace id
document [get] Document returns document node
hasChildren [get] bool returns true if node has child nodes
index [get] int return node index in parent's child node collection, -1 if not found
isElement [get] bool returns true if node is element
isText [get] bool returns true if node is text
name [get] string return element tag name
nsname [get] string return element namespace name
parent [get] Node returns parent node
text [get, set] dstring node text

Methods

Name Description
appendElement append element child - by namespace and tag names
appendElement append element child - by namespace and tag ids
appendText append text child
attr get attribute by index
attr get attribute by namespace and attribute ids
attr get attribute by namespace and attribute names
attrValue get attribute value by namespace and attribute ids
childIndex find child node, return its index if found, -1 if not found or not child of this node
setAttr set attribute value by namespace and attribute names
setAttr set attribute value by namespace and attribute ids
childElement returns child node by index and optionally compares its tag id, returns null if child with this index is not an element or id does not match
hasAttr returns true if node has attribute with specified name
hasAttr returns true if node has attribute with specified id

Authors

Vadim Lopatin, coolreader.org@gmail.com

Copyright

Vadim Lopatin, 2015

License

Boost License 1.0