Friday 9 April 2021

Format the date column in XSLT and Remove the column from Target XML if Source element is with Null Value

Hi,

Hope you are doing well. 

I came up with the requirement where I need to format the source CREATION_DATE to tns:recordStamp "2021-04-09T22:52:02" format in XSLT. Also I am checking If creation date is not coming from source then tns:recordStamp element should not be in target XML Payload.


XSLT : 

<xsl:if test="/ns0:OutputParameters/ns0:P_PAYLOAD_CUST_SEND_TBL/ns0:P_PAYLOAD_CUST_SEND_TBL_ITEM/ns0:CREATION_DATE !=''">
        <tns:recordStamp>
          <xsl:value-of select="xp20:format-dateTime (/ns0:OutputParameters/ns0:P_PAYLOAD_CUST_SEND_TBL/ns0:P_PAYLOAD_CUST_SEND_TBL_ITEM/ns0:CREATION_DATE, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]' )"/>
        </tns:recordStamp>
      </xsl:if>


Cheers!!

No comments:

Post a Comment

String to QR Code Image Generator Using Java

 Hi , Hope You are doing well. I came up with the requirement, where I need to generate QR code Image file for the input String. package dem...