|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-01-14 15:49 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 23:00:01 2025 UTC |
Description: ------------ If you add a new namespace to the DOM Document then the XSLT gives an error "undefined namespace". And if you save the DOM and load again it works. Reproduce code: --------------- $oDOM = new DOMDocument(); $oDOM->load('random_file.xsl'); //Must be a valid XSL file with a <xsl:stylesheet> tag $oDOM2 = new DOMDocument(); $oDOM2->load('random_file.xml'); //Must be a valid XML file $oElement = $oDOM->getElementsbyTagNameNS('*', 'stylesheet')->item(0); $oElement->setAttribute('xmlns:exsl', 'http://exslt.org/common'); $oXSLTransform = new XSLTProcessor(); $oXSLTransform->importStyleSheet($oDOM); $oOutput = $oXSLTransform->transformToDoc($oDOM); Expected result: ---------------- A transformed DOC document (without errors) Actual result: -------------- Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error: file file.xsl line 3 element stylesheet in file.php on line 13 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: xsl:extension-element-prefix : undefined namespace exsl in file.php on line 13