camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomohisa Igarashi <tm.igara...@gmail.com>
Subject Re: Camel 2.15.1 XSLT returning only the closing tags
Date Tue, 28 Mar 2017 04:23:54 GMT
Hi,

On 03/28/2017 06:43 AM, Boba wrote:
> I am trying to do a really simple xml to xml transformation using the xslt
> uri, I have dumbed it down so the input and transformed messages are
> basically the same to try and work this out...
> I used stylus studio to create the xml to xml mapping (I'm not knowledgeable
> in xslt)
> <?xml version='1.0' ?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 	<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
> 	<xsl:template match="/">
> 		<Message>
> 			<element1>
> 				<xsl:value-of select="Message/element_1"/>
> 			</element1>
> 			<element2>
> 				<xsl:choose>
> 					<xsl:when test="Message/Type = 1">Request</xsl:when>
> 					<xsl:otherwise>End</xsl:otherwise>
> 				</xsl:choose>
> 			</element2>
> 			<element3>
> 				<xsl:value-of select="Message/element_3"/>
> 			</element3>
> 			<element4>
> 				<xsl:value-of select="Message/element_4"/>
> 			</element4>
> 			<element5>
> 				<xsl:value-of select="Message/element_5"/>
> 			</SessionID>
> 			<element6>
> 				<xsl:value-of select="Message/element_6"/>
> 			</element6>
> 		</Message>
> 	</xsl:template>
> </xsl:stylesheet>
>
> It works well running camel standalone on my windows vm but when I deploy to
> Tomcat7 on oracle java 8 (now and 7 previously) on ubuntu 14.04 32bit VM
> server, the bulk of the response is just close tags i.e.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Message>
>  <element1/>
>  <element2>End</element2>
>  <element3/>
>  <element4/>
> </Message>

This could be the correct output if the valued of Message/element_[134] are actually empty
though, is your input really have those values?

Thanks,
Tomo

> I use the Camel spring XML DSL and am referencing the xsl files from the
> local
>
> <to uri="xslt:file:///home/xsltfiles/ssTestsheet1.xsl"/>
>
> There are a few posts that suggest a number of options including using the
> xalan transformer factory
> <to
> uri="xslt:///home/xsltfiles/ssTestsheet1.xsl?transformerFactory=transformerFactory"/>
>
> or saxon
> <to uri="xslt:///home/xsltfiles/ssTestsheet1.xsl?saxon=true"/>
>
> I added the relevant dependencies in my POM
>         <dependency>
>            <groupId>org.apache.camel</groupId>
>            <artifactId>camel-saxon</artifactId>
>            <version>${camel-version}</version>
>          </dependency>
>
>          <dependency>
>            <groupId>xalan</groupId>
>            <artifactId>xalan</artifactId>
>            <version>2.7.1</version>
>          </dependency>
>
> I have also tried, as suggested by one post, converting the body to
> java.io.InputStream just before the XSLT
> <convertBodyTo type="java.io.InputStream"/>
>
> So I have been at this solidly over the week-end and today... I can't see
> what is wrong
>
> Any help ...please
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-15-1-XSLT-returning-only-the-closing-tags-tp5796448.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
View raw message