problems when parsing & with xml.dom.minidom.parseString

Martin v. Loewis martin at v.loewis.de
Mon Sep 16 13:14:47 EDT 2002


jcc at ibdosnorte.com (Juan Carlos CORUÑA) writes:

> Anyone knows the solution?

>>> node.firstChild.childNodes[0].nodeValue
u'one '
>>> node.firstChild.childNodes[1].nodeValue
u'&'
>>> node.firstChild.childNodes[2].nodeValue
u'two'
>>> node.normalize()
>>> node.firstChild.childNodes[0].nodeValue
u'one &two'

In PyXML 0.8.1, in this case, you will already get normalized data right
after parsing.

HTH,
Martin



More information about the Python-list mailing list