parameters: (s)
return_statement: return s
docstring: Escapes <, >, and & from s, and removes XML 1.0-illegal chars.
docstring_summary: Escapes <, >, and & from s, and removes XML 1.0-illegal chars.
docstring_tokens: Escapes < > and & from s and removes XML 1 . 0 - illegal chars .
function: def _MakeXMLSafe(s):
    """Escapes <, >, and & from s, and removes XML 1.0-illegal chars."""
    s = cgi.escape(s)  # Escape <, >, and &
    # Remove characters that cannot appear in an XML 1.0 document
    # (http://www.w3.org/TR/REC-xml/#charsets).
    #
    # NOTE: if there are problems with current solution, one may move to
    # XML 1.1, which allows such chars, if they're entity-escaped (&#xHH;).
    s = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f]', '', s)
    # Convert non-ascii characters to entities.  Note: requires python >=2.3
    s = s.encode('ascii', 'xmlcharrefreplace')   # u'\xce\x88' -> 'u&#904;'
    return s
function_tokens: def _MakeXMLSafe ( s ) : s = cgi . escape ( s ) # Escape <, >, and & # Remove characters that cannot appear in an XML 1.0 document # (http://www.w3.org/TR/REC-xml/#charsets). # # NOTE: if there are problems with current solution, one may move to # XML 1.1, which allows such chars, if they're entity-escaped (&#xHH;). s = re . sub ( r'[\x00-\x08\x0b\x0c\x0e-\x1f]' , '' , s ) # Convert non-ascii characters to entities.  Note: requires python >=2.3 s = s . encode ( 'ascii' , 'xmlcharrefreplace' ) # u'\xce\x88' -> 'u&#904;' return s