Python, XML and XPath


H

Hole

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!
 
Ad

Advertisements

D

Diez B. Roggisch

Hole said:
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).

<snip>

I suggest you use one of the available binary builds for windows:

http://pypi.python.org/pypi/lxml/2.1

Diez
 
Ad

Advertisements

H

Hole

I need to use XML parsing with xpath: a simple xml reader.
You can try lxml, have a look herehttp://codespeak.net/lxml/xpathxslt.html


Thanks a lot to everyone!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top