daemon/core/misc/xmlutils.py
def addelementsfromlist(dom, parent, iterable, name, attr_name):
    ''' XML helper to iterate through a list and add items to parent using tags
    of the given name and the item value as an attribute named attr_name.
    Example: addelementsfromlist(dom, parent, ('a','b','c'), "letter", "value")
    <parent>
      <letter value="a"/>
      <letter value="b"/>
      <letter value="c"/>
    </parent>
    '''
    for item in iterable:
        element = dom.createElement(name)
        element.setAttribute(attr_name, item)
        parent.appendChild(element)
 XML helper to iterate through a list and add items to parent using tags
    of the given name and the item value as an attribute named attr_name.
    Example: addelementsfromlist(dom, parent, ('a','b','c'), "letter", "value")
    <parent>
      <letter value="a"/>
      <letter value="b"/>
      <letter value="c"/>
    </parent>
    
XML helper to iterate through a list and add items to parent using tags
of the given name and the item value as an attribute named attr_name.
XML helper to iterate through a list and add items to parent using tags of the given name and the item value as an attribute named attr_name .
def addelementsfromlist(dom, parent, iterable, name, attr_name):
    for item in iterable:
        element = dom.createElement(name)
        element.setAttribute(attr_name, item)
        parent.appendChild(element)
def addelementsfromlist ( dom , parent , iterable , name , attr_name ) : for item in iterable : element = dom . createElement ( name ) element . setAttribute ( attr_name , item ) parent . appendChild ( element )
XML helper to iterate through a list and add items to parent using tags
of the given name and the item value as an attribute named attr_name.
XML helper to iterate through a list and add items to parent using tags of the given name and the item value as an attribute named attr_name .
''' XML helper to iterate through a list and add items to parent using tags
    of the given name and the item value as an attribute named attr_name.
    Example: addelementsfromlist(dom, parent, ('a','b','c'), "letter", "value")
    <parent>
      <letter value="a"/>
      <letter value="b"/>
      <letter value="c"/>
    </parent>
    '''
dom
parent
iterable
name
attr_name