[XML-SIG] Re: [4suite] Attribute none object
Alexandre Fayolle
Alexandre.Fayolle@logilab.fr
Fri, 4 Jan 2002 17:09:28 +0100 (CET)
Try
a = node.getAttribute('src')
print a
The attribute probably was set using setAttribute and not setAttributeNS.
On Fri, 4 Jan 2002, Sébastien Pierre wrote:
> Hi all,
>
> This may be a PyXML related issued, but as it is from 4DOM I
> post it on 4Suite also...
>
> Using PyXML 0.66, 4Suite 0.11, I do the following:
>
> a = node.getAttributeNS('','src'))
> print a
> a = node.attributes.getNamedItem('src')
> print a
> print a.nodeValue
>
> The first print does nothing (blank line), so obviously a is None
>
> The second print is:
> <Attribute Node at c62c8c: Name="src",
> Value="../Schemas/Planning-Preliminary.png">
>
> The third one generates an exception:
> AttributeError: 'None' object has no attribute 'nodeValue'
>
> So in this case a is an Attr at the second print and then
> becomes None at the following one... I'm puzzled.
>
> Any ideas?
>
> -- Sébastien
>
> --
> «Too old to be alternative, too alternative to be old.»
> http://www.type-z.org | Robert Smith, talking about his epitaph.
>
> _______________________________________________
> 4suite mailing list
> 4suite@lists.fourthought.com
> http://lists.fourthought.com/mailman/listinfo/4suite
>
Alexandre Fayolle
--
LOGILAB, Paris (France).
http://www.logilab.com http://www.logilab.fr http://www.logilab.org
Narval, the first software agent available as free software (GPL).