| Template-Semantic documentation | view source | Contained in the Template-Semantic distribution. |
Template::Semantic::Document - Template::Semantic Result object
my $res = Template::Semantic->process('template.html', {
'title, h1' => 'foo',
});
my $res = Template::Semantic->process('template.html', {
...
})->process({
...
})->process({
...
});
print $res;
print $res->as_string; # same as avobe
Process again to the result and returns Template::Semantic::Document object again. So you can chain
my $res = Template::Semantic->process(...)->process(...)
Calls as_string() internally.
Returns the result as XHTML/XML.
Default value is true. Even if DTD is not defined in the template,
outputs as XHTML. When sets is_xhtml false, skip this effect.
my $res = $ts->process(\<<END);
<div>
<img src="foo" />
<br />
<textarea></textarea>
</div>
END
;
print $res;
# <div>
# <img src="foo" />
# <br />
# <textarea></textarea>
# </div>
print $res->as_string(is_xhtml => 0);
# <div>
# <img src="foo"/>
# <br/>
# <textarea/>
# </div>
my $res = Template::Semantic->process($template, ...); my $dom = $res->dom; my $root = $dom->documentElement; # get root element
Gets the result as XML::LibXML::Document.
Template::Semantic, XML::LibXML::Document
Naoki Tomita <tomita@cpan.org>
| Template-Semantic documentation | view source | Contained in the Template-Semantic distribution. |