http://qs321.pair.com?node_id=692366


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

Replies are listed 'Best First'.
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;