HTML::HTML5::Microdata::ToRDFa - rewrite HTML5+Microdata into XHTML+RDFa


HTML-HTML5-Microdata-ToRDFa documentation  | view source Contained in the HTML-HTML5-Microdata-ToRDFa distribution.

Index


NAME

Top

HTML::HTML5::Microdata::ToRDFa - rewrite HTML5+Microdata into XHTML+RDFa

SYNOPSIS

Top

 use HTML::HTML5::Microdata::ToRDFa;
 my $rdfa = HTML::HTML5::Microdata::ToRDFa->new($html, $baseuri);
 print $rdfa->get_string;

DESCRIPTION

Top

This module may be used to convert HTML documents marked up with Microdata into XHTML+RDFa (which is more widely implemented by consuming software).

If the input document uses a mixture of Microdata and RDFa, the semantics of the output document may be incorrect.

Constructors

$rdfa = HTML::HTML5::Microdata::ToRDFa->new($html, $baseuri)

$html may be an HTML document (as a string) or an XML::LibXML::Document object.

$baseuri is the base URI for resolving relative URI references. If $html is undefined, then this module will fetch $baseuri to obtain the document to be converted.

Public Methods

$rdfa->get_string

Get the document converted to RDFa as a string. This will be well-formed XML, but not necessarily valid XHTML.

$rdfa->get_dom

Get the document converted to XHTML+RDFa as an XML::LibXML::Document object.

Note that each time get_string and get_dom are called, the conversion process is run from scratch. Repeatedly calling these methods is wasteful.

BUGS

Top

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

SEE ALSO

Top

HTML::HTML5::Microdata::Parser, RDF::RDFa::Parser.

http://www.perlrdf.org/.

AUTHOR

Top

Toby Inkster <tobyink@cpan.org>.

COPYRIGHT AND LICENCE

Top


HTML-HTML5-Microdata-ToRDFa documentation  | view source Contained in the HTML-HTML5-Microdata-ToRDFa distribution.