libxml2dom problems

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


"ankit" <ankitrastogi82 at gmail.com> wrote:

>I am using libxml2dom but having problem when parsing. It gives me the
> following error:
>
> File "exlibxml2dom.py", line 4, in ?
>    document = libxml2dom.parse("moc.xml")
>  File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line
> 472, in parse
>    return parseFile(stream_or_string, html)
>  File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line
> 484, in parseFile
>    return Document(Node_parseFile(filename, html))
>  File
> "/usr/lib/python2.2/site-packages/libxml2dom/macrolib/macrolib.py",
> line 431, in parseFile
>    libxml2mod.xmlCtxtUseOptions(context, XML_PARSE_NOERROR |
> XML_PARSE_NOWARNING | XML_PARSE_NONET)
> 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).

</F> 






More information about the Python-list mailing list