[XML-SIG] How to convert my data in database to XML

Uche Ogbuji uche.ogbuji at fourthought.com
Mon Nov 8 03:10:31 CET 2004


On Tue, 2004-11-02 at 10:21, kumar s wrote:
> Dear group, 
>  I apologize for asking a very basic question here and
> also I am afraid if this is not the correct place to
> ask. 
> 
> I have a database and I am plannig to pump my data in
> the tables into XML files. For the kind of data in my
> database table, there is already a proposed DTD out
> there.  
> 
> What I should be do in order to convert my existing
> data in tables into XML files. 
> 
> Do I have to:
> 1. Create any parser to convert the data into XML
> structure. 
> 2. Validate the integrity of XML structure based on
> DTD provided.
> 
> I might not have all the data fields supported in the
> DTD in my database. Is it okay if I leave some fields
> as blank. 
> 
> This e-mail is a jump-start e-mail for me. I program
> in python by never touched XML and I am excited to do
> that. 

Well, since it sounds as if you'd like to solve your XML processing task
using Python, this probably is the right place.  The only problem I can
see with your question is that there is not really enough detail for
anyone to help.  Sounds as if you want to export data from a database
(what sort?  SQL?  Object?  Hash table?  You say "tables" so I'd guess
SQL).  Which DBMS?  Does it have XML export capabilities you can just
use without writing your own code?  Does the DTD *require* (not just
allow) fields for which the source database has no value?  If so, are
there business rules you can apply to set defaults?  etc. etc.  I could
ask a hundred questions, but it's much better if you just get specific
and tell us what tools you're using, your precise goals, etc.  Snippets
of code or data samples will probably get you the best responses.

-- 
Uche Ogbuji                                    Fourthought, Inc.
http://uche.ogbuji.net    http://4Suite.org    http://fourthought.com
A hands-on introduction to ISO Schematron - http://www-106.ibm.com/developerworks/edu/x-dw-xschematron-i.html
Schematron abstract patterns - http://www.ibm.com/developerworks/xml/library/x-stron.html
Wrestling HTML (using Python) - http://www.xml.com/pub/a/2004/09/08/pyxml.html
XML's growing pains - http://www.adtmag.com/article.asp?id=10196
XMLOpen and more XML Hacks - http://www.ibm.com/developerworks/xml/library/x-think27.html
A survey of XML standards - http://www-106.ibm.com/developerworks/xml/library/x-stand4/



More information about the XML-SIG mailing list