HTML::HTML5::DOM::HTMLDocument - implementation of the HTMLDocument interface of the HTML DOM
HTML::HTML5::DOM::HTMLDocument is an implementation of the HTMLDocument interface of the HTML DOM. See HTML::HTML5::DOM for a list of the conventions that have been used when translating the DOM to Perl.
This class applies to the following HTML elements.
HTML::HTML5::DOM::HTMLDocument inherits methods from the following Perl classes.
HTML::HTML5::DOMutil::FancyISA
XML::LibXML::Augment::Document
XML::LibXML::Augment::Node
XML::LibXML::Document
XML::LibXML::Node
XML::LibXML::QuerySelector
As well as its inherited methods, this class provides the following methods.
AUTOLOAD
See perlsub if you don't know the significance of the AUTOLOAD function. HTML::HTML5::DOM::HTMLDocument will pass through unknown menthods to the document's root element. So for example, $document->setAttribute will actually set an attribute on the document's root element.
$document->setAttribute
URL
Get/set the document's URL.
anchors
Returns all <a> with a "name" attribute found in the document.
<a>
applets
Returns all <applet> elements (and <object codetype="application/java"> elements) found in the document.
<applet>
<object codetype="application/java">
body
Returns the document body.
characterSet
Returns the character set that the document was parsed as (if known). As charset can be used as a setter, this is not necessarily the same as charset.
charset
Getter/setter for the document encoding.
compatMode
Returns the string 'quirks' or 'limited quirks' or undef.
cookie
Ostensibly returns cookies associated with the document, but in this implementation always returns an empty string.
defaultCharset
Returns the string 'utf-8'.
doctype
This method is not implemented yet, but will eventually support the functionality defined in DOM Core 3.
documentURI
Alias for URL.
domConfig
Ostensibly an object representing settings which will be used when normalize is called. In practise, just returns an empty hashref that you can do with what you like.
normalize
domain
The documents URL's host name.
embeds
Returns all <embed> elements found in the document.
<embed>
forms
Returns all forms found in the document.
getElementById
The world-famous getElementById method. The default XML::LibXML implementation of this does not work with HTML::HTML5::Parser documents, because HTML::HTML5::Parser lacks the ability to inform libxml which element to use as an ID. (libxml defaults to xml:id.) This implementation is XPath-based, thus slower.
head
Returns the document head.
images
Returns all images found in the document.
implementation
Returns the same as HTML::HTML5::DOM->getDOMImplementation.
inputEncoding
lastModified
Ostensibly returns the current document readiness, but this implementation always returns the string 'complete'.
links
Returns all <a> and <area> elements with an "href" attribute found in the document.
<area>
normalizeDocument
Alias for normalize.
p5_tables
Returns all tables found in the document.
plugins
referer
An alias for 'referrer' provided for the benefit of those who learnt to spell by reading HTTP RFCs.
referrer
Ostensibly returns the HTTP referer for the document, but in this implementation always returns an empty string.
renameNode
scripts
Returns all scripts found in the document.
strictErrorChecking
DOM seems a little vague as to what exactly constitutes 'strict'. This returns false.
title
Returns the document's title, from its <title> element, with a little whitespace canonicalisation.
<title>
xmlEncoding
xmlStandalone
Called with an argument, acts as setStandalone; called without an argument, acts as standalone.
setStandalone
standalone
xmlVersion
Returrns undef for documents parsed using an HTML parser; 1.0 or 1.1 if parsed using libxml.
http://rt.cpan.org/Dist/Display.html?Queue=HTML-HTML5-DOM.
HTML::HTML5::DOM.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012, 2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install HTML::HTML5::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::HTML5::DOM
CPAN shell
perl -MCPAN -e shell install HTML::HTML5::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.