eZ\Publish\Core\FieldType\RichText\Converter\Xslt::convert PHP Метод

convert() публичный Метод

Performs conversion of the given $document using XSLT stylesheet.
public convert ( DOMDocument $document ) : DOMDocument
$document DOMDocument
Результат DOMDocument
    public function convert(DOMDocument $document)
    {
        if (!file_exists($this->stylesheet)) {
            throw new InvalidArgumentException('stylesheetPath', "Conversion of XML document cannot be performed, file '{$this->stylesheet}' does not exist.");
        }
        $processor = $this->getXSLTProcessor();
        $this->startRecordingErrors();
        $document = $processor->transformToDoc($document);
        $errors = $this->collectErrors();
        if (!empty($errors)) {
            throw new InvalidArgumentException('$xmlDoc', 'Transformation of XML content failed: ' . implode("\n", $errors));
        }
        return $document;
    }