HTML::O...aration(3)
okay so bestie, welcome to the HTML::Object::DOM::Declaration(3) page β yes, the manual name is right there at the top, and this one comes from User Contributed Perl Documentation. We're doing DTD declaration content today, and it's lowkey iconic. π
π 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 β that's the version, no cap.
π¦ DESCRIPTION π¦
This module implements an HTTML declaration for the DOM. It inherits from HTML::Object::Declaration and HTTML::Object::DOM::Node.
π INHERITANCE π
the family tree is giving royal lineage, so here it is exactly:
+---------------------------+ +---------------------------+ +-------------------------+ +--------------------------------+
| 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: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/internalSubset
π§ name
Read-only.
A string, eg "html" for <!DOCTYPE HTML>.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/name
π¦ notations
Always returns "undef" under perl.
Normally, under JavaScript, this returns s "NamedNodeMap" with notations declared in the DTD.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/notations
π publicId
Read-only.
A string, eg "-//W3C//DTD HTML 4.01//EN", empty string for HTML5.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/publicId
π systemId
Read-only.
A string, eg "http://www.w3.org/TR/html4/strict.dtd", empty string for HTML5.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/systemId
π₯ 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: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/after
β 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: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/before
β remove
Removes the object from its parent children list.
Example:
$doc->doctype; # "<!DOCTYPE html>'
$doc->doctype->remove();
$doc->doctype; # null
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/remove
β 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: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType/replaceWith
β string_value
Always returns "undef".
π AUTHOR π
Jacques Deguest (jack@deguest.jp) β iconic behavior, honestly.
π«Ά SEE ALSO π«Ά
Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/DocumentType
π 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.
okay, that's the whole page! Cute sign-off time: source/version perl v5.42.2, date 2026-02-15, and the footer's manual name is HTML::O...aration(3). Stay slaying, bestie. π«Ά
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms