ID: 41248 Updated by: [EMAIL PROTECTED] Reported By: ifland at gmail dot com -Status: Open +Status: Bogus Bug Type: XSLT related Operating System: All PHP Version: 5.2.1 New Comment:
To me, it looks like libxslt doesn't suppport that and I can't see, how your link helps for that :) We use http://xmlsoft.org/XSLT/html/libxslt- transform.html#xsltApplyStylesheetUser for the transformation and that only accepts chars. But maybe I missed some functions... Previous Comments: ------------------------------------------------------------------------ [2007-05-01 03:58:07] ifland at gmail dot com Description: ------------ As far as I can tell, the setParameter() function (http://php.net/xsl_xsltprocessor_set_parameter) doesn't support passing DOMDocument objects or DOMNode objects as parameters. I was hoping to get it to work like it does in the .NET 2.0 framework. (See http://msdn2.microsoft.com/en-us/library/system.xml.xsl.xsltargumentlist.addparam.aspx) But after looking at the PHP 5.2.1 source code, /php-5.2.1/ext/xsl/xsltprocessor.c line 604-650, it appears that it's not possible to do so in PHP even though it appears that libxslt supports it (see http://xmlsoft.org/XSLT/html/libxslt-variables.html#xsltParseGlobalParam) Reproduce code: --------------- ... $xslt = new XSLTProcessor(); //load stylesheet ... $param = new DOMDocument(); $param->loadXML('<params><param name="value" /></params>'); $xslt->setParameter('', 'PARAMS', $param); ... //use the value like this in the XSL <xsl:param name="PARAMS" /> ... <xsl:value-of select="$PARAMS/params/param/@name" /> <!-- should output 'value' --> Expected result: ---------------- The function should take the whole XML blob that's passed in and make it available to the XSL as a global parameter variable. Actual result: -------------- Just a misleading warning ("Wrong parameter count") ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41248&edit=1
