@evalcontextfilter
def do_xmlattr(_eval_ctx, d, autospace=True):
 rv = u' '.join(((u'%s="%s"' % (escape(key), escape(value))) for (key, value) in d.iteritems() if ((value is not None) and (not isinstance(value, Undefined)))))
 if (autospace and rv):
  rv = (u' ' + rv)
 if _eval_ctx.autoescape:
  rv = Markup(rv)
 return rv

@ evalcontextfilter def do_xmlattr ( _eval_ctx , d , autospace = True ) : rv = u' ' . join ( ( ( u'%s="%s"' % ( escape ( key ) , escape ( value ) ) ) for ( key , value ) in d . iteritems ( ) if ( ( value is not None ) and ( not isinstance ( value , Undefined ) ) ) ) ) if ( autospace and rv ) : rv = ( u' ' + rv ) if _eval_ctx . autoescape : rv = Markup ( rv ) return rv
create an sgml/xml attribute string based on the items in a dict .