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

SAP CPI:Filter condition in XSLT with date compare

657 Views

Hi,

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" ?>

http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:xs=" http://www.w3.org/2001/XMLSchema">

<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.