[Zope] DOM and Zope

Jesper Holmberg jesper.holmberg@enst-bretagne.fr
Sun, 9 Dec 2001 11:59:19 +0100


This code works fine in the python (2.1.1) interpreter:

  from xml.dom import minidom

  myDoc = minidom.Document()
  myEl = myDoc.createElement('jeppe')
  myEl2 = myDoc.createElement('henning')
  myDoc.appendChild(myEl)
  myDoc.insertBefore(myEl2, myEl)
  print myEl2.parentNode
  print myEl2.nextSibling

  
However, when I put this code in a Zope (2.4.2) product, and run it, I get an
error on the last line:

  Error Type: AttributeError
  Error Value: nextSibling

with trace ending in:

  File /usr/lib/zope/lib/python/xml/dom/minidom.py, line 74, in __getattr__
  AttributeError: (see above)

  
So for some reason, the node myEl2 is not correctly inserted in the DOM.
It knows its parent, but not who is it's sibling. In fact, if nextSibling
were None, there wouldn't be an error, but now it doesn't even know it has
an attribute with this name.

Does anyone have an idea what could be the problem?

TIA,

Jesper


-- 
          Jesper Holmberg            |"But how can |
  jesper.holmberg@enst-bretagne.fr   | one be warm |
ENST Br, BP 832, 29285 Brest, FRANCE | alone?"     |