Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML munges apos entity in tag content #46899

Closed
resplin mannequin opened this issue Apr 17, 2008 · 2 comments
Closed

XML munges apos entity in tag content #46899

resplin mannequin opened this issue Apr 17, 2008 · 2 comments
Labels
topic-XML type-bug An unexpected behavior, bug, or error

Comments

@resplin
Copy link
Mannequin

resplin mannequin commented Apr 17, 2008

BPO 2647
Nosy @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-04-17.06:05:00.989>
created_at = <Date 2008-04-17.03:01:58.175>
labels = ['expert-XML', 'type-bug', 'invalid']
title = 'XML munges apos entity in tag content'
updated_at = <Date 2008-04-17.06:05:00.982>
user = 'https://bugs.python.org/resplin'

bugs.python.org fields:

activity = <Date 2008-04-17.06:05:00.982>
actor = 'loewis'
assignee = 'none'
closed = True
closed_date = <Date 2008-04-17.06:05:00.989>
closer = 'loewis'
components = ['XML']
creation = <Date 2008-04-17.03:01:58.175>
creator = 'resplin'
dependencies = []
files = []
hgrepos = []
issue_num = 2647
keywords = []
message_count = 2.0
messages = ['65570', '65576']
nosy_count = 2.0
nosy_names = ['loewis', 'resplin']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue2647'
versions = ['Python 2.5']

@resplin
Copy link
Mannequin Author

resplin mannequin commented Apr 17, 2008

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>'
>>>

@resplin resplin mannequin added topic-XML type-bug An unexpected behavior, bug, or error labels Apr 17, 2008
@loewis
Copy link
Mannequin

loewis mannequin commented Apr 17, 2008

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 <, and that still would have been correct (IOW, it
doesn't even know anymore that you represented it as < in the input).

@loewis loewis mannequin closed this as completed Apr 17, 2008
@loewis loewis mannequin added the invalid label Apr 17, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-XML type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

0 participants