HTML::O...entation(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸŽ€ HTML::Object::DOM::Implementation πŸŽ€

okay bestie, welcome to HTML::O...entation(3) from the User Contributed Perl Documentation crew πŸ’– this is the whole page for HTML::Object::DOM::Implementation, and we're gonna get into it with zero skipped details, fr fr.


🌸 NAME 🌸

HTML::Object::DOM::Implementation β€” HTML Object DOM Implementation. literally what it says on the tin ✨


✨ SYNOPSIS ✨

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

πŸ¦‹ VERSION πŸ¦‹

v0.2.0 β€” that's the version, bestie πŸ’œ


🌈 DESCRIPTION 🌈

The Implementation interface represents an object providing methods which are not dependent on any particular document. You get one back from the implementation property in HTML::Object::DOM::Document. that's the vibe 🫢


πŸ’€ PROPERTIES πŸ’€

There are no properties. none. zero. zilch. the property section is empty and we respect it πŸŽ€


πŸ’… METHODS πŸ’…

okay so here come the methods, bestie β€” keep up, they're not scary, i promise 😭

πŸ“ createDocument πŸ“

Provided with a namespace URI (which could be an empty string) and a qualified name for the top element, which should be "html", and optionally a document type definition object, and this creates and returns a document object.

Normally, this method is used to create an XML document, but we do not support XML, so this is basically an alias for createHTMLDocument.

The namespaceURI argument is completely ignored, so do not bother, and the qualified name can only be "html".

Example:

my $doc = $doc->implementation->createDocument( $namespaceURI, $qualifiedNameStr, $documentType_object );

my $doc = $doc->implementation->createDocument( '', 'html' );
my $body = $doc->createElement( 'body' );
$body->setAttribute( 'id', 'abc' );
$doc->documentElement->appendChild( $body );
say( $doc->getElementById( 'abc') ); # [object HTMLBodyElement]

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument

🧚 createDocumentType 🧚

Provided with a qualified name, which should be "html", and an optional public id and system id, both of which are ignored, and this creates and returns a document type object.

Example:

my $doctype = $doc->implementation->createDocumentType( 'html', $publicId, $systemId );

my $dt = $doc->implementation->createDocumentType( 'svg:svg', '-//W3C//DTD SVG 1.1//EN', 'http://www->w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' );
my $d = $doc->implementation->createDocument( 'http://www->w3.org/2000/svg', 'svg:svg', $dt );
say( $d->doctype->publicId); # -//W3C//DTD SVG 1.1//EN

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType

πŸ¦„ createHTMLDocument πŸ¦„

Creates and returns an HTML Document. iconic behavior, honestly πŸ‘‘

Example:

# Assuming $title is "Demo"
my $newDoc = $doc->implementation->createHTMLDocument( $title );

Result:

<!DOCTYPE html>
<html>
    <head><title>Demo</title></head>
    <body></body>
</html>

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument

πŸ”₯ hasFeature πŸ”₯

This always returns true. no cap.

Its original purpose is to return a boolean value indicating if a given feature is supported or not. However, this function has been unreliable and kept for compatibility purpose alone: except for SVG-related queries.

Example:

my $flag = $doc->implementation->hasFeature( $feature, $version );

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature


πŸ‘‘ AUTHOR πŸ‘‘

Jacques Deguest <jack@deguest.jp> β€” yes, that's the author, bestie πŸ’–


🌟 SEE ALSO 🌟

Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation


Copyright(c) 2022 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.


and that's the whole page, bestie 🫢 signed off from perl v5.42.2, dated 2026-02-15, on HTML::O...entation(3). periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from