.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::Microformats::DocumentContext 3pm" .TH HTML::Microformats::DocumentContext 3pm "2021-09-12" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::Microformats::DocumentContext \- context for microformat objects .SH "DESCRIPTION" .IX Header "DESCRIPTION" Microformat objects need context when being parsed to properly make sense. For example, a base \s-1URI\s0 is needed to resolve relative \s-1URI\s0 references, and a full copy of the \s-1DOM\s0 tree is needed to implement the include pattern. .SS "Constructor" .IX Subsection "Constructor" .ie n .IP """$context = HTML::Microformats::DocumentContext\->new($dom, $baseuri)""" 4 .el .IP "\f(CW$context = HTML::Microformats::DocumentContext\->new($dom, $baseuri)\fR" 4 .IX Item "$context = HTML::Microformats::DocumentContext->new($dom, $baseuri)" Creates a new context from a \s-1DOM\s0 document and a base \s-1URI.\s0 .Sp \&\f(CW$dom\fR will be modified, so if you care about keeping it pristine, make a clone first. .SS "Public Methods" .IX Subsection "Public Methods" .ie n .IP """$context\->cache""" 4 .el .IP "\f(CW$context\->cache\fR" 4 .IX Item "$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. .ie n .IP """$context\->document""" 4 .el .IP "\f(CW$context\->document\fR" 4 .IX Item "$context->document" Return the modified \s-1DOM\s0 document. .ie n .IP """$context\->uri( [$relative_reference] )""" 4 .el .IP "\f(CW$context\->uri( [$relative_reference] )\fR" 4 .IX Item "$context->uri( [$relative_reference] )" Called without a parameter, returns the context's base \s-1URI.\s0 .Sp Called with a parameter, resolves the \s-1URI\s0 reference relative to the base \s-1URI.\s0 .ie n .IP """$context\->document_uri""" 4 .el .IP "\f(CW$context\->document_uri\fR" 4 .IX Item "$context->document_uri" Returns a \s-1URI\s0 representing the document itself. (Usually the same as the base \s-1URI.\s0) .ie n .IP """$context\->make_bnode( [$element] )""" 4 .el .IP "\f(CW$context\->make_bnode( [$element] )\fR" 4 .IX Item "$context->make_bnode( [$element] )" Mint a blank node identifier or a \s-1URI.\s0 .Sp If an element is passed, this may be used to construct a \s-1URI\s0 in some way. .ie n .IP """$context\->profiles""" 4 .el .IP "\f(CW$context\->profiles\fR" 4 .IX Item "$context->profiles" A list of profile URIs declared by the document. .ie n .IP """$context\->has_profile(@profiles)""" 4 .el .IP "\f(CW$context\->has_profile(@profiles)\fR" 4 .IX Item "$context->has_profile(@profiles)" Returns true iff any of the profiles in the array are declared by the document. .ie n .IP """$context\->add_profile(@profiles)""" 4 .el .IP "\f(CW$context\->add_profile(@profiles)\fR" 4 .IX Item "$context->add_profile(@profiles)" Declare these additional profiles. .ie n .IP """$context\->representative_hcard""" 4 .el .IP "\f(CW$context\->representative_hcard\fR" 4 .IX Item "$context->representative_hcard" Returns the hCard for the person that is \*(L"represented by\*(R" the page (in the \s-1XFN\s0 sense), or undef if no suitable hCard could be found .ie n .IP """$context\->representative_person_id( [$as_trine] )""" 4 .el .IP "\f(CW$context\->representative_person_id( [$as_trine] )\fR" 4 .IX Item "$context->representative_person_id( [$as_trine] )" Equivalent to calling \f(CW\*(C`$context\->representative_hcard\->id($as_trine, \*(Aqholder\*(Aq)\*(C'\fR, however magically works even if \f(CW$context\fR\->representative_hcard returns undef. .ie n .IP """$context\->contact_hcard""" 4 .el .IP "\f(CW$context\->contact_hcard\fR" 4 .IX Item "$context->contact_hcard" Returns the hCard for the contact person for the page, or undef if none can be found. .Sp hCards are considered potential contact hCards if they are contained within an \s-1HTML\s0
tag, or their root element is an
tag. If there are several such hCards, then the one in the shallowest
tag is used; if there are several
tags equally shallow, the first is used. .ie n .IP """$context\->contact_person_id( [$as_trine] )""" 4 .el .IP "\f(CW$context\->contact_person_id( [$as_trine] )\fR" 4 .IX Item "$context->contact_person_id( [$as_trine] )" Equivalent to calling \f(CW\*(C`$context\->contact_hcard\->id($as_trine, \*(Aqholder\*(Aq)\*(C'\fR, however magically works even if \f(CW$context\fR\->contact_hcard returns undef. .SH "BUGS" .IX Header "BUGS" Please report any bugs to . .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::Microformats .SH "AUTHOR" .IX Header "AUTHOR" Toby Inkster . .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" Copyright 2008\-2012 Toby Inkster .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "DISCLAIMER OF WARRANTIES" .IX Header "DISCLAIMER OF WARRANTIES" \&\s-1THIS PACKAGE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0