[XML-SIG] [ pyxml-Bugs-434835 ] 0.11.1b2 : pDomlette Document problem

noreply@sourceforge.net noreply@sourceforge.net
Wed, 20 Jun 2001 08:49:44 -0700


Bugs item #434835, was updated on 2001-06-20 08:49
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=434835&group_id=6473

Category: 4Suite
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexandre Fayolle (afayolle)
Assigned to: Nobody/Anonymous (nobody)
Summary: 0.11.1b2 : pDomlette Document problem

Initial Comment:
a pDomlette document has None as the ownerDocument.
This makes it impossible to use with code that expects
4DOM like Documents (which has self as the
ownerDocument), in pyXML 0.6.5. 

>>> from Ft.Lib import pDomlette
>>> from Ft.Lib.pDomletteReader import PyExpatReader
>>> r = PyExpatReader()
>>> d = r.fromString('<doc/>')
>>> d
<Domlette Document Node at 80f9f28>
>>> d.ownerDocument 
>>> from xml.dom.ext import StripXml
>>> StripXml(d)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "/home/alf/lib/python/xml/dom/ext/__init__.py",
line 148, in StripXml
    snit =
startNode.ownerDocument.createNodeIterator(startNode,
NodeFilter.SHOW_TEXT, None, 0)
AttributeError: 'None' object has no attribute
'createNodeIterator'


The version of PyXML in CVS fixes this, however, it is
not yet released. I feel that either
  * release of 0.11.1 should be delayed until a
suitable version of PyXML is available
  * pDomlette (and possibly cDomlette) should be made
backward compatible with 4DOM in this regard, at least
until pyxml 0.6.6 (0.7 ?) is released. 

Please note that I think this difference in behaviour
highly confusing when working with the different DOM
implementations available with python. the
Document.ownerDocument being equal to self is a very
nice extension to the spec, and I'm personnally in
favor of keeping it. 

Cheers

Alexandre Fayolle



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=434835&group_id=6473