[Zope-dev] XMLDocument - Adding a child through zope

Jin Woo Joo jindustrial@yahoo.com
Tue, 22 Feb 2000 13:32:20 -0800 (PST)


I'm interested in using zope to maintain an xml
document. Has anyone been able to add a child to an
element node simply using the DOM api?  

I image that this would be simple using something like
the following code.

new_node =
self.getOwnerDocument().createElement('testTag')
self.appendChild(new_node)

However, I get the following error when I try it:

Error Type: WrongDocumentException
Error Value: 

The following line is at the bottom of the traceback.

  File C:\Program
Files\jin\lib\python\Products\XMLDocument\Node.py,
line 434, in appendChild
    (Object: Manageable)
WrongDocumentException: (see above)

Here's the crazy thing. Line 434 of Node.py is the
following: 

        document=newChild.getOwnerDocument()
        ownerDocument=self.getOwnerDocument()
        if document and ownerDocument and document !=
ownerDocument:
            raise ZDOM.WrongDocumentException()

Clearly from the first snippet of code, you see that
the ownerDocument of both the new_node and 'self' node
are one and the same.  Can anyone suggest a solution?

jin

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com