eZ\Publish\Core\FieldType\RichText\Type::loadXMLString PHP Method

loadXMLString() protected method

Creates \DOMDocument from given $xmlString.
protected loadXMLString ( $xmlString ) : DOMDocument
$xmlString
return DOMDocument
    protected function loadXMLString($xmlString)
    {
        $document = new DOMDocument();
        libxml_use_internal_errors(true);
        libxml_clear_errors();
        // Options:
        // - substitute entities
        // - disable network access
        // - relax parser limits for document size/complexity
        $success = $document->loadXML($xmlString, LIBXML_NOENT | LIBXML_NONET | LIBXML_PARSEHUGE);
        if (!$success) {
            $messages = array();
            foreach (libxml_get_errors() as $error) {
                $messages[] = trim($error->message);
            }
            throw new InvalidArgumentException('$inputValue', 'Could not create XML document: ' . implode("\n", $messages));
        }
        return $document;
    }