Well, first of all you are passing a string as the parameter (like the error message says). But it looks like you're trying to pass an XPath expression, and XSLT can't interpret a string as an XPath expression. It has to be given the XPath expression at compile time. So you'll have to try some other strategy, what you are trying to do won't work.
for this kind of requirement you need to use xalan.jar
Joined: Oct 31, 2007
I want to use XSLT JAXP only not Xalan.
I tried to provide the NodeList in setParameter argument however this didnt solve the problem instead at runtime I am
getting the error message "Cannot convert a String to a Nodelist".
1. setParameter(<name>,<String value of XPath>)
3. setParameter(<name>, <Element>)
but none of them worked.
Can anyone please let me know exact code scriptlet.
Joined: May 12, 2008
I have tried the same you have done.. But no success. Please share if you got any solution
Nirjhar Ghosh wrote: Can anyone please let me know exact code scriptlet.
There is no code to do that. You've already done the experiments and proved that to yourself anyway. And besides, as I already said, there is no point in passing a node set. What you want to do can't be done in XSLT.
(And no, using xalan.jar won't help. The standard Java XSLT transformer is already Xalan anyway, but choosing a different implementation wouldn't help anyway because XSLT can't do what you want. No implementation of XSLT can do what you want.)