You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Vanshul.Chawla" <Va...@target.com> on 2015/05/05 10:52:58 UTC
Camel headers not visible in xslt when blueprint deployed to Fuse
I have a blueprint.xml deployed to fuse.
Section of that blueprint is:
<setHeader headerName="ResponseCode">
<simple>${header.CamelHttpResponseCode}</simple>
</setHeader>
<setHeader headerName="ResponseDesc">
<simple>${body}</simple>
</setHeader>
<setHeader headerName="Test">
<constant>22</constant>
</setHeader>
<log message="Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
<setBody>
<simple>${property.Identifiers}</simple>
</setBody>
<log message="Again Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
<to uri="xslt://xslt/Experian.xsl?saxon=true" />
I have a xslt which is like this
<xsl:transform version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mf="http://www.target.com/mf" exclude-result-prefixes="xs mf">
<xsl:template match="//Identifier">
<xsl:param name="ResponseCode"/>
<xsl:param name="ResponseDesc"/>
<xsl:param name="Test"/>
<ResponseXML>
<xsl:copy-of select="@*"/>
<xsl:attribute name="ResponseSystem">
<xsl:value-of select="'Experian'" />
</xsl:attribute>
<xsl:attribute name="ExperianResponseStatus">
<xsl:value-of select="$ResponseCode" />
</xsl:attribute>
<xsl:attribute name="ExperianResponseDescription">
<xsl:value-of select="$ResponseDesc" />
</xsl:attribute>
<xsl:attribute name="ExperianResponseDescription22">
<xsl:value-of select="$Test" />
</xsl:attribute>
<xsl:attribute name="SystematicResponseTime">
<xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001]-[M01]-[D01]-[h01]:[m01]:[s01].[f000001]')" />
</xsl:attribute>
</ResponseXML>
</xsl:template>
</xsl:transform>
Problem is I don't get the param in the xslt although when I print header in log outside I can see values.
Does Fuse supports this?
Thanks and Regards,
Vanshul Chawla
RE: Camel headers not visible in xslt when blueprint deployed to
Fuse
Posted by "Vanshul.Chawla" <Va...@target.com>.
Yes it works, Thanks a ton.
Thanks and Regards,
Vanshul Chawla
-----Original Message-----
From: Sandra Taylor [mailto:jtt77777@gmail.com]
Sent: Tuesday, May 05, 2015 2:59 PM
To: users@camel.apache.org
Subject: Re: Camel headers not visible in xslt when blueprint deployed to Fuse
I think you need to make those xsl params global, so put them under the transform.
<xsl:transform version="2.0"...>
<xsl:param name="ResponseCode"/>
<xsl:param name="ResponseDesc"/>
<xsl:param name="Test"/>
<xsl:template match="//Identifier">
.....
Regards,
-John
On Tue, May 5, 2015 at 4:52 AM, Vanshul.Chawla <Va...@target.com> wrote:
> I have a blueprint.xml deployed to fuse.
>
> Section of that blueprint is:
>
>
> <setHeader headerName="ResponseCode">
> <simple>${header.CamelHttpResponseCode}</simple>
> </setHeader>
> <setHeader headerName="ResponseDesc">
> <simple>${body}</simple>
> </setHeader>
> <setHeader headerName="Test">
> <constant>22</constant>
> </setHeader>
> <log message="Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
> <setBody>
> <simple>${property.Identifiers}</simple>
> </setBody>
> <log message="Again Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
> <to uri="xslt://xslt/Experian.xsl?saxon=true" />
>
>
> I have a xslt which is like this
>
> <xsl:transform version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:mf="http://www.target.com/mf" exclude-result-prefixes="xs mf">
> <xsl:template match="//Identifier">
> <xsl:param name="ResponseCode"/>
> <xsl:param name="ResponseDesc"/>
> <xsl:param name="Test"/>
> <ResponseXML>
> <xsl:copy-of select="@*"/>
> <xsl:attribute name="ResponseSystem">
> <xsl:value-of select="'Experian'" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseStatus">
> <xsl:value-of select="$ResponseCode" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseDescription">
> <xsl:value-of select="$ResponseDesc" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseDescription22">
> <xsl:value-of select="$Test" />
> </xsl:attribute>
> <xsl:attribute name="SystematicResponseTime">
> <xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001]-[M01]-[D01]-[h01]:[m01]:[s01].[f000001]')" />
> </xsl:attribute>
> </ResponseXML>
> </xsl:template>
> </xsl:transform>
>
> Problem is I don't get the param in the xslt although when I print header in log outside I can see values.
>
> Does Fuse supports this?
>
>
> Thanks and Regards,
>
> Vanshul Chawla
>
Re: Camel headers not visible in xslt when blueprint deployed to Fuse
Posted by Sandra Taylor <jt...@gmail.com>.
I think you need to make those xsl params global, so put them under
the transform.
<xsl:transform version="2.0"...>
<xsl:param name="ResponseCode"/>
<xsl:param name="ResponseDesc"/>
<xsl:param name="Test"/>
<xsl:template match="//Identifier">
.....
Regards,
-John
On Tue, May 5, 2015 at 4:52 AM, Vanshul.Chawla
<Va...@target.com> wrote:
> I have a blueprint.xml deployed to fuse.
>
> Section of that blueprint is:
>
>
> <setHeader headerName="ResponseCode">
> <simple>${header.CamelHttpResponseCode}</simple>
> </setHeader>
> <setHeader headerName="ResponseDesc">
> <simple>${body}</simple>
> </setHeader>
> <setHeader headerName="Test">
> <constant>22</constant>
> </setHeader>
> <log message="Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
> <setBody>
> <simple>${property.Identifiers}</simple>
> </setBody>
> <log message="Again Body is ${body} Param are ${header.ResponseCode} and ${header.ResponseDesc}"/>
> <to uri="xslt://xslt/Experian.xsl?saxon=true" />
>
>
> I have a xslt which is like this
>
> <xsl:transform version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:mf="http://www.target.com/mf" exclude-result-prefixes="xs mf">
> <xsl:template match="//Identifier">
> <xsl:param name="ResponseCode"/>
> <xsl:param name="ResponseDesc"/>
> <xsl:param name="Test"/>
> <ResponseXML>
> <xsl:copy-of select="@*"/>
> <xsl:attribute name="ResponseSystem">
> <xsl:value-of select="'Experian'" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseStatus">
> <xsl:value-of select="$ResponseCode" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseDescription">
> <xsl:value-of select="$ResponseDesc" />
> </xsl:attribute>
> <xsl:attribute name="ExperianResponseDescription22">
> <xsl:value-of select="$Test" />
> </xsl:attribute>
> <xsl:attribute name="SystematicResponseTime">
> <xsl:value-of select="format-dateTime(current-dateTime(),'[Y0001]-[M01]-[D01]-[h01]:[m01]:[s01].[f000001]')" />
> </xsl:attribute>
> </ResponseXML>
> </xsl:template>
> </xsl:transform>
>
> Problem is I don't get the param in the xslt although when I print header in log outside I can see values.
>
> Does Fuse supports this?
>
>
> Thanks and Regards,
>
> Vanshul Chawla
>