Python, XML and XPath

Hole h0leforfun at gmail.com
Wed Dec 17 15:11:45 CET 2008


Hi all,

I hope this is not an "overasked" question but I find myself quite
confused about python xml management (I have to use python for a
project and I come from java world, you know...where frameworks,
libraries and tools to use are standard de iure or standard de facto).

I need to use XML parsing with xpath: a simple xml reader.

I've found that the standard distribution of python doesn't include
xpath support modules so I've decided to add libxml2.

I've installed cygwin c compiler but I still have errors like the
following:

C:\Python25\Lib\libxml2-python-2.6.9>python setup.py build install
C:\Python25\lib\distutils\dist.py:247: UserWarning: 'licence'
distribution option is deprecated; use 'license'
  warnings.warn(msg)
running build
running build_py
running build_ext
building 'libxml2mod' extension
writing build\temp.win32-2.5\Release\libxml2mod.def
C:\MinGW\bin\gcc.exe -mno-cygwin -shared -s build
\temp.win32-2.5\Release\libxml2-py.o build\temp.win32-2.5\Release
\libxml.o build\temp.win32-2.5\Release\types.o build
\temp.win32-2.5\Release\libxml2mod
.def -L/usr\lib -LC:\Python25\libs -LC:\Python25\PCBuild -llibxslt -
llibexslt -llibxml2 -lpython25 -lmsvcr71 -o build
\lib.win32-2.5\libxmlmods\libxml2mod.pyd
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x1629):
undefined reference to `_imp__xmlFree'
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x2802):
undefined reference to `_imp__xmlFree'
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x44b2):
undefined reference to `_imp__xmlFree'
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x50e4):
undefined reference to `_imp__xmlFree'
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x5519):
undefined reference to `_imp__xmlFree'
build\temp.win32-2.5\Release\libxml2-py.o:libxml2-py.c:(.text+0x7339):
more undefined references to `_imp__xmlFree' follow

Does anyone know how to solve this issue or has suggestions for
another (easy-to-install) xml-xpath library?

Thanks for your support!



More information about the Python-list mailing list