Template::Declare::TagSet::HTML - Tag set for HTML
# normal use on the user side: use base 'Template::Declare'; use Template::Declare::Tags 'HTML'; template foo => sub { html { body { } } }; # in Template::Declare::Tags: use Template::Declare::TagSet::HTML; my $tagset = Template::Declare::TagSet::HTML->new( { package => 'html', namespace => 'html' } ); my $list = $tagset->get_tag_list(); print "@$list"; my $altern = $tagset->get_alternate_spelling('tr'); if ( defined $altern ) { print $altern; } if ( $tagset->can_combine_empty_tags('img') ) { print "<img src='blah.gif' />"; }
Template::Declare::TagSet::HTML isa Template::Declare::TagSet
$obj = Template::Declare::TagSet::HTML->new({ namespace => $XML_namespace, package => $Perl_package })
Constructor inherited from Template::Declare::TagSet.
$list = $obj->get_tag_list()
Returns an array ref for the tag names.
Out of the box, Template::Declare::TagSet::HTML returns the :html2 :html3 :html4 :netscape and :form tagsets from CGI.pm.
Template::Declare::TagSet::HTML
:html2 :html3 :html4 :netscape
:form
$bool = $obj->get_alternate_spelling($tag)
Returns the alternative spelling for a given tag if any or undef otherwise. Currently, tr is mapped to row, td is mapped to cell, and base is mapped to html_base.
tr
row
td
cell
base
html_base
Because tr is reserved by the perl interpreter for the operator of that name. We can't override it. And we override td as well so as to keep consistent.
For similar reasons, 'base' often gives us trouble too ;)
$bool = $obj->can_combine_empty_tags($tag)
Agent Zhang <agentzh@yahoo.cn>
Template::Declare::TagSet, Template::Declare::TagSet::XUL, Template::Declare::TagSet::RDF, Template::Declare::Tags, Template::Declare.
To install Template::Declare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Declare
CPAN shell
perl -MCPAN -e shell install Template::Declare
For more information on module installation, please visit the detailed CPAN module installation guide.