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

Re: concat string

Subject: Re: concat string
From: Ian Davis <iand@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Nov 2000 17:53:06 +0000
xml concat string
On Thursday, November 30, 2000, 3:06:49 PM, YueMa wrote:

> Hi there,

> In my XML I have:
> ..
> <keys>key1</keys>
> <keys>key2</keys>
> <keys>key3</keys>
> ..

> And I would like to have a stylesheet to generate things like:

> <META http-equiv="Keywords" name="Keywords" content="key1, key2, key3">

> How can I do that ?

Try this:

<meta http-equiv="Keywords" name="Keywords">
  <xsl:attribute name="content">
    <xsl:for-each select="key">
      <xsl:value-of select="." />
      <xsl:if test="position() != last()>
        <xsl:text>, </xsl:text>
      </xsl:if>
    </xsl:for-each>
  </xsl:attribute>
</meta>

Regards,

Ian
http://www.calaba.com [work]
http://InternetAlchemy.org [play]



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • concat string
    • YueMa - Thu, 30 Nov 2000 10:06:49 -0500
      • Jon Payne - Thu, 30 Nov 2000 17:07:34 -0000
      • Ian Davis - Thu, 30 Nov 2000 17:53:06 +0000 <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

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