Mark Overmeer > Data-DublinCore-0.04 > Data::DublinCore

Download:
Data-DublinCore-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.04   Source  

NAME ^

Data::DublinCore - DublinCore meta-data access

INHERITANCE ^

 Data::DublinCore
   is a XML::Compile::Cache
   is a XML::Compile::Schema
   is a XML::Compile

SYNOPSIS ^

  my $dc = Data::DublinCore->new(version => '20080211');
  my $xml  = $dc->writer($sometype)->($doc, $perldata);

  my ($type, $data) = $dc->from('data.xml');
  my ($type, $data) = Data::DublinCore->from('data.xml');
  print "Root type: $type\n";
  print Dumper $data;    # from Data::Dumper

DESCRIPTION ^

This module provides access to the DublinCore metadata specification, see http://dublincore.org.

Actually, the dublin-core spec is rather empty: applications need to define the content of the supplied containers themselves. When this content is RDF defined, it seems not to follow the rules of schema's at all. And for other applications I do not know. So... the best thing this module can do is call XML::LibXML::Simple. In the future, however, this may improve.

METHODS ^

Constructors

$obj->from(XMLDATA, OPTIONS)

Read an XML message, in any format supported by XML::Compile method dataToXML(): string, file, filehandle, and more. Returned is a list of two: the type of the top-level element plus the data-structure.

When the method is called as class method, then a temporary instance is created. Creating an instance is (very) slow: reuse is advised.

  my $dc            = Data::DublinCore->new;
  my ($type, $data) = $dc->from('data.xml');

or

  my ($type, $data) = Data::DublinCore->from('data.xml');

Data::DublinCore->new(OPTIONS)

 Option            --Defined in     --Default
 allow_undeclared    XML::Compile::Cache  <false>
 any_element         XML::Compile::Cache  'ATTEMPT'
 any_type                             <call XML::LibXML::Simple>
 block_namespace     XML::Compile::Schema  []
 hook                XML::Compile::Schema  undef
 hooks               XML::Compile::Schema  []
 ignore_unused_tags  XML::Compile::Schema  <false>
 key_rewrite         XML::Compile::Schema  []
 opts_readers        XML::Compile::Cache  []
 opts_rw             XML::Compile::Cache  []
 opts_writers        XML::Compile::Cache  []
 prefixes            XML::Compile::Cache  <smart>
 schema_dirs         XML::Compile     undef
 typemap             XML::Compile::Schema  {}
 version                              <newest>

. allow_undeclared => BOOLEAN

. any_element => CODE|'TAKE_ALL'|'SKIP_ALL'|'ATTEMPT'|'SLOPPY'

. any_type => CODE

Passed in the reader to XML::Compile::Schema::compile(any_type). Each contained data element which is complex gets passed into XML::LibXML::Simple subroutine XMLin. This provides easy access to for instance rdf data which is stored in there.

. block_namespace => NAMESPACE|TYPE|HASH|CODE|ARRAY

. hook => ARRAY-WITH-HOOKDATA | HOOK

. hooks => ARRAY-OF-HOOK

. ignore_unused_tags => BOOLEAN|REGEXP

. key_rewrite => HASH|CODE|ARRAY-of-HASH-and-CODE

. opts_readers => HASH|ARRAY-of-PAIRS

. opts_rw => HASH|ARRAY-of-PAIRS

. opts_writers => HASH|ARRAY-of-PAIRS

. prefixes => HASH|ARRAY-of-PAIRS

. schema_dirs => DIRECTORY|ARRAY-OF-DIRECTORIES

. typemap => HASH

. version => STRING

Accessors

$obj->addHook(HOOKDATA|HOOK|undef)

See "Accessors" in XML::Compile::Schema

$obj->addHooks(HOOK, [HOOK, ...])

See "Accessors" in XML::Compile::Schema

$obj->addKeyRewrite(PREDEF|CODE|HASH, ...)

See "Accessors" in XML::Compile::Schema

$obj->addSchemaDirs(DIRECTORIES|FILENAME)

Data::DublinCore->addSchemaDirs(DIRECTORIES|FILENAME)

See "Accessors" in XML::Compile

$obj->addSchemas(XML, OPTIONS)

See "Accessors" in XML::Compile::Schema

$obj->addTypemap(PAIR)

See "Accessors" in XML::Compile::Schema

$obj->addTypemaps(PAIRS)

See "Accessors" in XML::Compile::Schema

$obj->allowUndeclared([BOOLEAN])

See "Accessors" in XML::Compile::Cache

$obj->blockNamespace(NAMESPACE|TYPE|HASH|CODE|ARRAY)

See "Accessors" in XML::Compile::Schema

$obj->hooks

See "Accessors" in XML::Compile::Schema

$obj->namespace

$obj->prefix(PREFIX)

See "Accessors" in XML::Compile::Cache

$obj->prefixFor(URI)

See "Accessors" in XML::Compile::Cache

$obj->prefixed(TYPE)

See "Accessors" in XML::Compile::Cache

$obj->prefixes([PAIRS|ARRAY|HASH])

See "Accessors" in XML::Compile::Cache

$obj->useSchema(SCHEMA, [SCHEMA])

See "Accessors" in XML::Compile::Schema

$obj->version

Compilers

$obj->compile(('READER'|'WRITER'), TYPE, OPTIONS)

See "Compilers" in XML::Compile::Schema

$obj->compileAll(['READER'|'WRITER'|'RW', [NAMESPACE]])

See "Compilers" in XML::Compile::Cache

Data::DublinCore->dataToXML(NODE|REF-XML-STRING|XML-STRING|FILENAME|FILEHANDLE|KNOWN)

See "Compilers" in XML::Compile

$obj->reader(TYPE|NAME, OPTIONS)

See "Compilers" in XML::Compile::Cache

$obj->template('XML'|'PERL', ELEMENT, OPTIONS)

See "Compilers" in XML::Compile::Schema

$obj->writer(TYPE|NAME)

See "Compilers" in XML::Compile::Cache

Administration

$obj->declare('READER'|'WRITER'|'RW', TYPE|ARRAY-of-TYPES, OPTIONS)

See "Administration" in XML::Compile::Cache

$obj->elements

See "Administration" in XML::Compile::Schema

$obj->findName(NAME)

See "Administration" in XML::Compile::Cache

$obj->findSchemaFile(FILENAME)

Data::DublinCore->findSchemaFile(FILENAME)

See "Administration" in XML::Compile

$obj->importDefinitions(XMLDATA, OPTIONS)

See "Administration" in XML::Compile::Schema

$obj->knownNamespace(NAMESPACE|PAIRS)

Data::DublinCore->knownNamespace(NAMESPACE|PAIRS)

See "Administration" in XML::Compile

$obj->namespaces

See "Administration" in XML::Compile::Schema

$obj->printIndex([FILEHANDLE], OPTIONS)

See "Administration" in XML::Compile::Cache

$obj->types

See "Administration" in XML::Compile::Schema

$obj->walkTree(NODE, CODE)

See "Administration" in XML::Compile

Administration

DETAILS ^

SEE ALSO ^

This module is part of Data-DublinCore distribution version 0.04, built on June 14, 2010. Website: http://perl.overmeer.net

COPYRIGHTS ^

Copyrights of the perl code and the related documentation by 2009-2010 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html

syntax highlighting: