Template::TAL::Output::HTML - output templates as HTML


Template-TAL documentation Contained in the Template-TAL distribution.

Index


Code Index:

NAME

Top

Template::TAL::Output::HTML - output templates as HTML

SYNOPSIS

Top

  my $tt = Template::TAL->new( output => "Template::TAL::Output::HTML" );
  print $tt->process('foo.tal');

DESCRIPTION

Top

This is a Template::TAL output filter that produces HTML output, instead of XML. It does nothing clever, I just use the toStringHTML function of XML::LibXML.

COPYRIGHT

Top


Template-TAL documentation Contained in the Template-TAL distribution.
package Template::TAL::Output::HTML;
use warnings;
use strict;
use Carp qw( croak );
use base qw( Template::TAL::Output );
use Encode;

sub render {
  my ($self, $dom) = @_;
  $dom->setEncoding( $self->charset );
  return Encode::encode( $self->charset, $dom->toStringHTML() );
}

1;