GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Template::Semantic::Document(3) User Contributed Perl Documentation Template::Semantic::Document(3)

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

$res = $res->process( \%vars )
Process again to the result and returns Template::Semantic::Document object again. So you can chain

  my $res = Template::Semantic->process(...)->process(...)
    
"$res" (stringify)
Calls "as_string()" internally.
$html = $res->as_string( %options )
Returns the result as XHTML/XML.
is_xhtml => bool

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>
    
$dom = $res->dom()
  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>
2010-03-03 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.