[ pyxml-Bugs-1598441 ] Fails to print ampersand

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.python.xml
Message-ID <[email protected]>
Bugs item #1598441, was opened at 2006-11-17 17:16
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1598441&group_id=6473

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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Daniel Aarno (macbishop)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fails to print ampersand

Initial Comment:
I can't figure out how to print a ampersand in a text node. This is probably not a bug but a feature but it has been giving me a headeach.

### BEGIN CODE ###
Running the following program:

from xml.dom.minidom import *
from xml.dom.ext import *

doc = Document()
n = doc.createElement("aroot")
tn = doc.createTextNode("&nbsp;")
n.appendChild(tn)
doc.appendChild(n)

PrettyPrint(doc)

### END CODE ###

I want the output to be
<?xml version='1.0' encoding='UTF-8'?>
<aroot>&nbsp;</aroot>

but the actual output is:

<?xml version='1.0' encoding='UTF-8'?>
<aroot>&amp;nbsp;</aroot>

i.e. the & has been replaced by &amp; which is not what I want.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=1598441&group_id=6473
_______________________________________________
XML-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/xml-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.