Zend\Dom\Document
Class used to initialize DomDocument from string, with proper verifications
Synopsis
class Document
{
- // constants
- const DOC_HTML = 'DOC_HTML';
- const DOC_XHTML = 'DOC_XHTML';
- const DOC_XML = 'DOC_XML';
- // members
- protected string $stringDocument;
- protected DOMDocument $domDocument;
- protected string $type;
- protected array $errors;
- protected array $xpathNamespaces;
- protected mixed $xpathPhpFunctions;
- // methods
- public void __construct()
- public string|null getStringDocument()
- protected self setStringDocument()
- public string|null getType()
- protected self setType()
- public DOMDocument getDomDocument()
- protected self setDomDocument()
- public string|null getEncoding()
- public self setEncoding()
- public array getErrors()
- protected self setErrors()
- protected DOMDocument getDomDocumentFromString()
- public array getXpathNamespaces()
- public void registerXpathNamespaces()
- public string|null getXpathPhpFunctions()
- public void registerXpathPhpFunctions()
Constants
Name | Value |
---|---|
DOC_HTML | 'DOC_HTML' |
DOC_XHTML | 'DOC_XHTML' |
DOC_XML | 'DOC_XML' |
Members
protected
- $domDocument
—
DOMDocument
DOMDocument generated from raw string document - $errors
—
array
Error list generated from transformation of document to DOMDocument - $stringDocument
—
string
Raw document - $type
—
string
Type of the document provided - $xpathNamespaces
—
array
XPath namespaces - $xpathPhpFunctions
—
mixed
XPath PHP Functions
Methods
protected
- getDomDocumentFromString() — Get DOMDocument from set raw document
- setDomDocument() — Set DOMDocument
- setErrors() — Set document errors from DOMDocument generation
- setStringDocument() — Set raw document
- setType() — Set raw document type
public
- __construct() — Constructor
- getDomDocument() — Get DOMDocument generated from set raw document
- getEncoding() — Get set document encoding
- getErrors() — Get DOMDocument generation errors
- getStringDocument() — Get raw set document
- getType() — Get raw document type
- getXpathNamespaces() — Get Document's registered XPath namespaces
- getXpathPhpFunctions() — Get Document's registered XPath PHP Functions
- registerXpathNamespaces() — Register XPath namespaces
- registerXpathPhpFunctions() — Register PHP Functions to use in internal DOMXPath
- setEncoding() — Set raw document encoding for DOMDocument generation