示例#1
0
def unescape_xml(xml_str):
    return sax_unescape(xml_str, ADDL_XML_UNESC_CHARS)
示例#2
0
文件: rss.py 项目: lovegandhi/hnrss
def unescape(s):
    deref_ncr = lambda m: unichr(int(m.group(1), 16))  # '/' -> '/'
    s = re.sub("&#[Xx]([A-Fa-f0-9]+);", deref_ncr, s)
    entities = {""": '"', "'": "'"}
    return sax_unescape(s, entities)
示例#3
0
文件: rss.py 项目: sjoerdapp/hnrss
def unescape(s):
    deref_ncr = lambda m: unichr(int(m.group(1), 16))  # '/' -> '/'
    s = re.sub('&#[Xx]([A-Fa-f0-9]+);', deref_ncr, s)
    entities = {'"': '"', ''': "'"}
    return sax_unescape(s, entities)