AnyData::Format::XML 0.10 review

Download
by rbytes.net on

AnyData::Format::XML is a Perl module for tiedhash and DBI access to XML. SYNOPSIS # access XML data via a multi-dimensional t

License: Perl Artistic License
File size: 43K
Developer: Jeff Zucker
0 stars award from rbytes.net

AnyData::Format::XML is a Perl module for tiedhash and DBI access to XML.

SYNOPSIS

# access XML data via a multi-dimensional tied hash
# see AnyData.pod for full details
#
use AnyData;
my $table = adTie( 'XML', $file, $mode, $flags );

OR

# convert data to and from XML
# see AnyData.pod for full details
#
use AnyData;
adConvert( 'XML', $file1, $any_other_format, $file2, $flags );
adConvert( $any_other_format, $file1, 'XML', $file2, $flags );

OR

# access the data via DBI and SQL
# see DBD::AnyData.pod for full details
#
use DBI;
my $dbh = DBI->connect( 'dbi:AnyData' );
$dbh->func('mytable','XML',$file,$flags,'ad_catalog');
See below for a description of the optional flags that apply to all of these examples.

This module allows you to create, search, modify and/or convert XML data and files by treating them as databases without having to actually create separate database files. The data can be accessed via a multi-dimensional tiedhash using AnyData.pm or via DBI and SQL commands using DBD::AnyData.pm. See those modules for complete details of usage.

The module is built on top of Michel Rodriguez's excellent XML::Twig which means that the AnyData interfaces can now include information from DTDs, be smarter about inferring data structure, reduce memory consumption on huge files, and provide access to many powerful features of XML::Twig and XML::Parser on which it is based.

Importing options allow you to import/access/modify XML of almost any length or complexity. This includes the ability to access different subtrees as separate or joined databases.
Exporting and converting options allow you to take data from almost any source (a perl array, any DBI database, etc.) and output it as an XML file. You can control the formating of the resulting XML either by supplying a DTD listing things like nesting of tags and which columns should be output as attributes and/or you can use XML::Twig pretty_print settings to generate half a dozen different levels of compactness or whitespace in how the XML looks.
The documentaion below outlines the special flags that can be used in either of the interfaces to fine-tune how the XML is treated.

The flags listed below define the relationship between tags and attributes in the XML document and columns in the resulting database. In many cases, you can simply accept the defaults and the database will be built automatically. However, you can also fine tune the generation of the database by specifying which tags and attributes you are interested in and their relationship with database columns.

Requirements:
Perl

AnyData::Format::XML 0.10 search tags