[XML-SIG] getAttribute??
Dom Linu
linudom@hotmail.com
Mon, 28 May 2001 18:17:50 -0000
<html><DIV>I have tried this many different ways, but it never seems to work and I always abandon PyXML in favor of something else... so I'll ask here, why does this fail:</DIV>
<DIV> </DIV>
<DIV>>>> from xml.dom.ext.reader.Sax2 import FromXml<BR>>>> doc = FromXml("<mydoc id='123'>text here</mydoc>")<BR>>>> elem = doc.documentElement<BR>>>> attr = elem.getAttribute("id")<BR>>>> print attr</DIV>
<DIV> </DIV>
<DIV>>>> type(attr)<BR><type 'string'></DIV>
<DIV> </DIV>
<DIV>I've tried other document, other platforms (both Unix and Win32), and other techniques, but I just can't seem to get an attribute. Any enlightenment would be illuminating.</DIV>
<DIV> </DIV>
<DIV>thx.</DIV>
<DIV> </DIV><br clear=all><hr>Get your FREE download of MSN Explorer at <a href="http://explorer.msn.com">http://explorer.msn.com</a><br></p></html>