The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Object::DOM::Declaration - HTML Object DOM DTD

SYNOPSIS

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

VERSION

    v0.2.0

DESCRIPTION

This module implements an HTTML declaration for the DOM. It inherits from HTML::Object::Declaration and HTTML::Object::DOM::Node

INHERITANCE

    +---------------------------+     +---------------------------+     +-------------------------+     +--------------------------------+
    |   HTML::Object::Element   | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Declaration |
    +---------------------------+     +---------------------------+     +-------------------------+     +--------------------------------+
      |                                                                                                   ^
      |                                                                                                   |
      v                                                                                                   |
    +---------------------------+                                                                         |
    | HTML::Object::Declaration | ------------------------------------------------------------------------+
    +---------------------------+

PROPERTIES

Inherits properties from its parents HTML::Object::Declaration and HTML::Object::DOM::Node

internalSubset

Read-only.

A string of the internal subset, or undef if there is none. Eg "<!ELEMENT foo (bar)>".

See also Mozilla documentation

name

Read-only.

A string, eg "html" for <!DOCTYPE HTML>.

See also Mozilla documentation

notations

Always returns undef under perl.

Normally, under JavaScript, this returns s NamedNodeMap with notations declared in the DTD.

See also Mozilla documentation

publicId

Read-only.

A string, eg "-//W3C//DTD HTML 4.01//EN", empty string for HTML5.

See also Mozilla documentation

systemId

Read-only.

A string, eg "http://www.w3.org/TR/html4/strict.dtd", empty string for HTML5.

See also Mozilla documentation

METHODS

Inherits methods from its parents HTML::Object::Declaration and HTML::Object::DOM::Node

after

Inserts a set of Node or string objects in the children list of the DocumentType's parent, just after the DocumentType object.

Example:

    my $docType = $doc->implementation->createDocumentType("html", "", "");
    my $myDoc = $doc->implementation->createDocument("", "", $docType);

    $docType->after($doc->createElement('html'));

    $myDoc->childNodes;
    # NodeList [<!DOCTYPE html>, <html>]

See also Mozilla documentation

before

Inserts a set of Node or string objects in the children list of the DocumentType's parent, just before the DocumentType object.

Example:

    my $docType = $doc->implementation->createDocumentType("html", "", "");
    my $myDoc = $doc->implementation->createDocument("", "", $docType);

    $docType->before( $doc->createComment('<!--[if !IE]> conditional comment <![endif]-->') );

    $myDoc->childNodes;
    # NodeList [<!--[if !IE]> conditional comment <![endif]-->, <!DOCTYPE html>]

See also Mozilla documentation

remove

Removes the object from its parent children list.

Example:

    $doc->doctype; # "<!DOCTYPE html>'
    $doc->doctype->remove();
    $doc->doctype; # null

See also Mozilla documentation

replaceWith

Replaces the document type with a set of given nodes.

Example:

    my $svg_dt = $doc->implementation->createDocumentType(
        'svg:svg',
        '-//W3C//DTD SVG 1.1//EN',
        'http://www->w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'
    );

    $doc->doctype->replaceWith($svg_dt);

See also Mozilla documentation

string_value

Always returns undef

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation

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.