[XML-SIG] getAttribute??

Dom Linu linudom@hotmail.com
Mon, 28 May 2001 19:54:50 -0000


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