Share

Python/XML

Tracker: XBEL

5 getAttribute returns blank string - ID: 1856104
Last Update: Attachment added ( alanic7 )

When I read an HTML document using xml.dom.ext.reader.HtmlLib.Reader,
getAttribute() module for the elements returns blank string.

Attached is a test source with comments on the prints. As far as I can see,
xml/dom/Element.py implements getAttribute() as:

def getAttribute(self, name):
att = self.attributes.getNamedItem(name)
return att and att.value or ''

The last three prints are from that return line. I'm not sure if
xml/dom/Element.py is the source that the getAttribute() I used, but my
trials show that this code should work but does not. So either this is not
the source, or maybe the python source is compiled and the compiler messes
something up.

Version info:

pyXml pyxml-0.8.4, installed through Gentoo ebuild.

Python 2.4.4 (#1, Nov 6 2007, 18:42:27)
[GCC 4.1.2 (Gentoo 4.1.2)] on linux2


Gazi Alankus ( alanic7 ) - 2007-12-21 22:08

5

Open

None

Nobody/Anonymous

None

None

Public


Comments

No follow-up comments have been posted.

Attached File ( 1 )

Filename Description Download
test.py The file that replicates the error. Download

Change ( 1 )

Field Old Value Date By
File Added 259452: test.py 2007-12-21 22:08 alanic7