daemon/core/misc/xmlutils.py
def iterDescendantsWithAttribute(dom, tagName, attrName, attrValue,
                                 max_depth = 0):
    '''\
    Iterate over descendant elements whose name is contained in
    tagName (or is named tagName if tagName is a string) and have an
    attribute named attrName with value attrValue.  Only consider
    nodes up to max_depth deep when max_depth is greater than zero.
    '''
    if isinstance(tagName, basestring):
        tagName = (tagName,)
    def match(d):
        return d.tagName in tagName and \
            d.getAttribute(attrName) == attrValue
    return iterMatchingDescendants(dom, match, max_depth)
\
    Iterate over descendant elements whose name is contained in
    tagName (or is named tagName if tagName is a string) and have an
    attribute named attrName with value attrValue.  Only consider
    nodes up to max_depth deep when max_depth is greater than zero.
    
\
Iterate over descendant elements whose name is contained in
tagName (or is named tagName if tagName is a string) and have an
attribute named attrName with value attrValue.  Only consider
nodes up to max_depth deep when max_depth is greater than zero.
\ Iterate over descendant elements whose name is contained in tagName ( or is named tagName if tagName is a string ) and have an attribute named attrName with value attrValue . Only consider nodes up to max_depth deep when max_depth is greater than zero .
def iterDescendantsWithAttribute(dom, tagName, attrName, attrValue,
                                 max_depth = 0):
    if isinstance(tagName, basestring):
        tagName = (tagName,)
    def match(d):
        return d.tagName in tagName and \
            d.getAttribute(attrName) == attrValue
    return iterMatchingDescendants(dom, match, max_depth)
def iterDescendantsWithAttribute ( dom , tagName , attrName , attrValue , max_depth = 0 ) : if isinstance ( tagName , basestring ) : tagName = ( tagName , ) def match ( d ) : return d . tagName in tagName and d . getAttribute ( attrName ) == attrValue return iterMatchingDescendants ( dom , match , max_depth )
\
Iterate over descendant elements whose name is contained in
tagName (or is named tagName if tagName is a string) and have an
attribute named attrName with value attrValue.
\ Iterate over descendant elements whose name is contained in tagName ( or is named tagName if tagName is a string ) and have an attribute named attrName with value attrValue .
'''\
    Iterate over descendant elements whose name is contained in
    tagName (or is named tagName if tagName is a string) and have an
    attribute named attrName with value attrValue.  Only consider
    nodes up to max_depth deep when max_depth is greater than zero.
    '''
dom
tagName
attrName
attrValue
max_depth