[XML-SIG] Specializing DOM exceptions

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Fri, 01 Dec 2000 13:47:04 -0700


> I said:
>  >   I'd also like to see the .nodeType values defined this way, and
>  >   shared by the implementations.
> 
> and Martin responded:
>  > It's more difficult with those, since the spec says they are defined
>  > inside of the Node interface. We could deviate from the DOM spec in
> 
>   Perhaps we should provide a Node class in xml.dom that defines just
> those values, and implementations can inherit that or duplicate the
> values in their own Node implementation.  Nothing other than the
> enumeration values should be defined in xml.dom.Node (except maybe a
> docstring).

Well, this would interfere pretty badly with 4DOM.  There is an 
xml.dom.Node.py file in 4DOM and having a Node class in the __init__ would 
cause problems with the import.

What's wrong with

from xml.dom.Node import Node

n.nodeType == Node.ELEMENT_NODE


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python