Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: mapping between XML & DB Schemas

by radiantmatrix (Parson)
on Jun 16, 2008 at 20:52 UTC ( #692366=note: print w/ replies, xml ) Need Help??


in reply to mapping between XML & DB Schemas

The mysql command can be used to generate XML of a query -- you could also use something like XML::Simple to easily dump the result of a query; you can then use XSLT (if you want, there are modules for that) to transform that XML output into XML compliant with your XSD.

XML transformation via XSLT is the "right way" to do it, if we mean by "right way": "in accordance with the standards documents and theory". There are other definitions. ;-)

For example, you might check out XML::Generator::DBI, which generates SAX events (which you can handle to with XML::SAX::Writer, for example) from DBI queries.

Based on some guesses from your description, you might also consider XML::Template for writing, and the XML::Template::DBI to serve as a data source for your template.

<radiant.matrix>
Ramblings and references
“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” Herm Albright
I haven't found a problem yet that can't be solved by a well-placed trebuchet


Comment on Re: mapping between XML & DB Schemas
Re^2: mapping between XML & DB Schemas
by zuqif (Hermit) on Jun 17, 2008 at 10:40 UTC
    all excellent pointers!

    apologies for not being more specific, but am less concerned with *how* to get & export the data -
    am really looking for advice on building some sort of data-dictionary mapping between XML and the DB
    which can be used to auto-build the get/export routines, however they may end up implemented.

    It seems like a sensible shortcut to me, but if no-one has already done similar, I must have overlooked a glaring flaw?!

    the 'qif;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://692366]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-09-18 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls