This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: XML munges apos entity in tag content
Type: behavior Stage:
Components: XML Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: loewis, resplin
Priority: normal Keywords:

Created on 2008-04-17 03:01 by resplin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg65570 - (view) Author: Richard Esplin (resplin) Date: 2008-04-17 03:01
I would like it to leave my ' alone, just like it does with my <
and >

Python 2.5.1 (r251:54863, Sep 21 2007, 22:46:31)
[GCC 4.2.1 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.dom import minidom
>>> doc = minidom.parseString("<tag>&lt;a&apos;b&gt;</tag>")
>>> doc.toxml()
u'<?xml version="1.0" ?><tag>&lt;a\'b&gt;</tag>'
>>>
msg65576 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-04-17 06:05
That's not a bug. The two XML documents are completely equivalent. If
you rely on the lexical representation of specific characters, you
should reconsider your usage of XML. toxml could have chosen to
represent < as &#60;, and that still would have been correct (IOW, it
doesn't even know anymore that you represented it as &lt; in the input).
History
Date User Action Args
2022-04-11 14:56:33adminsetgithub: 46899
2016-08-30 18:21:18serhiy.storchakalinkissue27899 superseder
2008-04-17 06:05:00loewissetstatus: open -> closed
resolution: not a bug
messages: + msg65576
nosy: + loewis
2008-04-17 03:01:58resplincreate