Permalink
Browse files

s/$out/$res/ in POD

  • Loading branch information...
1 parent 3f61fd0 commit 0308a6d9f8007c2a164f88354e6235933c9be30a @tomill committed Mar 3, 2010
Showing with 26 additions and 26 deletions.
  1. +9 −9 lib/Template/Semantic.pm
  2. +4 −4 lib/Template/Semantic/Cookbook.pod
  3. +13 −13 lib/Template/Semantic/Document.pm
View
@@ -131,12 +131,12 @@ B<This is beta release. Your feedback is welcome.>
Constructs a new C<Template::Semantic> object.
my $ts = Template::Semantic->new;
- my $out = $ts->process(...);
+ my $res = $ts->process(...);
If you do not want to change the options from the defaults, you may skip
C<new()> and call C<process()> directly:
- my $out = Template::Semantic->process(...);
+ my $res = Template::Semantic->process(...);
Set %options if you want to change parser options:
@@ -169,25 +169,25 @@ See L<XML::LibXML::Parser/PARSER OPTIONS> for details.
=back
-=item $out = $ts->process($filename, \%vars)
+=item $res = $ts->process($filename, \%vars)
-=item $out = $ts->process(\$text, \%vars)
+=item $res = $ts->process(\$text, \%vars)
-=item $out = $ts->process(FH, \%vars)
+=item $res = $ts->process(FH, \%vars)
Process a template and return a L<Template::Semantic::Document> object.
The first parameter is the input template, which may take one of several forms:
# filename
- my $out = Template::Semantic->process('template.html', $vars);
+ my $res = Template::Semantic->process('template.html', $vars);
# text reference
- my $out = Template::Semantic->process(\'<html><body>foo</body></html>', $vars);
+ my $res = Template::Semantic->process(\'<html><body>foo</body></html>', $vars);
# file handle
- my $out = Template::Semantic->process($fh, $vars);
- my $out = Template::Semantic->process(\*DATA, $vars);
+ my $res = Template::Semantic->process($fh, $vars);
+ my $res = Template::Semantic->process(\*DATA, $vars);
The second parameter is a value set to bind the template. $vars should be a
hash-ref of selectors and corresponding values. See the L</SELECTOR> and
@@ -212,11 +212,11 @@ Output:
You should use the module like Template::Toolkit ;)
But if you want to use this module anyway,
- my $out = $ts->process(\*DATA, {
+ my $res = $ts->process(\*DATA, {
'name' => 'Foo & Co.',
});
- my $body = $out->dom->documentElement->findvalue('//*[@class="body"]');
+ my $body = $res->dom->documentElement->findvalue('//*[@class="body"]');
__DATA__
<html>
@@ -282,10 +282,10 @@ It is possible though is tricky.
# Process wrapper.html,
# embed this innerHTML to wrapper.html's <div id="content">
- my $out = $ts->process($wrapper, { '#content' => \$_ });
+ my $res = $ts->process($wrapper, { '#content' => \$_ });
# Insert result(as XML::LibXML::Element) after me.
- $node->addSibling($out->dom->documentElement);
+ $node->addSibling($res->dom->documentElement);
# And delete me.
return undef;
@@ -299,11 +299,11 @@ Template::Semantic::Document - Template::Semantic Result object
=head1 SYNOPSIS
- my $out = Template::Semantic->process('template.html', {
+ my $res = Template::Semantic->process('template.html', {
'title, h1' => 'foo',
});
- my $out = Template::Semantic->process('template.html', {
+ my $res = Template::Semantic->process('template.html', {
'.foo, .bar' => 'baz',
'.mee@class' => 'moo',
})->process({
@@ -314,25 +314,25 @@ Template::Semantic::Document - Template::Semantic Result object
'.bar' => sub { lc },
});
- print $out;
- print $out->as_string; # same as avobe
+ print $res;
+ print $res->as_string; # same as avobe
=head1 METHODS
=over 4
-=item $out = $out->process( \%vars )
+=item $res = $res->process( \%vars )
Process again to the result and returns L<Template::Semantic::Document>
object again. So you can chain
Template::Semantic->process(...)->process(...)
-=item "$out" (stringify)
+=item "$res" (stringify)
Calls C<as_string()> internally.
-=item $html = $out->as_string( %options )
+=item $html = $res->as_string( %options )
Returns the result as XHTML/XML.
@@ -343,7 +343,7 @@ Returns the result as XHTML/XML.
Default value is true. Even if DTD is not defined in the template, outputs as XHTML.
When sets C<is_xhtml> false, skip this effect.
- my $out = $ts->process(\<<END);
+ my $res = $ts->process(\<<END);
<div>
<img src="foo" />
<br />
@@ -352,15 +352,15 @@ When sets C<is_xhtml> false, skip this effect.
END
;
- print $out;
+ print $res;
<div>
<img src="foo" />
<br />
<textarea></textarea>
</div>
- print $out->as_string(is_xhtml => 0);
+ print $res->as_string(is_xhtml => 0);
<div>
<img src="foo"/>
@@ -370,10 +370,10 @@ When sets C<is_xhtml> false, skip this effect.
=back
-=item $dom = $out->dom()
+=item $dom = $res->dom()
- my $out = Template::Semantic->process($template, ...);
- my $dom = $out->dom;
+ my $res = Template::Semantic->process($template, ...);
+ my $dom = $res->dom;
my $root = $dom->documentElement; # get root element
Gets the result as L<XML::LibXML::Document>.

0 comments on commit 0308a6d

Please sign in to comment.