Documentation

Document extends DOMDocument

Table of Contents

LOAD_OPTIONS  = LIBXML_COMPACT | LIBXML_NONET | LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR
NODE_CLASSES  = ['DOMAttr' => chillerlanPrototypeDOMNodeAttr::class, 'DOMCdataSection' => chillerlanPrototypeDOMNodeCdataSection::class, 'DOMCharacterData' => chillerlanPrototypeDOMNodeCharacterData::class, 'DOMComment' => chillerlanPrototypeDOMNodeComment::class, 'DOMDocumentFragment' => chillerlanPrototypeDOMNodeDocumentFragment::class, 'DOMDocumentType' => chillerlanPrototypeDOMNodeDocumentType::class, 'DOMElement' => chillerlanPrototypeDOMNodeElement::class, 'DOMEntity' => chillerlanPrototypeDOMNodeEntity::class, 'DOMEntityReference' => chillerlanPrototypeDOMNodeEntityReference::class, 'DOMNode' => chillerlanPrototypeDOMNodeNode::class, 'DOMNotation' => chillerlanPrototypeDOMNodeNotation::class, 'DOMProcessingInstruction' => chillerlanPrototypeDOMNodeProcessingInstruction::class, 'DOMText' => chillerlanPrototypeDOMNodeText::class]
$cssSelectorConverter  : CssSelectorConverter
__construct()  : mixed
Document constructor.
getElementById()  : PrototypeHTMLElement|DOMNode|null
getElementsByClassName()  : NodeList
insertNodeList()  : Document
Inserts a NodeList into the document by appending its nodes
inspect()  : string
loadDocument()  : Document
loadDocumentFile()  : Document
loadDocumentString()  : Document
match()  : bool
newElement()  : PrototypeHTMLElement
query()  : NodeList|null
querySelectorAll()  : NodeList|null
recursivelyCollect()  : NodeList
recursivelyFind()  : DOMNode|null
removeElementsBySelector()  : Document
Removes the nodes from the document that match the given selector(s)
select()  : NodeList
selector2xpath()  : string
toNodeList()  : NodeList

Constants

LOAD_OPTIONS

protected mixed LOAD_OPTIONS = LIBXML_COMPACT | LIBXML_NONET | LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED | LIBXML_NOERROR

NODE_CLASSES

protected mixed NODE_CLASSES = ['DOMAttr' => chillerlanPrototypeDOMNodeAttr::class, 'DOMCdataSection' => chillerlanPrototypeDOMNodeCdataSection::class, 'DOMCharacterData' => chillerlanPrototypeDOMNodeCharacterData::class, 'DOMComment' => chillerlanPrototypeDOMNodeComment::class, 'DOMDocumentFragment' => chillerlanPrototypeDOMNodeDocumentFragment::class, 'DOMDocumentType' => chillerlanPrototypeDOMNodeDocumentType::class, 'DOMElement' => chillerlanPrototypeDOMNodeElement::class, 'DOMEntity' => chillerlanPrototypeDOMNodeEntity::class, 'DOMEntityReference' => chillerlanPrototypeDOMNodeEntityReference::class, 'DOMNode' => chillerlanPrototypeDOMNodeNode::class, 'DOMNotation' => chillerlanPrototypeDOMNodeNotation::class, 'DOMProcessingInstruction' => chillerlanPrototypeDOMNodeProcessingInstruction::class, 'DOMText' => chillerlanPrototypeDOMNodeText::class]

Properties

$cssSelectorConverter

protected CssSelectorConverter $cssSelectorConverter

Methods

__construct()

Document constructor.

public __construct([string|DOMNodeList|NodeList $content = null ][, bool|null $xml = null ][, string|null $version = null ][, string|null $encoding = null ]) : mixed
Parameters
$content : string|DOMNodeList|NodeList = null
$xml : bool|null = null
$version : string|null = null
$encoding : string|null = null
Return values
mixed

loadDocument()

public loadDocument(string|DOMNodeList|NodeList $content[, bool|null $xml = null ]) : Document
Parameters
$content : string|DOMNodeList|NodeList
$xml : bool|null = null
Tags
throws
DOMException
Return values
Document

loadDocumentFile()

public loadDocumentFile(string $file[, bool $xml = null ][, int $options = null ]) : Document
Parameters
$file : string
$xml : bool = null
$options : int = null
Tags
throws
DOMException
Return values
Document

loadDocumentString()

public loadDocumentString(string $documentSource[, bool $xml = null ][, int $options = null ]) : Document
Parameters
$documentSource : string
$xml : bool = null
$options : int = null
Tags
throws
DOMException
Return values
Document

query()

public query(string $xpath[, DOMNode $contextNode = null ]) : NodeList|null
Parameters
$xpath : string
$contextNode : DOMNode = null
Return values
NodeList|null

recursivelyFind()

public recursivelyFind(PrototypeNode $element[, string $property = null ][, string $selector = null ][, int $index = null ][, int $nodeType = null ]) : DOMNode|null
Parameters
$element : PrototypeNode
$property : string = null
$selector : string = null
$index : int = null
$nodeType : int = null
Tags
see
https://secure.php.net/manual/dom.constants.php
Return values
DOMNode|null

removeElementsBySelector()

Removes the nodes from the document that match the given selector(s)

public removeElementsBySelector(array<string|int, mixed> $selectors[, DOMNode $contextNode = null ][, string $axis = null ]) : Document
Parameters
$selectors : array<string|int, mixed>
$contextNode : DOMNode = null
$axis : string = null
Return values
Document

selector2xpath()

public selector2xpath(string $selector[, string $axis = null ]) : string
Parameters
$selector : string
$axis : string = null
Return values
string

Search results