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

RE: putting number values

Subject: RE: putting number values
From: "Allan Jones" <allan.jones@xxxxxxxxxxxx>
Date: Tue, 4 Mar 2003 10:49:16 -0000
number values
|in the bellow code you can see that with the <xsl:value-of 
|select="name"/> i writte the value of name tag with this i get 
|100 values.
|<xsl:for-each select="registro">
|<xsl:value-of select="name"/>
|but with xslt how can i number them?
|how can i put in this method:
|1 value of name 1
|2 value of name 2
|how can i put the number, the result number?

If they're all separate elements (and your for-each select implies that
this is the case) you can probably just use the position() function:

<xsl:for-each select="registro">
   <xsl:value-of select="concat(position(), ' ', name)"/>

Here, I've used concat to format the output text a little.

The other option might be to use <xsl:number />, which would number all
the sibling elements consecutively.  Have a look at Michael Kay's XSLT
programmer's reference for more information about these.

Allan Jones

Tel:    0121 506 9111
Fax:    0121 506 9112
HYFINITY LIMITED. Registered in England & Wales 4136884. Registered
Blythe Valley Innovation Centre, Central Boulevard, Blythe Valley Park,
Solihull, West Midlands, B90 8AJ. Tel: +44 (0)121 506 9111.

The information contained within this email, together with any
is intended solely for the named recipient(s) and may contain privileged
and/or confidential information. If you receive this in error, please
hyfinity limited immediately and delete this e-mail.

Any views or opinions represented in this e-mail are solely those of the
author and do not necessarily represent those of hyfinity or its

Although this e-mail and its attachments have been scanned for the
of computer viruses, hyfinity will not be liable for any losses as a
of any viruses being passed on. 

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

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.