def make_flat_dict(name, selector=None, subselector=None, ns=None):
 if (ns is None):
  elemname = name
  tagname = Selector(0)
 else:
  elemname = ('{%s}%s' % (ns, name))
  tagname = (lambda obj, do_raise=False: ('{%s}%s' % (ns, obj[0])))
 if (selector is None):
  selector = name
 root = TemplateElement(elemname, selector=selector, subselector=subselector)
 elem = SubTemplateElement(root, tagname, selector=get_items)
 elem.text = 1
 return root

def make_flat_dict ( name , selector = None , subselector = None , ns = None ) : if ( ns is None ) : elemname = name tagname = Selector ( 0 ) else : elemname = ( '{%s}%s' % ( ns , name ) ) tagname = ( lambda obj , do_raise = False : ( '{%s}%s' % ( ns , obj [ 0 ] ) ) ) if ( selector is None ) : selector = name root = TemplateElement ( elemname , selector = selector , subselector = subselector ) elem = SubTemplateElement ( root , tagname , selector = get_items ) elem . text = 1 return root
utility for simple xml templates that traditionally used xmldictserializer with no metadata .