RE: [xsl] Output multiple occurence into one and concatenate values

Subject: RE: [xsl] Output multiple occurence into one and concatenate values
From: "Shaikh, Parvez" <Parvez.Shaikh@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Mar 2007 14:58:05 -0400
Thanks for all the responses.
I am using at the top
<xsl:template match="/">
<erpayload>
      <xsl:apply-templates select="//erpayload/* |
//erpayload/*/*"/>
    </erpayload>
  </xsl:template>

so All I did based
on what you said was:
 <xsl:template match="cost_allocation_product">
<xsl:value-of select="@project" />
    <xsl:text>,</xsl:text>
</xsl:template>

It did get all the project attributes together. But what I
want to do is
add a node called cost_allocation_product followed by the data
in
attribute value format as given below. In this I am looking at all
concatenated Project attribute
value and concatenated percent value.
<cost_allocation_product>
<dbfield name ="project" value= "1725 -
Project1,1774 - Project2,1755 -
Project3" />
<dbfield name="percent"
value="12,1,87" />
</cost_allocation_product>

How do I get this.
-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx]
Sent: Thursday, March 29, 2007 2:40 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Output multiple occurence into one and concatenate
values
Shaikh, Parvez wrote:
>  
> I am an XSL newbie. Can someone please respond?
>   

It won't help you sending the whole message twice within the hour. We
are all volunteers here and they will help and/or respond when they have
some free time and when they find your query clear and concise enough.

>
>
I have given my XML and XSL below. The rest all is taken care of. All
I
>
want to do is Combine all cost_allocation_product into one and append
> all
values for the attributes when doing thiss. 
>
>   
Thanks for the XML and
XSL, however, next time, please send only the 
relevant parts in a minimal
working sample that explains your problem. 
Usually, doing so, will help you
in understanding your own problem
better.

if you have somewhere:
<xsl:apply-templates select="//cost_allocation_product" />

than you can
place somewhere a matching template:

<xsl:template
match="cost_allocation_product">
    <xsl:value-of select="@your-attr-here"
/>
    <xsl:text>,</xsl:text>
</xsl:template>


That should do it. You
may wrap the apply-templates in a <xsl:attribute 
..> if you want the result
inside an attribute's value.

Cheers,
-- Abel
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To
unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--~--
-----------------------------------------
The information contained in this
transmission may be privileged and
confidential and is intended only for the
use of the person(s) named
above. If you are not the intended recipient, or
an employee or agent responsible
for delivering this message to the intended
recipient, any review, dissemination,
distribution or duplication of this
communication is strictly prohibited. If you are
not the intended recipient,
please contact the sender immediately by reply e-mail
and destroy all copies
of the original message. Please note that we do not accept
account orders
and/or instructions by e-mail, and therefore will not be responsible
for
carrying out such orders and/or instructions.  If you, as the intended
recipient
of this message, the purpose of which is to inform and update our
clients, prospects
and consultants of developments relating to our services
and products, would not
like to receive further e-mail correspondence from
the sender, please "reply" to the
sender indicating your wishes.  In the
U.S.: 1345 Avenue of the Americas, New York,
NY 10105.

Current Thread