[XML-SIG] getAttribute??
Dom Linu
linudom@hotmail.com
Mon, 28 May 2001 19:54:50 -0000
<html><DIV>
<P>As always, the SIG rules. Bravo! Still perplexing is the interesting "feature" of getAttribute(<attrname>)...</P>
<P>Thanks again!<BR></P></DIV>
<DIV></DIV>
<DIV></DIV>>From: Alexandre Fayolle <ALEXANDRE.FAYOLLE@LOGILAB.FR>
<DIV></DIV>>To: Dom Linu <LINUDOM@HOTMAIL.COM>
<DIV></DIV>>CC: xml-sig@python.org
<DIV></DIV>>Subject: Re: [XML-SIG] getAttribute??
<DIV></DIV>>Date: Mon, 28 May 2001 20:51:32 +0200 (CEST)
<DIV></DIV>>
<DIV></DIV>>On Mon, 28 May 2001, Dom Linu wrote:
<DIV></DIV>>
<DIV></DIV>> > I have tried this many different ways, but it never seems to work and I
<DIV></DIV>> > always abandon PyXML in favor of something else... so I'll ask here, why
<DIV></DIV>> > does this fail:
<DIV></DIV>> >
<DIV></DIV>> > >>> from xml.dom.ext.reader.Sax2 import FromXml
<DIV></DIV>> > >>> doc = FromXml("<MYDOC id=123>text here</MYDOC>")
<DIV></DIV>> > >>> elem = doc.documentElement
<DIV></DIV>> > >>> attr = elem.getAttribute("id")
<DIV></DIV>>
<DIV></DIV>>Try this:
<DIV></DIV>>
<DIV></DIV>>attr = elem.getAttributeNS('','id')
<DIV></DIV>>
<DIV></DIV>>Alexandre Fayolle
<DIV></DIV>>--
<DIV></DIV>>http://www.logilab.com
<DIV></DIV>>Narval is the first software agent available as free software (GPL).
<DIV></DIV>>LOGILAB, Paris (France).
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>XML-SIG maillist - XML-SIG@python.org
<DIV></DIV>>http://mail.python.org/mailman/listinfo/xml-sig
<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>