[XML-SIG] Re: [4suite] 4DOM bugs

Jeremy Kloth jeremy.kloth@fourthought.com
Wed, 11 Oct 2000 11:40:41 -0600


"Martin v. Loewis" wrote:
> 
> While porting PyXML's test_dom to 4DOM, I noticed a number of
> problems, which I believe are bugs in 4DOM. Consider
> 
> from xml.dom import implementation
> 
> doc = implementation.createDocument(None,None,None)
> 
> n1 = doc.createElement('n1') ; n2 = doc.createElement('n2')
> pi = doc.createProcessingInstruction("Processing", "Instruction")
> doc.appendChild(pi)
> doc.appendChild(n1)
> 
> #doc.appendChild(n1) # fails, but shouldn't
> doc.replaceChild(n2, n1)
> doc.replaceChild(pi, n2)
> print doc.documentElement
> 
> The line "doc.appendChild(n1)" raises a hierarchy exception, as n1 is
> already in the tree. However, this is incorrect: it should first
> remove n1, then reinsert it.
> 
> The second fragment does not cause an exception. However, in the end,
> the "documentElement" of the document is a processing
> instruction. That is very strange - it should always be an element.
> 
> I've been using the 4DOM version that is currently in the PyXML CVS.
> 

We do remove the child first for regular elements, but apparently didn't
propagate the change into the code for modifing elements in the Document.

We'll get this fixed up and checked into the PyXML CVS as soon as possible.

-- 
Jeremy Kloth                             Consultant
jeremy.kloth@fourthought.com             (303)583-9900 x 105
Fourthought, Inc.                        http://www.fourthought.com
Software-engineering, knowledge-management, XML, CORBA, Linux, Python