def writeWithAttributeEscaping(write):
 def _write(data):
  write(escapeForContent(data).replace('"', '&quot;'))
 return _write

def writeWithAttributeEscaping ( write ) : def _write ( data ) : write ( escapeForContent ( data ) . replace ( '"' , '&quot;' ) ) return _write
decorate a c{write} callable so that all output written is properly quoted for inclusion within an xml attribute value .