XML vs Python?

Chris Lyon chris.lyon at spritenote.co.uk
Fri Jan 17 06:29:45 EST 2003


"N. Thomas" <nthomas at cise.ufl.edu> wrote in message news:<slrnb293jk.1hr.nthomas at rain.cise.ufl.edu>...
> ...or rather "XML's data structures vs Python's data structures"
> 
> So I prototyped a program that keeps its data stored in an XML document,
> via PyXML's DOM API. Whenever I want to view/add/remove/change data, I
> traverse along the XML nodes, and do what I want with it. It took a
> while to get used to DOM, but after a bit, I got the hang of it.
> 
> [time goes by]
> 
> I then realized that I could have instead stored my data in a Python
> data structure (nested lists, dictionaries, etc.), and have some
> function (i.e. p2xml() and xml2p()) that would convert to and from XML.
> 
> Ultimately, the data will be saved in XML format, but it would be much
> easier to traverse/manipulate in my program.
> 
> Are there any issues that I should be aware of regarding this? I mean,
> are there situations where is it better to save one's data in XML
> internally as opposed to using the language's native structures, and
> exporting to/from XML?
> 
> thanks,
> thomas


Is this not a pickle to XML file conversion issue?




More information about the Python-list mailing list