checkUnsupported($xml); $flags = (\LIBXML_VERSION >= 20700) ? \LIBXML_COMPACT | \LIBXML_PARSEHUGE : 0; $dom = new DOMDocument; $dom->loadXML($xml, $flags); return $dom; } public function render($xml) { if (\substr($xml, 0, 3) === '') return $this->renderPlainText($xml); else return $this->renderRichText(\preg_replace('(<[eis]>[^<]*)', '', $xml)); } protected function renderPlainText($xml) { $html = \substr($xml, 3, -4); $html = \str_replace('
', '
', $html); $html = $this->decodeSMP($html); return $html; } abstract protected function renderRichText($xml); public function getParameter($paramName) { return (isset($this->params[$paramName])) ? $this->params[$paramName] : ''; } public function getParameters() { return $this->params; } public function setParameter($paramName, $paramValue) { $this->params[$paramName] = (string) $paramValue; } public function setParameters(array $params) { foreach ($params as $paramName => $paramValue) $this->setParameter($paramName, $paramValue); } protected function checkUnsupported($xml) { if (\strpos($xml, '