display an xml file as an hierarchy in gui

Serge Boiko boiko at demogr.mpg.de
Mon Aug 19 14:36:33 EDT 2002


The problem: 
I have an xml file containing some data that can be
modified by the user; the user can add data entries, sort data or make
searches, thus the xml file will be modified and stored for the later
use.

The structure of xml file is displayed as a list using a gui widget and
this list representation is the view of xml model, using MVC
terminology. Initially I implemented this using minidom parser, and
did all searches and sorting operating directly on xml. This solution,
however is not very fast. Java implementation is about 100 times
faster using (using jdom parser).

Another solution is to read xml file into dictionary of objects
holding the structure of xml file and manipulate directly on
dictionary, instead of xml file. In this case it's possible to use sax
for reading and writing xml file.

I'd like to know whether this solution is optimal, or I would happy to
hear about alternatives.

-Serge



More information about the Python-list mailing list