DBXML and the Xerces DOM

nikki NickVonHollen at gmail.com
Thu Jul 12 22:07:49 CEST 2007


I downloaded Berkeley DB XML and put together a test script to load a
large 250mb XML file into the database.  Storage and retrieval works
great, but I need DOM access to the file without loading it all into a
string and re-parsing it.  In the c++ api (they used swig to expose c+
+ to python) it says there is a XmlDocument::getContentAsDOM() method,
but when I try to access it via python I just get an attribute error.
I looked in the source and the method isn't mapped at all!  Has anyone
had this work, ever?


from dbxml import *

mgr = XmlManager()
container = mgr.openContainer("test.dbxml")
document = container.getDocument('test1')
dom = document.getContentAsDOM()


Traceback (most recent call last):
  File "look.py", line 10, in ?
    dom = document.getContentAsDOM()
  File "/usr/lib/python2.4/site-packages/dbxml.py", line 277, in
<lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, XmlDocument,
name)
  File "/usr/lib/python2.4/site-packages/dbxml.py", line 28, in
_swig_getattr
    raise AttributeError,name
AttributeError: getContentAsDOM




More information about the Python-list mailing list