Paul and/or Ed,
 
I suggest the following change to xmltodict.py for the following reason, the
< gets converted to &lt; but > does not change to &gt;.  which is apparently
causing problems when I am trying to embed font mods (bold, underline,
italic) in my reports.  After making the changes to my xmltodict.py, it
seems to fix the issue.
 
Thanks,
Larry
 
Index: xmltodict.py
===================================================================
--- xmltodict.py (revision 5299)
+++ xmltodict.py (working copy)
@@ -146,7 +146,8 @@
  def CharacterData(self, data):
   """SAX character data event handler"""
   if self._inCode or data.strip():
-   data = data.replace("&lt;", "<")
+   data = data.replace("&lt;", "<").replace("&gt;",">")
+
    data = data #.encode()
    if self._inCode:
     if self._mthdCode:
@@ -296,7 +297,7 @@
  else:
   ret += ">"
   if dct.has_key("cdata"):
-   ret += "%s" % dct["cdata"].replace("<", "&lt;")
+   ret += "%s" % dct["cdata"].replace("<", "&lt;").replace(">", "&gt;")
 
   if dct.has_key("code"):
    if len(dct["code"].keys()):



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAafA2fnYuPUOMNFpIYnBEQcKAAAAQAAAAb/[email protected]

Reply via email to