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

Concat strings

Subject: Concat strings
From: "Maulik Modi" <mxmodi@xxxxxxxxxxxxxxx>
Date: Tue, 19 Sep 2000 19:13:26 -0500
concat strings

Hi,

I want to create <td> cell names to uniquely identufy each data cell that I
create. I think I am almost there, just need a brush up on how to concatenate
strings in XSLT. Thanks for the help.

Following is my sample XML file:

<queryemp>

<parameters>
<Name></Name>
</parameters>

<data>
<Name>Joe Smith</Name>
<Name>Maulik Modi</Name>
<Name>Test1</Name>
<Name>Test2</Name>

<Week>09/03/2000 - 09/10/2000</Week>
<Week>08/03/2000 - 08/10/2000</Week>
<Week>05/05/2000 - 05/12/2000</Week>
<Week>09/03/2000 - 09/10/2000</Week>
</data>

</queryemp>

Following is my sample XSL file:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head></head>
<body>
<table border="1" cellpadding="2" cellspacing="0" width="100%" align="center">
<tr bgcolor="#c3c3c3" style="color:black">
<th>Employee</th>
<th>Week Of:</th>
</tr>
<xsl:apply-templates select=".//data/Name" />
</table>
</body>
</html>
</xsl:template>

<xsl:template match="Name">
<tr align="center">
<xsl:if test="position() mod 2 = 0">
       <xsl:attribute name="bgcolor">#ffcc60</xsl:attribute>
</xsl:if>
<td><xsl:attribute name="name"><xsl:variable name="namepos"
select="position()"/><xsl:value-of
select="'name'+string($namepos)" /></xsl:attribute><xsl:value-of
select="."/></td>
<td><xsl:attribute name="name"><xsl:variable name="namepos"
select="position()"/><xsl:value-of

select="'week'+string($namepos)" /></xsl:attribute><xsl:value-of
select="."/></td>

</tr>
</xsl:template>

</xsl:stylesheet>




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


Current Thread

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.