Bugs item #1424171, was opened at 2006-02-04 19:23 Message generated for change (Settings changed) made by effbot You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1424171&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: XML Group: Python 2.5 >Status: Closed >Resolution: Wont Fix Priority: 5 Submitted By: Chris McDonough (chrism) Assigned to: Fredrik Lundh (effbot) Summary: patch for etree cdata and attr quoting Initial Comment: Attached is a patch for ElementTree (based on a checkout from the SVN trunk's xmlcore.etree) that seems to perform better escaping of cdata and attribute values. Instead of replacing, for example ""e;" with "&quote;" or "&" with "&", it tries to avoid requoting ampersands in things that look like entities. Sorry, I haven't tested this with anything except Python 2.4, I'm not quite sure what to do about _encode_entity, and I haven't patched any tests or written a new one for this change. Consider this more of a RFC than a patch ready-for-submission as a result. ---------------------------------------------------------------------- Comment By: Chris McDonough (chrism) Date: 2006-02-08 18:00 Message: Logged In: YES user_id=32974 Doh, of course. Sorry, I suspect I'll need to go to remedial XML class. Ignore this. ---------------------------------------------------------------------- Comment By: Fredrik Lundh (effbot) Date: 2006-02-06 22:55 Message: Logged In: YES user_id=38376 I'm not sure I follow. ET works on the infoset side of things, where everything is decoded into Unicode strings (or compatible ASCII strings). If you set an attribute to "&" in the infoset, it *must* be encoded on the way out. If you want an ampersand, use "&". ---------------------------------------------------------------------- Comment By: Chris McDonough (chrism) Date: 2006-02-04 21:23 Message: Logged In: YES user_id=32974 Egads, I did this time. ---------------------------------------------------------------------- Comment By: Georg Brandl (birkenfeld) Date: 2006-02-04 19:29 Message: Logged In: YES user_id=1188172 OP: You did check the box? ---------------------------------------------------------------------- Comment By: Chris McDonough (chrism) Date: 2006-02-04 19:26 Message: Logged In: YES user_id=32974 Sorry, the tracker doesn't seem to want to allow me to upload the file. See http://www.plope.com/static/misc/betterescape.patch for the patch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1424171&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com