camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sammm <martin.s...@gmail.com>
Subject Re: Dynamic XSL from Content
Date Fri, 18 Jan 2013 07:03:05 GMT
The above was working for a hard coded XSL name:

      <setHeader headerName="CamelXsltResourceUri">
	      <constant>META-INF/xsl/5.xsl</constant>
      </setHeader>
      <log message="CamelXsltResourceUri :
${header.CamelXsltResourceUri}"></log>
      <to uri="xslt:META-INF/xsl/dummy.xsl"/>


what i need to do i dynamically generate the name of the xsl:

      <setHeader headerName="CamelXsltResourceUri">
	      <xpath
resultType="java.lang.String">concat('META-INF/xsl/',//phar:pharmacyInfoRequest/pharmacyId/text(),'.xsl')</xpath>
      </setHeader>
      <to uri="xslt:META-INF/xsl/dummy.xsl"/>


when i use this i get this error:

javax.xml.transform.TransformerException:
javax.xml.transform.TransformerException:
com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Premature end
of file.

i've enable trace and can see for both cases this message:

2013-01-18 06:55:55,482 [y_info/services] DEBUG SpringCamelContext            
- xslt://META-INF/xsl/5.xsl converted to endpoint:
Endpoint[xslt://META-INF/xsl/5.xsl] by component:
org.apache.camel.component.xslt.XsltComponent@163eae

The latter (dynamic case) then fails with the above 'end of file' exception.

Any ideas?

Many thanks

Martin





--
View this message in context: http://camel.465427.n5.nabble.com/Dynamic-XSL-from-Content-tp5725634p5725729.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message