User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 1) I try setParameter() and pass null as a first argument. I get exception ("Component returned failure code: 0x80600008 [nsIXSLTProcessor.transformToFragment]") when trasformTo...() method is called. 2) If I call setParameter() and pass namespace "http://www.w3.org/1999/XSL/Transform" as a first argument then parameter will not be setted. It is independent of importStylesheet() method call point. Reproducible: Always Steps to Reproduce:
(In reply to comment #0) > 2) If I call setParameter() and pass namespace > "http://www.w3.org/1999/XSL/Transform" as a first argument then parameter will > not be setted. Are you sure it is not set? Can you try with xsl:copy-of? It seems like you set it as a stringvalue but you use it as a nodeset.
In the stylesheet, you reference <xsl:for-each select="$path"> which expects the non-namespaced parameter "path" to hold a nodeset. That is not supported for external parameters just yet, that's bug 248025. xslProcessor.setParameter("http://www.w3.org/1999/XSL/Transform", "path", "messages/message[@type='error']"); actually sets xsl:path (DONT, please) to a string value. Not a nodeset. Everything works as expected, besides the fact that we can't pass nodes :-/
I can't understand. Why does <xsl:for-each select="$path"> expect nodeset not string? I guess it is not evident. I expect when I set string parameter then all parameters entries in xslt is replaced by value of passed string. In this case we get xslt document in witch value of passed string is located on place of parameter.
In other words I expect from setParameter() method for behaviour like: var path="messages/message[@type='warning']"; xslDoc.getElementsByTagName("param").setAttribute("select", path);
http://www.w3.org/TR/xslt#element-for-each says <xsl:for-each select = node-set-expression> The variable references are not replaced, but they are expressions in their own sense.