cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT Mapping: code extension

Former Member
0 Kudos

Hello Experts,

   I need help in XSLT mapping.

This is a mapping between IDoc-XMLand XML. the source being IDoc-XML and the target being the XML.

Existing XSLT code, If the source has some value in the field E1EDP10/IDNKD, then map it to target Item/Product/InternalID.

Need to put condition: If the field IDKND is not present in the source then the target field InternalID should have the value 'DUMMY'. The field IDKND would not be present in the Source IDoc-XML. I need to extend the code and put the new condition.

<xsl:when
test
="count(./IDNKD)!=0">

                <Product>

                  <xsl:element name="InternalID">

                    <xsl:attribute name="schemeAgencyID">

                      <xsl:value-of select="$LogSys"/>

                    </xsl:attribute>

                    <xsl:value-of select="./IDNKD"/>

                  </xsl:element>

                </Product>

              </xsl:when>        Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for all the inputs. I am done with this code now.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

If your parent node has occurrence then use for each, otherwise just use xsl:if  "not(path/IDNKD) alone

<xsl:for-each select="/yourNodepath/.../">

      <xsl:if test="not(IDNKD)">

     <! write your logic here ->

    </xsl:if>

</xsl:for-each>

rajasekhar_reddy14
Active Contributor
0 Kudos