NAME
XML::Tape - module for the manipulation of XMLtape archives
SYNOPSIS
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();
DESCRIPTION
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.
FUNCTIONS
- tapeopen($filename, $mode, [, @admin])
-
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.
- $tape->add_record($identifier, $date, $record [, @admin])
-
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.
- $tape->tapeclose
-
Closes the XMLtape.
Returns true on success undef on error.
- $tape->get_admin()
-
Reads one XMLtape admin section. Returns an instance of XML::Tape::Admin on success or undef when no more XMLtape admin sections are available.
- $tape->get_record()
-
Reads one XMLtape record section. Returns an instance of XML::Tape::Record on success or undef when no more records are available.
XML::Tape::Admin METHODS
XML::Tape::Record METHODS
- $record->getIdentifier()
-
Returns the record identifier as string.
- $record->getDate()
-
Returns the record datestamp as string.
- $record->getAdmin()
-
Returns an ARRAY of administrative records
- $record->getRecord()
-
Returns a XML string representation of a XMLtape record.
- $record->getStartByte()
-
Returns the start byte position of the record in the XMLtape
- $record->getEndByte()
-
Returns the end byte positorion of the record in the XMLtape
FURTHER INFORMATION
'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
BUGS
UTF-8 encoding is mandatory. Doesn't check for UTF-8 encoding.
CREDITS
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.
SEE ALSO
In bin/oaitape you'll find an example of a OAI-PMH interface on XML::Tape
AUTHOR
Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be>