Skip to Content
Oct 20, 2021 at 03:54 PM

SAP CPI:Filter condition in XSLT with date compare



I am trying to filter the records in SAP CPI if the end_date is ge a date(I am adding the date which is set earlier.It would be in format yyyy-MM-DD) in XSLT.But my condition is failing with conversion errors.

This is what I am trying to use:

<?xml version="1.0" encoding="UTF-8" ?>" version="2.0" xmlns:xs="">

<xsl:param name="lastrun" select='2021-09-15'/>

<xsl:template match="/"> <Root>

<xsl:for-each select="/CompoundEmployee"> <xsl:if test="xs:date(person/employment_information[1]/end_date) ge xs:date('$lastrun')">

I am getting a error Invalid date "$lastrun" (Non-numeric year component).

I tried a lot of ways but not able to achieve this.

Any help is appreciated.