XML, the Perl Way

Processing XML with Perl Michel Rodriguez

DBIx::XML_RDB

XML::Dumper

DBIx::XML_RDB (cont'd)

Example

use strict;
use DBIx::XML_RDB;

my $xmlout = new DBIx::XML_RDB(qw(database:host driver user passwd))
          || die "Failed to make new xmlout";

$xmlout->DoSql("SELECT * FROM SONGS WHERE ARTIST='Genesis'");

print $xmlout->GetData();
<?xml version="1.0"?>
<DBI driver="database:host">
        <RESULTSET statement="SELECT * FROM SONGS WHERE ARTIST='Genesis'">
                <ROW>
                        <artist>Genesis</artist>
                        <title>Firth of Fifth</title>
                        <album>Seconds Out</album>
                </ROW>
                <ROW>
                        <artist>Genesis</artist>
                        <title>I Know What I Like</title>
                        <album>Seconds Out</album>
                </ROW>
        </RESULTSET>
</DBI>  


DBIx::XML_RDB

XML::Dumper