Skip to Content
Former Member
Oct 15, 2013 at 12:52 PM

Email interface using XSLT Mapping issue


Hi Experts,

I have a requirement to create an HTML Email using the XSLT Mapping in SAP PI 7.31 java stack.

Below is the source structure:










Above structure needs to be mapped to standard mail package <content> field. How to iterate the section segment which contains

multiple <para> tags and <LineItem> tags in XSLT mapping. I have tried below XSLT mapping code -

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:ns0="">

<xsl:output method="xml" indent="yes" />

<xsl:template match="/">

<Mail xmlns="">

<xsl:for-each select="//Mail"/>


<xsl:value-of select="ns0:Mail/Content/Header"/>

<xsl:for-each select="//Paragraph">

<xsl:value-of select="//Paragraph"/>


<xsl:for-each select="//LineItems">

<xsl:value-of select="//LineItems"/>


<xsl:value-of select="ns0:Mail/Content/Footer"/>





Above code always gives me the first para value duplicated for all the other para values and first LineItem value duplicated for all the other LineItems.

Please help me correcting this XSLT mapping code. If any one already worked on such scenario, please share sample code.