You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8.6 KiB
8.6 KiB
title |
---|
Document |
The Document class
Introduction
Represents an entire HTML document; serves as the root of the document tree. Unlike the PHP \DOMDocument
class in which it inherits from it cannot be used to represent an XML document. It is strictly used to represent HTML.
Info Only new methods and methods which make outward-facing changes from \DOMDocument will be documented here, otherwise they will be linked back to PHP's documentation.
MensBeam\HTML\Document extends \DOMDocument {
/* Constants */
public const NO_QUIRKS_MODE = 0 ;
public const QUIRKS_MODE = 1 ;
public const LIMITED_QUIRKS_MODE = 2 ;
/* Properties */
public string|null $documentEncoding = null ;
public int $quirksMode = 0 ;
/* Inherited properties from \DOMDocument */
public readonly DocumentType $doctype ;
public readonly Element $documentElement ;
public string|null $documentURI ;
public readonly \DOMImplementation $implementation ;
/* Inherited properties from \DOMNode */
public readonly string $nodeName ;
public string $nodeValue ;
public readonly int $nodeType ;
public readonly \DOMNode|null $parentNode ;
public readonly \DOMNodeList $childNodes ;
public readonly \DOMNode|null $firstChild ;
public readonly \DOMNode|null $lastChild ;
public readonly \DOMNode|null $previousSibling ;
public readonly \DOMNode|null $nextSibling ;
public readonly \DOMNamedNodeMap|null $attributes ;
public readonly Document|null $ownerDocument ;
public readonly string|null $namespaceURI ;
public string $prefix ;
public readonly string $localName ;
public readonly string|null $baseURI ;
public string $textContent ;
/* Methods */
public __construct ( )
public createEntityReference ( string $name ) : false
public load ( string $filename , null $options = null , string|null $encodingOrContentType = null ) : bool
public loadHTML ( string $source , null $options = null , string|null $encodingOrContentType = null ) : bool
public loadHTMLFile ( string $filename , null $options = null , string|null $encodingOrContentType = null ) : bool
public loadXML ( string $source , null $options = null ) : false
public save ( string $filename , null $options = null ) : int|false
public saveHTMLFile ( string $filename , null $options = null ) : int|false
public saveXML ( DOMNode|null $node = null , null $options = null ) : false
public validate ( ) : true
public xinclude ( null $options = null ) : false
}
Constants
Constant | Value | Description |
---|---|---|
MensBeam\HTML\Document::NO_QUIRKS_MODE | 0 | Document not in quirks mode |
MensBeam\HTML\Document::QUIRKS_MODE | 1 | Document is in quirks mode |
MensBeam\HTML\Document::LIMITEDQUIRKS_MODE | 2 | Document is in limited quirks mode |
Properties
- documentEncoding
- Encoding of the document, as specified when parsing or when determining encoding type. Use this instead of
\DOMDocument::encoding
. - quirksMode
- Used when parsing. Specifies which mode the document was parsed in. One of the predefined quirks mode constants.
The following properties inherited from \DOMDocument
have no effect in Mensbeam\HTML\Document
, so therefore are not listed in the schema above: