Ravindar, Biztalk Developer and Administrator

Just another BizTalk blog

Get Uniques values from a list through XSLT

Get Unique values for a list of values




The desired output is:


so use this

<xsl:variable name="unique-list"
select="//state[not(.=following::state)]" />

for example like below 

<xsl:variable name="unique-list"
select="s4:AdTermID[not(.=following::s4:AdTermID)]" />

the above statement will get the unique values in to that variable (just like it is an array)

if you want to make a for each loop based on this unique values use below code

<xsl:for-each select="$unique-list">

your logic here


if you want to compare any value to this array element use below code where AdTermID is the elemnt

<xsl:if test="your elment here=s4:AdTermID[not(.=following::s4:AdTermID/text())]">

when you try to compare a value with thes values in the array you should use /text()

source of article

see the comments of Abhinav Maheshwari


June 16, 2011 - Posted by | Biztalk Server

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: