daemon/core/misc/xmlutils.py
def addtextelementsfromlist(dom, parent, iterable, name, attrs):
    ''' XML helper to iterate through a list and add items to parent using tags
    of the given name, attributes specified in the attrs tuple, and having the
    text of the item within the tags.
    Example: addtextelementsfromlist(dom, parent, ('a','b','c'), "letter",
                                     (('show','True'),))
    <parent>
      <letter show="True">a</letter>
      <letter show="True">b</letter>
      <letter show="True">c</letter>
    </parent>
    '''
    for item in iterable:
        element = dom.createElement(name)
        for k,v in attrs:
            element.setAttribute(k, v)
        parent.appendChild(element)
        txt = dom.createTextNode(item)
        element.appendChild(txt)
 XML helper to iterate through a list and add items to parent using tags
    of the given name, attributes specified in the attrs tuple, and having the
    text of the item within the tags.
    Example: addtextelementsfromlist(dom, parent, ('a','b','c'), "letter",
                                     (('show','True'),))
    <parent>
      <letter show="True">a</letter>
      <letter show="True">b</letter>
      <letter show="True">c</letter>
    </parent>
    
XML helper to iterate through a list and add items to parent using tags
of the given name, attributes specified in the attrs tuple, and having the
text of the item within the tags.
XML helper to iterate through a list and add items to parent using tags of the given name attributes specified in the attrs tuple and having the text of the item within the tags .
def addtextelementsfromlist(dom, parent, iterable, name, attrs):
    for item in iterable:
        element = dom.createElement(name)
        for k,v in attrs:
            element.setAttribute(k, v)
        parent.appendChild(element)
        txt = dom.createTextNode(item)
        element.appendChild(txt)
def addtextelementsfromlist ( dom , parent , iterable , name , attrs ) : for item in iterable : element = dom . createElement ( name ) for k , v in attrs : element . setAttribute ( k , v ) parent . appendChild ( element ) txt = dom . createTextNode ( item ) element . appendChild ( txt )
XML helper to iterate through a list and add items to parent using tags
of the given name, attributes specified in the attrs tuple, and having the
text of the item within the tags.
XML helper to iterate through a list and add items to parent using tags of the given name attributes specified in the attrs tuple and having the text of the item within the tags .
''' XML helper to iterate through a list and add items to parent using tags
    of the given name, attributes specified in the attrs tuple, and having the
    text of the item within the tags.
    Example: addtextelementsfromlist(dom, parent, ('a','b','c'), "letter",
                                     (('show','True'),))
    <parent>
      <letter show="True">a</letter>
      <letter show="True">b</letter>
      <letter show="True">c</letter>
    </parent>
    '''
dom
parent
iterable
name
attrs