libxml2dom problems

Fredrik Lundh fredrik at
Tue Dec 27 14:52:16 CET 2005

"ankit" <ankitrastogi82 at> wrote:

>I am using libxml2dom but having problem when parsing. It gives me the
> following error:
> File "", line 4, in ?
>    document = libxml2dom.parse("moc.xml")
>  File "/usr/lib/python2.2/site-packages/libxml2dom/", line
> 472, in parse
>    return parseFile(stream_or_string, html)
>  File "/usr/lib/python2.2/site-packages/libxml2dom/", line
> 484, in parseFile
>    return Document(Node_parseFile(filename, html))
>  File
> "/usr/lib/python2.2/site-packages/libxml2dom/macrolib/",
> line 431, in parseFile
>    libxml2mod.xmlCtxtUseOptions(context, XML_PARSE_NOERROR |
> AttributeError: 'module' object has no attribute 'xmlCtxtUseOptions'
> LET me know what is the problem with this ...

I'm not sure posting the same question over and over and over again is really
the best way to get help.  I recommend waiting at least 24 hours, and making
sure that you add more information to each followup message.

But alright, I guess I can guess: the error message says that the libxml2mod
module doesn't have a xmlCtxtUseOptions function.  Two seconds with google
indicates that this is a libxml2 function that was added in 2.6.X.  If it's not avail-
able in your install, chances are that you're using an outdated version of libxml2
(or an old version of the Python bindings).


More information about the Python-list mailing list