[XML-SIG] Can anyone recommend a sensible XML parser for Python?

Uche Ogbuji uche.ogbuji@fourthought.com
Tue, 10 Sep 2002 16:03:56 -0600


> 
> I think this is the right set of behaviors:
> 
>         \   cloneNode(0) | cloneNode(1) | importNode(n,0) | importNode(n,1)
> nodeType \               |              |                 |
>           +--------------|--------------|-----------------|-----------------
> document  | return None  | new document | NotSupportedErr | NotSupportedErr
>           +--------------|--------------|-----------------|-----------------
> doctype   | new doctype, | new doctype, | new doctype if  | new doctype if
>           | no entities  | w/ entities  | new parent has  | new parent has
>           | or notations | and notations| doctype==None,  | doctype==None,
>           |              |              | else NotSuppErr,| w/ entities
>           |              |              | no entities or  | and notations
>           |              |              | notations       |
> 
> Document.cloneNode(0) returns None since it's not allowed to raise an
> exception according to the DOM spec.

I take it Document.cloneNode(0) returns None because we don't want to clone 
the documentElement?

Reinforces my whole sketchy feeling about this.

But I have no more specific complaint about the table.  I think the "new 
document" row should be more detailed, especally since that's where I think a 
lot of the surprising details lie.  Basically what I wrote above, it seems.


-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
Track chair, XML/Web Services One Boston: http://www.xmlconference.com/
Basic XML and RDF techniques for knowledge management, Part 7 - 
http://www-106.ibm.com/developerworks/xml/library/x-think12.html
Keeping pace with James Clark - http://www-106.ibm.com/developerworks/xml/libra
ry/x-jclark.html
Python and XML development using 4Suite, Part 3: 4RDF - 
http://www-105.ibm.com/developerworks/education.nsf/xml-onlinecourse-bytitle/8A
1EA5A2CF4621C386256BBB006F4CEC