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

RE: for-each...

Subject: RE: for-each...
From: "Avula, Raj" <RAvula@xxxxxxxxxxx>
Date: Wed, 19 Dec 2001 14:40:29 -0800
raj avula
		<xsl:if test="position()!=last()">
			<xsl:text>.</xsl:text>
		</xsl:if>


--Raj..

> -----Original Message-----
> From:	gabor farkas [SMTP:xlat@xxxxxxxx]
> Sent:	Wednesday, December 19, 2001 2:30 PM
> To:	XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:	 for-each...
> 
> hi,
> 
> i have a tree of <chapter>s in my xml files,
> and i use this code to generate chapter numbers ( like chapter 1.5.3):
> 
> <xsl:template name = "chapter-prefix">
>         <xsl:for-each select="ancestor-or-self::chapter">
>                 <xsl:value-of select="count(preceding-sibling::chapter)+1"
> />
>                 <xsl:text>.</xsl:text>
>         </xsl:for-each>
> </xsl:template>
> 
> and it works...
> but it generates for example. 1.5.4. and i want 1.5.4 , i don't need
> that last dot.
> 
> i know i can do it like this:
> 
> <xsl:template name = "chapter-prefix">
> 
> <xsl:variable name="temp">
>         <xsl:for-each select="ancestor-or-self::chapter">
>                 <xsl:value-of select="count(preceding-sibling::chapter)+1"
> />
>                 <xsl:text>.</xsl:text>
>         </xsl:for-each>
> </xsl:variable>
> <xsl:value-of select="substring($temp,0,string-length($temp))"/>
> 
> </xsl:template>
> 
> but isn't there any more elegant solution?
> 
> bye,
> gabor
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

"MMS <firstam.com>" made the following
 annotations on 12/19/01 14:41:34
------------------------------------------------------------------------------
"THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION.  IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH.  IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."

==============================================================================


 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.