#30622 [NEW]: xsltProcessor->setParameter() cannot set namespace URI
| From: | ishikawa at arielworks dot com | Date: | Sat, 30 Oct 2004 17:13:39 +0000 |
| Subject: | #30622 [NEW]: xsltProcessor->setParameter() cannot set namespace URI | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-68499@lists.php.net to get a copy of this message | ||
From: ishikawa at arielworks dot com
Operating system: Windows XP Pro SP1
PHP version: 5.0.2
PHP Bug Type: XSLT related
Bug description: xsltProcessor->setParameter() cannot set namespace URI
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
--
Edit bug report at http://bugs.php.net/?id=30622&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30622&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30622&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30622&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30622&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30622&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30622&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30622&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30622&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30622&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30622&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30622&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30622&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30622&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30622&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30622&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30622&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30622&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30622&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30622&r=mysqlcfg