I want to pass an xml fragment to an xslt. I have the following code
where the queue holds xml messages
from("activemq:example.A")
.setHeader("agent.id", new XPathExpression("/"))
.process(new ReadLocalFile())
.to("xslt:transform.xsl")
The xslt looks like:
...
<xsl:param name="agent.xml"/>
<xsl:template match="/">
<xsl:value-of select="$agent.xml/agent/id" />
I would expect the xml fragment to be available as a nodeset in the
xsl, but I get the following exception:
javax.xml.transform.TransformerException: java.lang.RuntimeException:
Invalid conversion from
'com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList' to 'node-set'.
at
com
.sun
.org
.apache
.xalan
.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:670)
at
com
.sun
.org
.apache
.xalan
.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:300)
at org.apache.camel.builder.xml.XsltBuilder.process(XsltBuilder.java:
83)
...
Any ideas on how to solve this?