I tried to pass a w3c.dom.Document
, Element
and NodeList
as parameters to a xslt transform.
I want to be able to process it within the xslt:
<xsl:param name="links" />
<xsl:template match="/">
<record>
<xsl:for-each select="$links/*">
<test />
</xsl:for-each>
</record>
</xsl:template>
I pass the parameter as:
Document params = createLinksParams(links);
transformer.setParameter("links", params);
I get this exception:
'Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DocumentImpl' to 'node-set'.'
I tried also exslt:node-set()
, xalan:nodeset()
etc, but it doesn't work.
It seems that internally xalan excepts his own implementation of the Node.
How can I do something similar without incurring in this problem?
I cannot use document($param)
because I construct the doc on the fly.
(Posting a new answer, as the previous one did not solve the issue and this new one is radically different from the previous)
Seems to be a known issue with XALAN compiling processor ( XALANJ-2057, How can I pass a node as parameter to translets for XSLTC Processor).
So, what are the alternatives?