This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: concat string
- To: YueMa <xsl-list at mulberrytech dot com>
- Subject: Re: concat string
- From: Ian Davis <iand at internetalchemy dot org>
- Date: Thu, 30 Nov 2000 17:53:06 +0000
- Organization: Internet Alchemy
- References: <3A266D09.B1928C28@mail.nlm.nih.gov>
- Reply-To: xsl-list at mulberrytech dot com
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