Skip to Content
May 16, 2019 at 02:01 PM

CPI XSLT - Using of header variable in XSLT

2548 Views Last edit May 16, 2019 at 02:03 PM 2 rev

hi everyone,

I am trying to use an CPI header named termdate in my XSLT mapping (in xsl file)as a parameter.

According to this blog it should be possible to do so by simply defining a parameter since XSLT parameters are automatically bound to Camel headers.

My XSLT is as below:

<xsl:stylesheet version="2.0" xmlns:xsl="" xmlns:xs="" xmlns:hci="" exclude-result-prefixes="hci">
 <xsl:param name= "termdate"/>
 <xsl:output omit-xml-declaration="yes" indent="yes"/>
 <xsl:strip-space elements="*"/>
 <xsl:template match="node()|@*">
   <xsl:apply-templates select="node()|@*"/>

 <xsl:template match="/queryCompoundEmployeeResponse/CompoundEmployee[(person/employment_information/payrollEndDate <= '$termdate')]"/>

I am not facing any errors while running this mapping step. But the filter condition does not seem to work. (FilterCondition: PayrollEndDate lessthanorEqual to $termdate)

Please help me to use it in the right way. I am using the right syntax and right declarations ?

Best Regards, Sravan