php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43804 XSLTProcessor fails to recognise dynamically created <xsl:> tags
Submitted: 2008-01-10 08:52 UTC Modified: 2008-01-10 09:20 UTC
From: shangxiao@php.net Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shangxiao@php.net
New email:
PHP Version: OS:

 

 [2008-01-10 08:52 UTC] shangxiao@php.net
Description:
------------
I've got a piece of code where I needed to dynamically create some xsl commands in my xsl stylesheet using the DOM api, but when I pass the DOMDocument to XSLTProcessor, it fails to recognise these commands.

However, if the DOMDocument is exported to a string and then www.dictioloaded into a different DOMDocument, the result is correct.  The function normalizeDocument() does not seem to have any effect.

The test files may be located at:
http://www.assessments.com.au/xsl_bug/

Reproduce code:
---------------
http://www.assessments.com.au/xsl_bug/test.phps

Expected result:
----------------
<html xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-11-27T05:06:00"><body>This text should appear!<body></html>


Actual result:
--------------
<html xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-11-27T05:06:00"><body><xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="my:test"></xsl:value-of></body></html>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-10 09:20 UTC] chregu@php.net
You have to use createElementNS instead of createElement for adding 
namespaced Elements via DOM 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 20:01:35 2025 UTC