on 01-03-2024 7:38 AM
How to compare the two incoming xml payload's from databases and finding the difference between the payloads in sap cpi?
This is an XSLT Mapping example we used in past to resolve quickly this problem
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!--
<root>
<new>
<crm>
<item>
<old>
<crm>
<item>
-->
<xsl:template match="/">
<crm>
<xsl:apply-templates select="/root/new/crm/item"/>
</crm>
</xsl:template>
<xsl:template match="item">
<xsl:variable name="id" select="SUCCESSFACTORS_ID"/>
<xsl:if test="not( /root/old/crm/item[ SUCCESSFACTORS_ID = $id ] )">
<!-- NEW ELEMENT -->
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
<xsl:if test="/root/old/crm/item[ SUCCESSFACTORS_ID = $id ]">
<xsl:if test="not( . = /root/old/crm/item[ SUCCESSFACTORS_ID = $id ])" >
<!-- MODIFIED ELEMENT -->
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
we just created a merged xml on Content Modifier before launch it.if you need more explain contact me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.