NAME
HTML::HTML5::DOM::HTMLDocument - implementation of the HTMLDocument interface of the HTML DOM
DESCRIPTION
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.
HTML Elements
This class applies to the following HTML elements.
Inheritance
HTML::HTML5::DOM::HTMLDocument inherits methods from the following Perl classes.
Additional Methods
As well as its inherited methods, this class provides the following methods.
AUTOLOADSee 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->setAttributewill actually set an attribute on the document's root element.URLGet/set the document's URL.
anchorsReturns all
<a>with a "name" attribute found in the document.appletsReturns all
<applet>elements (and<object codetype="application/java">elements) found in the document.bodyReturns the document body.
characterSetReturns the character set that the document was parsed as (if known). As
charsetcan be used as a setter, this is not necessarily the same ascharset.charsetGetter/setter for the document encoding.
compatModeReturns the string 'quirks' or 'limited quirks' or undef.
cookieOstensibly returns cookies associated with the document, but in this implementation always returns an empty string.
defaultCharsetReturns the string 'utf-8'.
doctypeThis method is not implemented yet, but will eventually support the functionality defined in DOM Core 3.
documentURIAlias for
URL.domConfigOstensibly an object representing settings which will be used when
normalizeis called. In practise, just returns an empty hashref that you can do with what you like.domainThe documents URL's host name.
embedsReturns all
<embed>elements found in the document.formsReturns all forms found in the document.
getElementByIdThe world-famous
getElementByIdmethod. 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.headReturns the document head.
imagesReturns all images found in the document.
implementationReturns the same as HTML::HTML5::DOM->getDOMImplementation.
inputEncodingThis method is not implemented yet, but will eventually support the functionality defined in DOM Core 3.
lastModifiedOstensibly returns the current document readiness, but this implementation always returns the string 'complete'.
linksReturns all
<a>and<area>elements with an "href" attribute found in the document.normalizeDocumentAlias for
normalize.p5_tablesReturns all tables found in the document.
pluginsReturns all
<embed>elements found in the document.refererAn alias for 'referrer' provided for the benefit of those who learnt to spell by reading HTTP RFCs.
referrerOstensibly returns the HTTP referer for the document, but in this implementation always returns an empty string.
renameNodeThis method is not implemented yet, but will eventually support the functionality defined in DOM Core 3.
scriptsReturns all scripts found in the document.
strictErrorCheckingDOM seems a little vague as to what exactly constitutes 'strict'. This returns false.
titleReturns the document's title, from its
<title>element, with a little whitespace canonicalisation.xmlEncodingThis method is not implemented yet, but will eventually support the functionality defined in DOM Core 3.
xmlStandaloneCalled with an argument, acts as
setStandalone; called without an argument, acts asstandalone.xmlVersionReturrns undef for documents parsed using an HTML parser; 1.0 or 1.1 if parsed using libxml.
BUGS
http://rt.cpan.org/Dist/Display.html?Queue=HTML-HTML5-DOM.
SEE ALSO
AUTHOR
Toby Inkster <tobyink@cpan.org>.
COPYRIGHT AND LICENCE
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.
DISCLAIMER OF WARRANTIES
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.