child

returns specified child elements or all child elements.

Arguments

Source


def child(self, child_tag = None):
    if child_tag is None: return self.children()
    ret = pyNodeList()
    for node in self._children:
        if node.name() == child_tag:
            ret.append(node)
    if len(ret) == 1: return ret[0]
    else: return ret