The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTML::Object::Document - HTML Object Document Class

SYNOPSIS

    use HTML::Object::Document;
    my $doc = HTML::Object::Document->new || 
        die( HTML::Object::Document->error, "\n" );

VERSION

    v0.2.0

DESCRIPTION

This module represents an HTML document and is instantiated by HTML::Object. It is the top of the objects hierarchy.

INHERITANCE

    +-----------------------+     +------------------------+
    | HTML::Object::Element | --> | HTML::Object::Document |
    +-----------------------+     +------------------------+

METHODS

append

"append" inserts a set of element objects or HTML string after the last child of the document.

This method appends a child to a Document. To append to an arbitrary element in the tree, see "append" in HTML::Object::XQuery.

An HTML::Object::HierarchyRequestError exception is thrown when the element cannot be inserted at the specified point in the hierarchy.

See also Mozilla documentation

as_string

Returns the html document as a string, and in its original format except for the parts you modified.

as_xml

Returns the document as an xml document, which is kind of an old way to present html document.

declaration

Sets or gets the document DTD object

uri

Because this is a perl framework, there is no URI associated with this object by default, but you can set one yourself, or it will be set automatically for you when you use "parse_url" in HTML::Object

EVENT & EVENT HANDLERS

No event or event handlers are implemented for HTML::Object::Document. If you want event handlers, use HTML::Object::DOM objects instead.

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

https://html.spec.whatwg.org/multipage/syntax.html#the-doctype

https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode

HTML::Object, HTML::Object::Attribute, HTML::Object::Boolean, HTML::Object::Closing, HTML::Object::Collection, HTML::Object::Comment, HTML::Object::Declaration, HTML::Object::Document, HTML::Object::Element, HTML::Object::Exception, HTML::Object::Literal, HTML::Object::Number, HTML::Object::Root, HTML::Object::Space, HTML::Object::Text, HTML::Object::XQuery

COPYRIGHT & LICENSE

Copyright (c) 2021 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.