checkUnsupported($xml);
$flags = (\LIBXML_VERSION >= 20700) ? \LIBXML_COMPACT | \LIBXML_PARSEHUGE : 0;
$useErrors = \libxml_use_internal_errors(\true);
$dom = new DOMDocument;
$success = $dom->loadXML($xml, $flags);
\libxml_use_internal_errors($useErrors);
if (!$success)
throw new InvalidArgumentException('Cannot load XML: ' . \libxml_get_last_error()->message);
return $dom;
}
public function render($xml)
{
if (\substr($xml, 0, 3) === '' && \substr($xml, -4) === '')
return $this->renderPlainText($xml);
else
return $this->renderRichText(\preg_replace('(<[eis]>[^<]*[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, '