Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2006, 08:49 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Appending values

hi i have a code as follows

Code:
<xsl:for-each select="elem1">
<xsl:variable name="level1" value="position()"/>
 <xsl:for-each select="elem2">
 <xsl:variable name="level2" value="position()"/> 
 </xsl:for-each>
</xsl:for-each>
i would like the variable level2 to have the level1 value appended

for example if level1 = 1, 2, 3 ...
then level2 = 11, 21, 31, ..

Thanks for the help



 
Old May 9th, 2006, 10:01 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Firstly I assume you know that

<xsl:variable name="level1" value="position()"/>

should be

<xsl:variable name="level1" select="position()"/>

Just write

<xsl:variable name="level2" value="concat($level1, position())"/>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 9th, 2006, 11:21 PM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi thanks for the reply
sorry for the mistake in the code i wrote

thanks







Similar Threads
Thread Thread Starter Forum Replies Last Post
Appending unmatched and override matched values ShaileshShinde XSLT 5 April 24th, 2008 08:52 AM
Appending Files indupriyav Other Programming Languages 0 March 12th, 2008 05:57 AM
Help in appending a single record. prashanthmcr SQL Language 0 December 14th, 2005 08:47 PM
Appending to a TextFile jfleming SQL Server DTS 3 June 16th, 2004 08:45 AM
APPENDING TO A RECORD sinner Classic ASP Databases 4 June 2nd, 2004 01:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.