[XML-SIG] 4DOM and namespaces

Uche Ogbuji uche.ogbuji@fourthought.com
Wed, 21 Nov 2001 07:25:07 -0700


> While we are at it, a very common newbie question with 4DOM is "I've
> parsed my document using Sax2.Reader().fromString(str), and I can't get
> the value of the bar attribute using
> doc.documentElement.getAttribute('bar') , though I can see it when I
> PrettyPrint(doc)".
> 
> The answer is "use getAttributeNS(EMPTY_NAMESPACE, 'bar')", but maybe we
> could enhance 4DOM to be non-NS-methods friendly. AFAIK, minidom offers
> such syntaxic sugar. 
> 
> If people here think this would be a Good Thing (or at least something
> nice), I'll be glad to implement it.

I'd actually decided to do this a few months ago, but never had the time.  I 
must say I'm not crazy about the idea, but I've caved in as I learn how much 
confusion this causes newbies.

I think we really need to come up with a better alt to DOM (this is another 
topic that frequently comes up).  Sort of a Pythonic JDOM.

As Guido rightly says "DOM sucks".


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Boulder, CO 80301-2537, USA
XML strategy, XML tools (http://4Suite.org), knowledge management