parameters: (_eval_ctx, d, autospace=True)
return_statement: return rv
docstring: Create an SGML/XML attribute string based on the items in a dict.
      All values that are neither `none` nor `undefined` are automatically
      escaped:
  
      .. sourcecode:: html+jinja
  
          <ul{{ {'class': 'my_list', 'missing': none,
                  'id': 'list-%d'|format(variable)}|xmlattr }}>
          ...
          </ul>
  
      Results in something like this:
  
      .. sourcecode:: html
  
          <ul class="my_list" id="list-42">
          ...
          </ul>
  
      As you can see it automatically prepends a space in front of the item
      if the filter returned something unless the second parameter is false.
docstring_summary: Create an SGML/XML attribute string based on the items in a dict.
      All values that are neither `none` nor `undefined` are automatically
      escaped:
docstring_tokens: Create an SGML / XML attribute string based on the items in a dict . All values that are neither none nor undefined are automatically escaped :
function: def do_xmlattr(_eval_ctx, d, autospace=True):
      """Create an SGML/XML attribute string based on the items in a dict.
      All values that are neither `none` nor `undefined` are automatically
      escaped:
  
      .. sourcecode:: html+jinja
  
          <ul{{ {'class': 'my_list', 'missing': none,
                  'id': 'list-%d'|format(variable)}|xmlattr }}>
          ...
          </ul>
  
      Results in something like this:
  
      .. sourcecode:: html
  
          <ul class="my_list" id="list-42">
          ...
          </ul>
  
      As you can see it automatically prepends a space in front of the item
      if the filter returned something unless the second parameter is false.
      """
      rv = u' '.join(
          u'%s="%s"' % (escape(key), escape(value))
          for key, value in iteritems(d)
          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
function_tokens: def do_xmlattr ( _eval_ctx , d , autospace = True ) : rv = u' ' . join ( u'%s="%s"' % ( escape ( key ) , escape ( value ) ) for key , value in iteritems ( d ) 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