XML::Tape - module for the manipulation of XMLtape archives
use XML::Tape qw(:all); $tape = tapeopen('tape.xml','w'); $tape->add_record("info:archive_id/1", "2005-05-31", $xml_record); $tape->tapeclose(); $tape = tapeopen('tape.xml','r'); while ($record = $tape->get_record()) { printf "id: %s\n" , $record->getIdentifier; printf "date: %s\n" , $record->getDate; printf "xml: %s\n", $record->getRecord; } $tape->tapeclose();
The XMLtape provides a write-once/read-many XML wrapper for a collection of XML documents. The wrapper provides an easy storage format for big collections of XML files which can be processed with off the shelf tools and validated against a schema. The XMLtape is typically used in digital preservation projects.
Filename is the location of an XMLtape file or an opened IO::Handle. When mode is 'r' this function opens a XMLtape for reading. When mode is 'w' this function creates a new XMLtape on disk. Optionally an array of strings can be provided which contain in XML format metadata about the XMLtape. E.g.
tapeopen( "tape.xml", "w" "<dc:date xmlns=\"http://purl.org/dc/elements/1.1/\">2005-05-31</dc:date>" );
Returns a XMLtape instance on success or undef on error.
Add a XML document to the XMLtape with identifier $identifier, date stamp $date and XML string representation $record. Optionally an array of strings can be provided which contain in XML format metadata about the record.
Returns true on success undef on error.
Closes the XMLtape.
Reads one XMLtape admin section. Returns an instance of XML::Tape::Admin on success or undef when no more XMLtape admin sections are available.
Reads one XMLtape record section. Returns an instance of XML::Tape::Record on success or undef when no more records are available.
Returns a XML string representation of a XMLtape administrative record.
Returns the record identifier as string.
Returns the record datestamp as string.
Returns an ARRAY of administrative records
Returns a XML string representation of a XMLtape record.
Returns the start byte position of the record in the XMLtape
Returns the end byte positorion of the record in the XMLtape
'File-based storage of Digital Objects and constituent datastreams: XMLtapes and Internet Archive ARC files' http://arxiv.org/abs/cs.DL/0503016
'The multi-faceted use of the OAI-PMH in the LANL Repository' http://yar.sourceforge.net/jcdl2004-submitted-draft.pdf
UTF-8 encoding is mandatory. Doesn't check for UTF-8 encoding.
XMLtape archives were developed by the Digital Library Research & Prototyping team at Los Alamos National Laboratory.
XML parsing in the module was inspired by Robert Hanson's XML::RAX module.
XML::Tape::Index
In bin/oaitape you'll find an example of a OAI-PMH interface on XML::Tape
Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be>
To install XML::Tape, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Tape
CPAN shell
perl -MCPAN -e shell install XML::Tape
For more information on module installation, please visit the detailed CPAN module installation guide.