DESCRIPTION

HTML::Microformats::Format cannot be instantiated directly but many other classes inherit from it.

Constructors

The constructors cannot actually be called on this package. Call them on descendent classes instead. Parse a microformat with root element $element. Find and parse all such microformats within element $element.

Public Methods - Accessors

There are a number of property accessor methods defined via Perl's \s-1AUTOLOAD\s0 mechanism.

For any microformat property (e.g. 'fn' in hCard) there are get_X, set_X, add_X and clear_X methods defined.

\*(C`get_X\*(C': for singular properties, returns the value of property X. For plural properties, returns a list of values if called in list context, or the first value otherwise.

\*(C`set_X\*(C': for singular properties, sets the value of property X to the first given parameter. For plural properties, sets the values of property X to the list of parameters. This feature is deprecated and will be removed in a future release.

\*(C`add_X\*(C': for singular properties, sets the value of property X to the first given parameter, but croaks if X is already set. For concatenated singular properties, concatenates to the end of any existing value of X. For plural properties, adds any given parameters to the list of values of property X. This feature is deprecated and will be removed in a future release.

\*(C`clear_X\*(C': removes any values of property X, but croaks if the property is a required property. This feature is deprecated and will be removed in a future release.

For example, an HTML::Microformats::hCard object will have a method called get_fn which gets the value of the hCard's \*(L"fn\*(R" property, a method called set_fn which sets it, a method called add_fn which also sets it (but croaks if it's already set), and a method called clear_fn which croaks if called (because \*(L"fn\*(R" is a required property).

Deprecated features: the \*(C`set_X\*(C', \*(C`add_X\*(C' and \*(C`clear_X\*(C' methods are deprecated and will be removed soon. In general you should treat objects which are instances of HTML::Microformats::Format as read-only.

Public Methods - Other

This method may be called as a class or object method. It returns various information about the definition of this microformat (e.g. what is the root class, which properties exist, etc). You may need to do some digging to figure out what everything means. This method may be called as a class or object method. It returns \s-1HTML\s0 profile URIs which indicate the presence of this microformat. Returns the parsing context (as supplied to \*(C`new\*(C'). Returns a hashref of object data. This is a reference to the live data inside the object. Any changes to the returned hashref will change the values inside the object. Returns the root element. Shortcut for \*(C`$object->context->cache\*(C'. Returns a blank node identifier or identifying \s-1URI\s0 for the object. If $trine_obj is true, the return value is an RDF::Trine::Node object. Otherwise, it's a string (using the '_:' convention to identify blank nodes). If $role is undefined, then returns the identifier for the object itself. If it's defined then it returns an identifier for a resource with a fixed relationship to the object.

  $identifier_for_business_card  = $hcard->id;
  $identifier_for_person         = $hcard->id(undef, 'holder');

Given an RDF::Trine::Model object, adds relevant data to the model. Creates a fresh, new RDF::Trine::Model object, containing relevant data. As \*(C`model\*(C' but returns a string.

BUGS

Please report any bugs to <http://rt.cpan.org/>.

RELATED TO HTML::Microformats::Format…

HTML::Microformats.

AUTHOR

Toby Inkster <[email protected]>.

COPYRIGHT AND LICENCE

Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER OF WARRANTIES

\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.