libxml2

how do we typecast a large C structure from a DLL to a Python ctypes.Structure

how do we typecast a large C structure from a DLL to a Python ctypes.Structure Question: I’ve got a pointer to an XML document structure generated through libxml2. How do I cast it to my Python class xmlDoc(ctypes.Structure):? Here’s my Python code: # libxml2 is a software library for parsing XML documents. ”’ This lib …

Total answers: 1

Problems installing lxml on M1 mac

Problems installing lxml on M1 mac Question: So, I’m having the classic trouble install lxml. Initially I was just pip installing, but when I tried to free up memory using Element.clear() I was getting the following error: Python(58695,0x1001b4580) malloc: *** error for object 0x600000bc3f60: pointer being freed was not allocated I thought this must be …

Total answers: 6

DTD Validation Failing (Python)

DTD Validation Failing (Python) Question: I am doing a Python script which generates files from a XML + DTD passed as inputs, but it fails because the DTD cannot be validated, while I do not see any problem “visually”. Here is my code : DTD = ‘scenario.dtd’ def OpenXML(xmlDesc): dtd = libxml2.parseDTD(None,DTD) ctxt = libxml2.newValidCtxt() …

Total answers: 1

How to install lxml on Ubuntu

How to install lxml on Ubuntu Question: I’m having difficulty installing lxml with easy_install on Ubuntu 11. When I type $ easy_install lxml I get: Searching for lxml Reading http://pypi.python.org/simple/lxml/ Reading http://codespeak.net/lxml Best match: lxml 2.3 Downloading http://lxml.de/files/lxml-2.3.tgz Processing lxml-2.3.tgz Running lxml-2.3/setup.py -q bdist_egg –dist-dir /tmp/easy_install-7UdQOZ/lxml-2.3/egg-dist-tmp-GacQGy Building lxml version 2.3. Building without Cython. ERROR: /bin/sh: …

Total answers: 11

Install libxml2 and associated python bindings – Windows

Install libxml2 and associated python bindings – Windows Question: I am attempting to install libxml2 so that I can setup the python bindings and eventually use lxml. However I am unable to work out here on earth I am supposed to be unzipping the files. I haven’t been able to google successfully. Do I need …

Total answers: 5