METHODS

Constructors

$class->new( OPTIONS )
Option Default

catalog_schema

<latest>

catalog_schema => URI
Set the default catalog schema, used for write(). By default the latest.

Accessors

$obj->defaultCatalogSchema

Returns the schema which will be used by default to create catalog files. This might be useful if you want to create files which are shaped in other then the last (default) definition.

Input/Output

$obj->create( DATA, OPTIONS )

The DATA is a HASH which has the correct structure and values to produce a valid XML message. Returned is an XML::LibXML::Document

Option Default

type

<from selected schema>

write

undef

type => TYPE
The type of the top-level element in the resulting document, by default constructed from the defaultCatalogSchema().
write => FILENAME|FILEHANDLE
Call write() with the result.
$obj->read( XML-SOURCE, OPTIONS )

The XML-SOURCE is usually a filename, a pre-parsed piece of XML, or a string containing XML: anything which is accepted by XML::Compile subroutine dataToXML Returned is the perl representation of that data.

$obj->write( DOC, (FILENAME|FILEHANDLE) )

Write the DOC tree (XML::LibXML::Document, probably produced with create()) to the file indicated by FILENAME or FILEHANDLE.

In case of errors, this method will produce an error (with can be caught by Log::Report::try()).