Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<XSLTProcessor::hasExsltSupportXSLTProcessor::registerPHPFunctionNS>
^XSLTProcessorLast updated: Mon, 26 Oct 2026

XSLTProcessor::importStylesheet

(PHP 5, PHP 7, PHP 8)

XSLTProcessor::importStylesheet — Import stylesheet

Description

public function 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

Returns true on success or false on failure.

Errors/Exceptions

Throws a TypeError if stylesheet is not an XML object.

Changelog

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

<XSLTProcessor::hasExsltSupportXSLTProcessor::registerPHPFunctionNS>
^XSLTProcessorLast updated: Mon, 26 Oct 2026