http://www.perlmonks.org?node_id=30705

Item Description: Exports data from a relational data base as XML

Review Synopsis:

Description

DBIx::XML_RDB - Perl extension for creating XML from existing DBI datasources. DBIx::XML_RDB comes with the sql2xml tool which simply dumps a table in a database to an XML file.

Why use DBIx::XML_RDB?

Why NOT use DBIx::XML_RDB?

Example

use DBIx-XML_RDB;
my $xmlout = DBIx::XML_RDB->new($datasource,
              "ODBC", $userid, $password, $dbname) || die "Failed to make new xmlout";
$xmlout->DoSql("select * from MyTable");
print $xmlout->GetData;

Personal Notes

I haven't used DBIx-XML_RDB too often (the first script I wrote with DBI did exactly the same thing!) but it looks like the right tool to generate XML out of a relational table

Replies are listed 'Best First'.
RE: DBIx::XML_RDB
by Anonymous Monk on Sep 01, 2000 at 21:07 UTC
    There seems to be a bug in MySQL which prevents it from working to read XML into the database. But it works fine to extract it.

    It also needs some maintainence, but I'm missing tuits.

    Matt.

      Matt, thanks for the heads up. I don't know if anyone else has noticed this problem or not.
      Have you checked MSQL's docs for discussions of this problem? Can you point me to a location that discusses that problem? Was there something Perl specific you wanted to ask, or does this relate to a Perl module you are working on?
      Generally we like to keep things related to Perl when we post, or else, there will be too much noise in our sig2noise ratio. ;)
      Cheers!

        Hum....
        Matt is actually the author of the module, so I guess he was not really asking a question...

      Just an FYI, the MySQL issue has been worked around in the latest release of DBIx::XML_RDB (though the bug in MySQL may still exist). Also, this module now produces well-formed XML and properly encodes any > and < characters that may be in the SQL query when writing the output file.

      -ubu
      Thanks for the info and to everyone else who wrote in. r.b.
Re: DBIx::XML_RDB
by DamnDirtyApe (Curate) on Aug 08, 2001 at 22:17 UTC
    I can't seem to get DBIx::XML_RDB to connect to an Oracle database... anyone else have this problem? DBI connects fine.

      Nice timing: DBIx::XML_RDB has just been replaced by XML::Generator::DBI, so you might want to give it a try in case this one works.