
Biblio::Catalog::Simple - Perl extension for managing XML catalog files

use Biblio::Catalog::Simple;
$catalog = catalogNew("catalogue.xml","ISO-8859-1");
$catalog = catalogLoad("catalogue.xml");
$catalog -> catalogAdd("2","<title>Me</title>");
$catalog -> catalogSave();
$catalog -> catalogId(4); # will return "<title>They</title>"
# these two functions handle multi-language support
@languages = catalogLanguages();
catalogSetLanguage('pt');

This module aims to help people who needs to manage a XML catalog. So, each record is identified by a number-id. The record contents should be correct XML accordingly with some DTD.
This function returns a list of the valid languages in the current version.
You must supply a valid language code (from the list returned by catalogLanguages) to change the language used in the forms and in the interactive shell. By default, it is used portuguese.
This function is an Catalog Object Constructor. Given a file name it creates an empty catalog and returns the correspondent object.
If the second argument is present, it is used as a encoding reference. So, if you use catalogNew("c.xml","ISO-8859-1") command, the file c.xml will be created with the following contents:
<?xml version="1.0" encoding="ISO-8859-1"?> <catalog> </catalog>
This is another Catalog Object Constructor. Really, it's an Object Re-Constructor as it loads a saved Catalog Object. It receives, as argument the catalog file name.
A method to add a record to the catalog. The following arguments are the record id and the record contents. The record contents should be valid XML. Meanwhile, there is no need for a root tag, but it can exists. This XML is not checked, so, be sure it is valid XML. This method returns the record id.
NOTE: the data is cached but not saved to the file. To have sure it is, really, saved, call the catalogSave method. If the id already exists, the contents will be replaced
This method syncs the catalog to disk. Use this everytime you make a big amount of changes on the catalog.
Given an identifier, this method returns the corresponding value or undef if it does not exists.

Alberto M. B. Simões <albie@alfarrabio.di.uminho.pt>

Manpages CGI(3) and perl(1).