[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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004年10月31日 08:52 UTC] chregu@php.net
|