Hello,
I am trying to use x:transform to apply a transformation to a document that combines content from other documents. I have been trying to use x:param to pass in the other supporting documents as node-sets but I am getting errors as follows:
<c:import url="/WEB-INF/xslt/transform.xslt" var="xslt" />
<x:parse varDom="propertiesNS" doc="${propertiesXmlStr}"/>
<x:transform xml="${main.xml}" xslt="${xslt}">
<x:param name="properties" value="${propertiesNS}"/>
</x:transform>
...throws: Invalid conversion from 'com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl' to 'node-set'
So I tried using x:set to force a node-set result - my reading of the spec suggests that the result of x:set should node-set compatible with x:transform.
<c:import url="/WEB-INF/xslt/transform.xslt" var="xslt" />
<x:parse varDom="propertiesNS" doc="${propertiesXmlStr}"/>
<x:set var="propertiesNS2" select="$propertiesNS/Properties"/>
<x:transform xml="${main.xml}" xslt="${xslt}">
<x:param name="properties" value="${propertiesNS2}"/>
</x:transform>
...throws: "Invalid conversion from 'org.apache.taglibs.standard.tag.common.xml.JSTLNodeList' to 'node-set'"
Any ideas?
I appreciate that I could use document() but the supporting docs are in memory so I'd have to write a URIResolver but as far as I can see I'd have to specify a custom TransformerFactory to attach the URIResolver to the Transformer and i don't really want to do that as I imagine the default one includes optimisations etc.
Many thanks for any help.
Andy