php8.5
Home/ Manual/ xsl / xsltprocessor/ XSLTProcessor::importStylesheet

XSLTProcessor::importStylesheet

PHP function Edit on GitHub ✎

(PHP 5, PHP 7, PHP 8)

Import stylesheet

Description

XSLTProcessor::importStylesheet(object $stylesheet): bool

This method imports the stylesheet into the XSLTProcessor for transformations.

Parameters

stylesheet

The imported style sheet as a Dom\Document, DOMDocument or SimpleXMLElement object.

Return Values

Success

Errors/Exceptions

Throws a TypeError if stylesheet is not an XML object.

Changelog

VersionDescription
8.4.0Added support for Dom\Document.
8.4.0Now throws a TypeError instead of a ValueError if stylesheet is not an XML object.

Source: reference/xsl/xsltprocessor/importstylesheet.xml · from the official PHP manual (php/doc-en)