Skip to content

ParsedDocument

A response body parsed into a DOM, with the decisions the parse made.

Those decisions — whether the document is XHTML, whether it was parsed as XML, whether it already carried an XML prolog, and what namespace prefix XPath expressions need — are all made while reading the document and all needed again when writing it back out. Carrying them together is what keeps the serializer from having to guess.

final readonly class ParsedDocument

SourceUtil/FormPopulation/ParsedDocument.php
PropertyTypeDescription
$documentDOMDocumentreadonly.
$hadXmlPrologboolreadonly.
$isXhtmlboolreadonly.
$parsedAsXmlboolreadonly.
$xmlnsPrefixstringreadonly. Prefix XPath expressions need for HTML elements, “html:” or "".
$xpathDOMXPathreadonly.

public function __construct(DOMDocument $document, DOMXPath $xpath, string $xmlnsPrefix, bool $isXhtml, bool $parsedAsXml, bool $hadXmlProlog): mixed

ParameterTypeDescription
$documentDOMDocument
$xpathDOMXPath
$xmlnsPrefixstring
$isXhtmlbool
$parsedAsXmlbool
$hadXmlPrologbool

Returns mixed