Node

Base class for DOM nodes

Members

Functions

appendElement
Node appendElement(string ns, string tag, int index)

append element child - by namespace and tag names

appendElement
Node appendElement(ns_id ns, elem_id tag, int index)

append element child - by namespace and tag ids

appendText
Node appendText(dstring s, int index)

append text child

attr
Attribute attr(int index)

get attribute by index

attr
Attribute attr(ns_id nsid, attr_id attrid)

get attribute by namespace and attribute ids

attr
Attribute attr(string nsname, string attrname)

get attribute by namespace and attribute names

attrValue
string attrValue(ns_id nsid, attr_id attrid)

get attribute value by namespace and attribute ids

attrValue
string attrValue(string nsname, string attrname)

get attribute value by namespace and attribute ids

childElement
Element childElement(int index, elem_id id)

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

childIndex
int childIndex(Node child)

find child node, return its index if found, -1 if not found or not child of this node

hasAttr
bool hasAttr(string attrname)

returns true if node has attribute with specified name

hasAttr
bool hasAttr(attr_id attrid)

returns true if node has attribute with specified id

setAttr
Attribute setAttr(ns_id nsid, attr_id attrid, string value)

set attribute value by namespace and attribute ids

setAttr
Attribute setAttr(string nsname, string attrname, string value)

set attribute value by namespace and attribute names

Properties

attrCount
int attrCount [@property getter]

returns attribute count

child
int child [@property setter]

returns child node by index

childCount
int childCount [@property getter]

returns child node count

document
Document document [@property getter]

returns document node

firstChild
Node firstChild [@property getter]

returns first child node

hasChildren
bool hasChildren [@property getter]

returns true if node has child nodes

id
elem_id id [@property getter]

return element tag id

index
int index [@property getter]

return node index in parent's child node collection, -1 if not found

isElement
bool isElement [@property getter]

returns true if node is element

isText
bool isText [@property getter]

returns true if node is text

lastChild
Node lastChild [@property getter]

returns last child node

name
string name [@property getter]

return element tag name

nsid
ns_id nsid [@property getter]

return element namespace id

nsname
string nsname [@property getter]

return element namespace name

parent
Node parent [@property getter]

returns parent node

text
dstring text [@property getter]
dstring text [@property setter]

node text

Meta