[XML-SIG] Looking for a generic efficient script for reading xml containing CDATA, extracting data for ready to be stored in a .dbf file

Stefan Behnel stefan_ml at behnel.de
Tue Dec 23 08:26:04 CET 2008


Hi,

David Shi wrote:
> Looking for a generic efficient script for reading xml containing CDATA,
> extracting data for ready to be stored in a .dbf file

My guess is that your best bet is to do the conversion yourself in order to
get the mapping right.

Asking Google for "python .dbf file" gives a couple of hits, including this
one:

http://dbfpy.sourceforge.net/

Parsing the XML step-by-step to do the mapping on the fly should be easy
using iterparse() in ElementTree or lxml. Not sure about ElementTree, but
at least lxml handles CDATA sections nicely and gives you the plain text.

Stefan


More information about the XML-SIG mailing list