[XML-SIG] Bug in DOM Range support in pyXML 0.8.3

Matt Patterson matt at reprocessed.org
Thu Jan 22 16:10:49 EST 2004


Hello,

I've been using DOM Range to slice XML into arbitrary 'pages', but have 
run across what seems to be a bug.

The range.commonAncestorContainer() method doesn't return the common 
ancestor of the range: it returns the parent of whichever of the 
boundary points is closest to the document root (in terms of the tree). 
If both boundary points share the same parent then it appears to 
perform correctly.

The documentFragment returned by cloneContents()/extractContents() is 
exactly right though.

I'm running Python 2.3.3 and PyXML 0.8.3, all built from source on Mac 
OS X 10.3.

I created the DOM tree with xml.dom.ext.reader.Sax2, so I assume it's a 
4DOM problem. I have a simple example demonstrating this, so I'll 
report it at Sourceforge and post the files there. I'm not sure if I 
should report this to PyXML or 4suite.

If anyone wants the files (a .py and 4 sample .xmls) then drop me a 
line.

Thanks,

Matt

-- 
    Matt Patterson | Typographer
    <matt at emdash.co.uk> | http://www.emdash.co.uk/
    <matt at reprocessed.org> | http://reprocessed.org/




More information about the XML-SIG mailing list