Skip to Content
0

condition in xslt mapping

Mar 02, 2017 at 08:26 AM

28

avatar image

Hi All,

i need to put one condition in xslt mapping and the requirement is like below

In the input payload we are getting below segment like

<charac>

<charactername>

<charactervalue>

</charc>

so the above segment may come multiple times but based on the few values only need to populate the receiver segment for example,

<charac> ------------------------------------------------ 1

<charactername>print</charactername>

<charactervalue>123</charactervalue>

</charc>

<charac> -------------------------------------- 2

<charactername>comp</charactername>

<charactervalue>1234</charactervalue>

</charc>

<charac> ------------------------------------------ 3

<charactername>pal</charactername>

<charactervalue>1235</charactervalue>

</charc>

so here I need populate segment when charactername is equal to only print or comp.

the receiver structure the segment is

<e1edl1>

<at>

<rt>

</e1edl1>

so the output should be like

<e1edl1> ---------------------------- 1

<at>print</at>

<rt>123</rt>

</e1edl1>

<e1edl1>

<at>comp</at> -------------------- 2

<rt>1234</rt>

</e1edl1>

Regards,

Janardhan

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Evgeniy Kolmakov Mar 02, 2017 at 01:43 PM
0

Hi Janardhan!

You could use either separate template or <xsl:for-each> loop. And condition might look like:

//charac[charactername = 'print' or charactername = 'comp']

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded