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


Manual Reference Pages  -  MOJO::DOM::HTML (3)

.ds Aq ’

NAME

Mojo::DOM::HTML - HTML/XML engine

CONTENTS

SYNOPSIS



  use Mojo::DOM::HTML;

  # Turn HTML into DOM tree
  my $html = Mojo::DOM::HTML->new;
  $html->parse(<div><p id="a">Test</p><p id="b">123</p></div>);
  my $tree = $html->tree;



DESCRIPTION

Mojo::DOM::HTML is the HTML/XML engine used by Mojo::DOM, based on the HTML Living Standard <https://html.spec.whatwg.org> and the Extensible Markup Language (XML) 1.0 <http://www.w3.org/TR/xml/>.

ATTRIBUTES

Mojo::DOM::HTML implements the following attributes.

    tree



  my $tree = $html->tree;
  $html    = $html->tree([root]);



Document Object Model. Note that this structure should only be used very carefully since it is very dynamic.

    xml



  my $bool = $html->xml;
  $html    = $html->xml($bool);



Disable HTML semantics in parser and activate case-sensitivity, defaults to auto-detection based on XML declarations.

METHODS

Mojo::DOM::HTML inherits all methods from Mojo::Base and implements the following new ones.

    parse



  $html = $html->parse(<foo bar="baz">I X Mojolicious!</foo>);



Parse HTML/XML fragment.

    render



  my $str = $html->render;



Render DOM to HTML/XML.

SEE ALSO

Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOJO::DOM::HTML (3) 2016-03-15

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