NAME
HTML::Microformats::_context - context for microformat objects
DESCRIPTION
Microformat objects need context when being parsed to properly make sense. For example, a base URI is needed to resolve relative URI references, and a full copy of the DOM tree is needed to implement the include pattern.
Constructor
$context = HTML::Microformats::_context->new($dom, $baseuri)
-
Creates a new context from a DOM document and a base URI.
$dom will be modified, so if you care about keeping it pristine, make a clone first.
Public Methods
$context->cache
-
A Microformat cache for the context. This prevents the same microformat object from being parsed and reparsed - e.g. an adr parsed first in its own right, and later as a child of an hCard.
$context->document
-
Return the modified DOM document.
$context->uri( [$relative_reference] )
-
Called without a parameter, returns the context's base URI.
Called with a parameter, resolves the URI reference relative to the base URI.
$context->make_bnode( [$element] )
-
Mint a blank node identifier or a URI.
If an element is passed, this may be used to construct a URI in some way.
$context->profiles
-
A list of profile URIs declared by the document.
$context->has_profile(@profiles)
-
Returns true iff any of the profiles in the array are declared by the document.
$context->add_profile(@profiles)
-
Declare these additional profiles.
BUGS
Please report any bugs to http://rt.cpan.org/.
SEE ALSO
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT
Copyright 2008-2010 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 320:
You forgot a '=back' before '=head1'