Last active
June 9, 2016 11:19
-
-
Save laeshiny/e14dbd7499e2b21732b490fe1d2cf103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def escape_to_xml(val): | |
"""Escape string to xml style | |
In addition, escape ", ' | |
""" | |
entities = {'"': '"', '\'': '''} | |
val = escape(val, entities) | |
return val |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment