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

Re: Looping through multiple elements

Subject: Re: Looping through multiple elements
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 18 Mar 2008 15:27:56 +0000
Re:  Looping through multiple elements
On 18/03/2008, Jones Mark Mr (ITCS) <Mark.Jones@xxxxxxxxx> wrote:
>  example, there are also these fields (dc:creator, dc:creator1,
>  dc:creator2, dc:creator3). I need to make the xml output for this
>  generate the xml below (the names are just examples)
>  <component name="value" group="creators">Smith, Jones, Black,
>  White</component>

In 1.0 you can do:

<xsl:for-each select="dc:creator | dc:creator1 | dc:creator2 | dc:creator3">
  <xsl:value-of select="."/>
  <xsl:if test="position() != last()">, </xsl:if>

In 2.0 it's easier:

string-join((dc:creator, dc:creator1, dc:creator2, dc:creator3), ', ')

Andrew Welch
Kernow: http://kernowforsaxon.sf.net/

Current Thread


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

Buy Stylus Studio Now

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.
First Name
Last Name
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-2013 All Rights Reserved.