xml modifications

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Mon Oct 1 03:08:38 EDT 2007


dcleaner a écrit :
> hi there...i'm a begginer level user and i've stumbbled upon a problem a 
> bit beyond my knowledge. i hope that somebody will be able to help me with 
> my problem...
> 
> the problem is: i'm transforming an Access database to XML

<ot>Strange idea IMHO, but anyway...</ot>

> with some 
> adjustements. basicaly i have one main table in which i have my main data 
> and keys to other tables containing other relevant data.
> after exporting my main table to xml i have in some tags only keys to other 
> tables. and now i want to change those keys to meaningful data.
> for instance: after exporting, i have a line like this: <tagZ>1</tagZ>, and 
> i want to change it to be just an opening tag for something else; <tagQ 
> attr1="xx" attr2="yy">.the data which must be written in attr1 and attr2 
> depends upon the number (in this case number 1) inside  
> the tag (tagZ).

And where's your problem exactly ?-)

More seriously: you don't explain how you export your database to XML, 
so it won't be easy to help.

What I'd personnaly do would be to use the db-api (or whatever 
appropriate for accessing a .mdb) and a templating system (like genshi 
or mako or...) to build the xml file. In which case there's no problem 
accessing the related tables (that's what SQL is for, isn't it ?).

Now if you hope to get some serious help, you probably want to give more 
details...



More information about the Python-list mailing list