Ravindar, Biztalk Developer and Administrator

Just another BizTalk blog

Loop through a set of variables or set of elements

To loop through a set of specific variable values


<xsl:for-each select="$var1 | $var2 | $var3 ">
<xsl:if test=".!=''">   (to test if the varirable value is not null)

<xsl:value-of select="."/>
<xsl:if test="not(position() = last())">,</xsl:if>   (to avoid last comma)
</xsl:if>

</xsl:for-each>

 

 if you want to loop through a set of node values

<xsl:for-each select="element1Xpath/text() | Element2Xpath/text()| ElementNxpath/text()">
        <xsl:value-of select="."/>
        <xsl:if test="not(position() = last())">,</xsl:if>
      </xsl:for-each>

Advertisements

June 11, 2017 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: