[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Output multiple occurence into one and concatenate

Subject: Re: Output multiple occurence into one and concatenate values
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 29 Mar 2007 18:41:14 +0200
Re:  Output multiple occurence into one and concatenate
Shaikh, Parvez wrote:
I have an XML that has 2 or more occurences of data. I want to comma

delimit the attribute values and output it only once. How do you do that

You did not include your XSLT, so I have no clues as to how you go wrong or what you tried. Do you use XSLT 1 or 2? In XSLT 2 you can do this:


<xsl:value-of select="//@project" separator="," />

make sure you place it in the right context. But to help you with that, we need to have a look at your current XSLT and what it currently (wrongly) produces.

In XSLT 1, btw, you can simply use apply-templates on the selection of the attribute nodes and do this in the matching template:

<xsl:template match="@project" >
   <xsl:value-of select="." />
   <xsl:text>,</xsl:text>
</xsl:template>


Cheers, -- Abel Braaksma

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.