php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30622 XSLT: xsltProcessor->setParameter() cannot set namespace URI
Submitted: 2004-10-30 19:13 UTC Modified: 2006-01-06 03:39 UTC
Votes:8
Avg. Score:4.0 ± 1.0
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:2 (28.6%)
From: ishikawa at arielworks dot com Assigned: chregu (profile)
Status: Suspended Package: Feature/Change Request
PHP Version: 5.0.2 OS: Windows XP Pro SP1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ishikawa at arielworks dot com
New email:
PHP Version: OS:

 

 [2004-10-30 19:13 UTC] ishikawa at arielworks dot com
Description:
------------
xsltProcessor->setParameter() ignores its first parameter "namespace URI" and set NULL to namespace.

Reproduce code:
---------------
$xmlStr = '<?xml version="1.0" encoding="UTF-8"?><root/>';
$xmlDom = new DomDocument();
$xmlDom->loadXML($xmlStr);

$xslDom = new DomDocument();
$xslDom->load("./testcase.xsl");

$proc = new xsltProcessor();
$proc->importStyleSheet($xslDom);

/* set a parameter WITH namespace */
$proc->setParameter("http://www.php.net/test", "foo", "SET");

print $proc->transformToXML($xmlDom);

---- testcase.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                              xmlns:test="http://www.php.net/test">
    <xsl:param name="foo" select="'EMPTY'"/>
    <xsl:param name="test:foo" select="'EMPTY'"/>

    <xsl:template match="/root">
        <xsl:text>Namespace "NULL": </xsl:text>
        <xsl:value-of select="$foo"/>
        <xsl:text>, Namespace "http://www.php.net/test": </xsl:text>
        <xsl:value-of select="$test:foo"/>
    </xsl:template>
</xsl:stylesheet>

Expected result:
----------------
Namespace "NULL": EMPTY, Namespace "http://www.php.net/test": SET

Actual result:
--------------
Namespace "NULL": SET, Namespace "http://www.php.net/test": EMPTY

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-31 08:52 UTC] chregu@php.net
Yes, the namespace parameter is not implemented yet...

We know that, but noone found the time to implement it until know
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC