[XML-SIG] Writing DOM-neutral code

Mike Olson Mike.Olson@fourthought.com
05 Dec 2001 19:40:12 -0700


On Wed, 2001-12-05 at 15:35, Martin v. Loewis wrote:
> > If I have an element, e, then
> > 	Using pyxml (4dom) dom, e.attributes is a list
> 
> No, it is not. It is an NamedNodeMap, just as specified in
> 
> http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1780488922
> 
> It is also a NamedNodeMap in minidom. So formally, you ought to use
> .length and .item(index) (all other accessors are DOM level 2).

cDomlette won't support these though.  I guess I could add them in if
people want.  It does however support the dictionary interface.  This is
what I recomment to use.

Mike

> 
> _______________________________________________
> XML-SIG maillist  -  XML-SIG@python.org
> http://mail.python.org/mailman/listinfo/xml-sig
-- 
Mike Olson                                Principal Consultant
mike.olson@fourthought.com                +1 303 583 9900 x 102
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St,                      http://4Suite.org
Boulder, CO 80301-2537, USA
XML strategy, XML tools, knowledge management