Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Template::Semantic::DoUsernContributed Perl DocTemplate::Semantic::Document(3)

NAME
       Template::Semantic::Document - Template::Semantic Result	object

SYNOPSIS
	 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

METHODS
       $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.

	   o   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.

SEE ALSO
       Template::Semantic, XML::LibXML::Document

AUTHOR
       Naoki Tomita <tomita@cpan.org>

perl v5.24.1			  2010-03-03   Template::Semantic::Document(3)

NAME | SYNOPSIS | METHODS | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Template::Semantic::Document&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help