# HG changeset patch # User laurent # Date 1323646704 -3600 # Node ID 7cadf0e2ae054c09f8db9be0821df955b228ade3 # Parent 32c0f4a626db5054d76cfb1adde14e0654617769 Adding support for unescape special character in #text node in formattedText diff -r 32c0f4a626db -r 7cadf0e2ae05 xmlclass/xmlclass.py --- a/xmlclass/xmlclass.py Mon Dec 12 00:25:18 2011 +0100 +++ b/xmlclass/xmlclass.py Mon Dec 12 00:38:24 2011 +0100 @@ -131,8 +131,8 @@ # content is a CDATA text = "" for node in attr.childNodes: - if node.nodeName != "#text": - text += node.data.encode("utf-8") + if not (node.nodeName == "#text" and node.data.strip() == ""): + text += unescape(node.data.encode("utf-8")) return text @@ -535,7 +535,7 @@ def GenerateAnyInfos(infos): def ExtractAny(tree): if tree.nodeName in ["#text", "#cdata-section"]: - return tree.data.encode("utf-8") + return unescape(tree.data.encode("utf-8")) else: return tree