Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
Escapes a string so it is valid within XML or XHTML::

    >>> xhtml_escape('a')
    'a'
    >>> xhtml_escape('<')
    '&lt;'
    >>> xhtml_escape('&')
    '&amp;'

Including double quotes::(more...)

        def xhtml_escape(value):
    """Escapes a string so it is valid within XML or XHTML::
      
          >>> xhtml_escape('a')
          'a'
          >>> xhtml_escape('<')
          '<'
          >>> xhtml_escape('&')
          '&'
      
      Including double quotes::
      
          >>> xhtml_escape('"')
          '"'
      
      Encoding the result to utf-8::
      
          >>> xhtml_escape(u'a')
          'a'
      
    """
    
    escaped = xml.sax.saxutils.escape(value, {'"': """})
    return encode_to_utf8(escaped)
        


src/w/e/weblayer-0.4.3/src/weblayer/request.py   weblayer(Download)
 
from settings import require_setting
from utils import encode_to_utf8, generate_hash, xhtml_escape
 
require_setting('check_xsrf', default=True)
 
        if not hasattr(self, '_xsrf_input'):
            escaped = xhtml_escape(self.xsrf_token)
            tag = u'<input type="hidden" name="_xsrf" value="%s" />'
            self._xsrf_input = tag % escaped

src/w/e/weblayer-HEAD/src/weblayer/request.py   weblayer(Download)
 
from settings import require_setting
from utils import encode_to_utf8, generate_hash, xhtml_escape
 
require_setting('check_xsrf', default=True)
 
        if not hasattr(self, '_xsrf_input'):
            escaped = xhtml_escape(self.xsrf_token)
            tag = u'<input type="hidden" name="_xsrf" value="%s" />'
            self._xsrf_input = tag % escaped

src/t/h/thruflo.webapp-0.1.3/src/thruflo/webapp/web.py   thruflo.webapp(Download)
    def xsrf_form_html(self):
        """An HTML <input/> element to be included with all POST forms.
        """
 
        v = utils.xhtml_escape(self.xsrf_token)