Closed
Bug 265410
Opened 20 years ago
Closed 20 years ago
setParameter() method of XSLTProcessor don't work
Categories
(Core :: XSLT, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: surkov, Assigned: peterv)
Details
Attachments
(3 files)
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:
Reporter | ||
Comment 1•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
Reporter | ||
Comment 3•20 years ago
|
||
Assignee | ||
Comment 4•20 years ago
|
||
(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.
Comment 5•20 years ago
|
||
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 :-/
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
Reporter | ||
Comment 6•20 years ago
|
||
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.
Reporter | ||
Comment 7•20 years ago
|
||
In other words I expect from setParameter() method for behaviour like: var path="messages/message[@type='warning']"; xslDoc.getElementsByTagName("param")[0].setAttribute("select", path);
Comment 8•20 years ago
|
||
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.
You need to log in
before you can comment on or make changes to this bug.
Description
•