[XML-SIG] Specializing DOM exceptions

Fred L. Drake, Jr. fdrake@acm.org
Fri, 1 Dec 2000 16:16:34 -0500 (EST)


uche.ogbuji@fourthought.com writes:
 > 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.

  That sucks.

 > What's wrong with
 > 
 > from xml.dom.Node import Node
 > 
 > n.nodeType == Node.ELEMENT_NODE

  I was hoping for a nice simple way of sharing the values, and a
common place to pick them up.  The latter is more important for client
code I think.  If we have DOMException & friends as:

     xml.dom.DOMException
     xml.dom.DOMStringSizeError
     xml.dom.HierarchyRequestError
     ...
     xml.dom.DOMSTRING_SIZE_ERR
     ...

then it seems we also want to be able to access the .nodeType codes
according to the spec from the same location:

     xml.dom.Node
     xml.dom.Node.ELEMENT_NODE
     ...

  I can live with the .nodeType values being directly in the
__init__.py, so we have:

     xml.dom.ELEMENT_NODE
     ...

That just means we can't provide a Node class in a common place that
provides the constants for *_NODE values.  Not a huge problem, but not
as nice as I'd hoped for.


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Digital Creations