From:             php at mycel dot nl
Operating system: Ubuntu 8.10, Windows XP
PHP version:      5.2.8
PHP Bug Type:     DOM XML related
Bug description:  XSLT gives an error after putting a new namespace in the DOM

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

-- 
Edit bug report at http://bugs.php.net/?id=47101&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47101&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47101&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47101&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47101&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47101&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47101&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47101&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47101&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47101&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47101&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47101&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47101&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47101&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47101&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47101&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47101&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47101&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47101&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47101&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47101&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47101&r=mysqlcfg

Reply via email to