[Zope] RE: XMLDocument "WrongDocument" error and object comparision...

Amos Latteier Amos@digicool.com
Thu, 24 Feb 2000 13:16:20 -0500


> I'm playing with XML Document, and I'm finding that I'm getting a
> bogus WrongDocument error from the sample file. If I open up the
> 'slides' document and hit 'Change' I'm getting a WrongDocument
> exception at line 433 of Node.py. 
> 
>         if document and ownerDocument and document != ownerDocument:
>              raise ZDOM.WrongDocumentException()
> 
> (I also see this when I try to create a new document)
> 
> Putting a 
>         print "DOC", document, ownerDocument
>         print "DOC2", id(document), id(ownerDocument)
> on the line before it gives back
> 
> DOC <Document instance at 863bf90> <Document instance at 863bf90>
> DOC2 139736152 139811552
> 
> so they _look_ like the same object, but comparision is failing. 
> 
> On a hunch, I tried changing the code to compare document.aq_base 
> and ownerDocument.aq_base, and this works. I have _no_ idea 
> if this is 
> correct, though.

I think that you are right. Let me look at it a little more, and then
I'll check in your patch. Thanks!

-Amos

--
Amos Latteier         mailto:amos@digicool.com
Digital Creations     http://www.digicool.com