Re: [xsl] concatenate multiple attribute values and assign it to another attribute

Subject: Re: [xsl] concatenate multiple attribute values and assign it to another attribute
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 29 Mar 2007 23:40:32 +0200
Shaikh, Parvez wrote:


based on michael kay response or abels response if I do, the problem is
I get 4 outputs of testnode
i.e

<testnode att1="1,2,3,4" att2="a,b,c,d" />
<testnode att1="1,2,3,4" att2="a,b,c,d" />
<testnode att1="1,2,3,4" att2="a,b,c,d" />
<testnode att1="1,2,3,4" att2="a,b,c,d" />



I want it to output only once.
This is what I have done based on michaels response. The following is a
portion of the xslt file I have.

 <xsl:template match="//testnode">
   <testnode>
 ....

This is not how (we / I) suggested it. You are matching for each and every testnode here (it is never needed to have a match="//xyz", use match="xyz" instead, which acts equally), of course you will create a new node each time a 'testnode' is encountered. This is the reverse of our solutions.


Please try our examples, they work 'out of the box' with the input you gave us, and go from there.

Current Thread