Skip to Content
avatar image
Former Member

XSLT Map query If statement with 2 conditions.

Hi,

File to Idoc:

-


If $headNode/Field10 = 'LF'

and $headNode/Field11 = '1555'

then I need create addional segment of E1EDK14 with below values.

E1EDK14-QUALF = '011' and

E1EDK14-ORGID = '122'.

Here is the code which I written and it is working correctly when i tested in Altova. But it is not working once I imported into XI.

-


<xsl:if test="$headNode/Field10 = 'LF' and $headNode/Field11 = '1555'">

<xsl:call-template name="printE1EDK14-LF">

<xsl:with-param name="QUALF" select="'011'"/>

<xsl:with-param name="ORGID" select="'122'"/>

</xsl:call-template>

</xsl:if>

<xsl:template name="printE1EDK14-LF">

<xsl:param name="QUALF"/>

<xsl:param name="ORGID"/>

<E1EDK14 SEGMENT="1">

<QUALF>

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

</QUALF>

<ORGID>

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

</ORGID>

</E1EDK14>

</xsl:template>

Kindly suggest me is there anything i need to do.

Thanks

Deepthi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 18, 2010 at 06:52 AM

    Hi ,

    You have hard coded the ORGID and QUAL value in XSLT mapping program it self, how about in PI,

    are you taking from IDoc or hard coded values will enough.?? if you want to take these value from soure payload then you ahve to mention XPath in XSLT mapping

    The code what you have written looks perfect for me, i dont have XML Spy to test, test once again in Spy, And Upload in to PI,it will work.

    is there any reason to for XSLT mapping here?? we can esily do it in Graphical mapping.

    Regards,

    Raj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Raja,

      >> are you taking from IDoc or hard coded values will enough.?? if you want to take these value from soure payload then you ahve to mention XPath in XSLT mapping

      Harcore values will enough but I need to pass for condition when Source Field10 = 'LF' and Field11 = '1555'.

      >> is there any reason to for XSLT mapping here?? we can esily do it in Graphical mapping.

      I got this small request to change the old xslt map which is running already in production for ages.

      I tried many options..

      <xsl:if test="($headNode/Field10 = 'LF' and $headNode/Field11 = '1433')">

      or

      <xsl:if test="$headNode/Field10 = 'LF' and $headNode/Field11 = '1433'">

      or

      <xsl:for-each select="$headNode">

      <xsl:if test="(./Field10 = 'LF') and (./Field11 = '1433')">

      It's working perfectly in xmlspy and not working in PI. Any idea?

      Thanks

      Deepthi.

  • avatar image
    Former Member
    Jun 21, 2010 at 01:44 AM

    Apologies..!! the code is working. im trying with wrong value 1556 instead of 1555.

    Thanks

    Deepthi.

    Add comment
    10|10000 characters needed characters exceeded