Skip to Content
0
Aug 20, 2023 at 10:52 PM

CPI Mapping-Script to filter Compound Employee response

140 Views Last edit Aug 22, 2023 at 11:25 AM 4 rev

Hello Experts,

In my scenario ,I have the following XML input file (in a very shortened form):

image.png

When replicating employees with multiple records of "PersonalDetails, the mapping works intermittently.

How can I keep only the personal_information record where end_date > =current date ?

I have applied the below standard function :

image.png

image.png

Filter und XSLT mapping :

/queryCompoundEmployeeResponse/CompoundEmployee [xs:date(person/personal_information/end_date) ge xs:date(current-date())]
?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xsl:mode on-no-match="shallow-copy" />
  <xsl:template match="/queryCompoundEmployeeResponse/CompoundEmployee[xs:date(person/personal_information/end_date) ge current-date()]"/>
</xsl:stylesheet>

<br>

But this is not woking for me.Please let me know how can resolve this issue ?(Using XSLT mapping or Custum Function...)

Regards,

Fathi

Attachments

image.png (144.6 kB)
image.png (44.4 kB)
image.png (85.0 kB)
image.png (144.6 kB)