HTML::Microformats::Format::XOXO(3pm) | User Contributed Perl Documentation | HTML::Microformats::Format::XOXO(3pm) |
HTML::Microformats::Format::XOXO - the XOXO microformat
use HTML::Microformats::DocumentContext; use HTML::Microformats::Format::XOXO; my $context = HTML::Microformats::DocumentContext->new($dom, $uri); my @objects = HTML::Microformats::Format::XOXO->extract_all( $dom->documentElement, $context); my $list = $objects[0]; # Let's assume this structure: # # <ol class="xoxo people"> # <li> # <a href="http://tobyinkster.co.uk/">Toby Inkster</a> # <dl> # <dt>Eye colour</dt> # <dd>Blue</dt> # <dt>Hair colour</dt> # <dd>Blonde</dt> # <dd>Brown</dt> # </dl> # </li> # </ol> print $list->data->as_array->[0]->get_link_title; # Toby Inkster print $list->data->as_array->[0]->get_properties ->get_value('Eye colour')->[0]; # Blue print join '-', $list->data->as_array->[0] ->get_value('Hair colour'); # Blonde-Brown
HTML::Microformats::Format::XOXO inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc.
Unlike most of the modules in the HTML::Microformats suite, the "data" method returns an HTML::Microformats::Format::XOXO::UL, HTML::Microformats::Format::XOXO::OL or HTML::Microformats::Format::XOXO::DL object, rather than a plain hashref.
Represents an HTML DL element.
Represents an HTML UL element.
Represents an HTML OL element.
Represents an HTML LI element.
This has an identical interface to HTML::Microformats::Format::XOXO::LI.
HTML::Microformats::Format::XOXO supports XOXO as described at <http://microformats.org/wiki/xoxo>.
XOXO does not map especially naturally to RDF, so this module returns the data as a JSON literal using the property <http://open.vocab.org/terms/json>.
Please report any bugs to <http://rt.cpan.org/>.
HTML::Microformats::Format, HTML::Microformats.
Toby Inkster <tobyink@cpan.org>.
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.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2021-09-12 | perl v5.32.1 |