|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: SQL DTD and related questions
Which type of transformation to use depends on the software you are using. The advantage of (1) is that you can write XSLT documents to transform it to most SQL dialects and get a series of SQL statements that can be executed directly. (If you write an XSLT generator that takes mapping information and an XML document and does this, you might want to make it available as Open Source. People ask for this fairly often, but I have never seen it implemented.) The advantage of (2) is that it the resulting XML document can be fed directly to many different products that use an object-relational mapping to transfer data from an XML document to the database. Note that XSLT stylesheets that perform (2) will probably need to perform structural transformations as well as value transformations. This is because XML document structure is often different from database structure. -- Ron > Márcio Fernando Keller wrote: > > Ex: > > (1) > -------------------------------------------------------------------------------------------------------------- > XML > <Cusmoter> > <FirstName>Marcio</FirstName> > <LastName>Keller</LastName> > <Sex>male</Sex> > </Cusmoter> > > [XSLT document snipped] > > Result: > </Statement> > <Command name = "INSERT" /> > <Tables> > <Table name = "Cust"> > <Column name = "Name"> Marcio Keller </Column> > <Column name = "Sex"> 1 </Sex> > </Table> > </Tables> > </Statement> > (2) > -------------------------------------------------------------------------------------------------------------- > XML > <Cusmoter> > <FirstName>Marcio</FirstName> > <LastName>Keller</LastName> > <Sex>male</Sex> > </Cusmoter> > > [XSLT document snipped] > > Result: > <Cusmoter> > <Name>Marcio Keller</Name> > <Sex>1</Sex> > </Cusmoter> > > ======================================================================================= > > In the first option I can process the result xml almost directly to a > database(no look at the mapping again) > In the second option I can process the result xml and I need look the > mapping again, if this record is for insert, update, ...
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








