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 —getElementById()
public
getElementById(mixed $elementId) : PrototypeHTMLElement|DOMNode|null
Parameters
- $elementId : mixed
Tags
Return values
PrototypeHTMLElement|DOMNode|null —getElementsByClassName()
public
getElementsByClassName(string $className) : NodeList
Parameters
- $className : string
Tags
Return values
NodeList —insertNodeList()
Inserts a NodeList into the document by appending its nodes
public
insertNodeList(NodeList $nodeList) : Document
Parameters
- $nodeList : NodeList
Return values
Document —inspect()
public
inspect([DOMNode $context = null ][, bool $xml = null ]) : string
Parameters
- $context : DOMNode = null
- $xml : bool = null
Tags
Return values
string —loadDocument()
public
loadDocument(string|DOMNodeList|NodeList $content[, bool|null $xml = null ]) : Document
Parameters
- $content : string|DOMNodeList|NodeList
- $xml : bool|null = null
Tags
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
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
Return values
Document —match()
public
match(DOMNode $element, string $selector) : bool
Parameters
- $element : DOMNode
- $selector : string
Tags
Return values
bool —newElement()
public
newElement(string $tag[, array<string|int, mixed> $attributes = null ]) : PrototypeHTMLElement
Parameters
- $tag : string
- $attributes : array<string|int, mixed> = null
Tags
Return values
PrototypeHTMLElement —query()
public
query(string $xpath[, DOMNode $contextNode = null ]) : NodeList|null
Parameters
- $xpath : string
- $contextNode : DOMNode = null
Return values
NodeList|null —querySelectorAll()
public
querySelectorAll(string $selector[, DOMNode $contextNode = null ][, string $axis = null ]) : NodeList|null
Parameters
- $selector : string
- $contextNode : DOMNode = null
- $axis : string = null
Tags
Return values
NodeList|null —recursivelyCollect()
public
recursivelyCollect(DOMNode $element, string $property[, int $maxLength = null ][, int $nodeType = null ]) : NodeList
Parameters
- $element : DOMNode
- $property : string
- $maxLength : int = null
- $nodeType : int = null
Tags
Return values
NodeList —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
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 —select()
public
select([array<string|int, mixed> $selectors = null ][, DOMNode $contextNode = null ][, string $axis = null ][, int $nodeType = null ]) : NodeList
Parameters
- $selectors : array<string|int, mixed> = null
- $contextNode : DOMNode = null
- $axis : string = null
- $nodeType : int = null
Tags
Return values
NodeList —selector2xpath()
public
selector2xpath(string $selector[, string $axis = null ]) : string
Parameters
- $selector : string
- $axis : string = null
Return values
string —toNodeList()
public
toNodeList(NodeList|PrototypeNode|DOMNodeList|DOMNode|string $content) : NodeList
Parameters
- $content : NodeList|PrototypeNode|DOMNodeList|DOMNode|string