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

RE: Searching the last element

Subject: RE: Searching the last element
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Fri, 25 Apr 2003 18:23:22 +0100
RE:  Searching the last element
> 
> I tried the followoing to add a star "*" at the end of the 
> text from the last p-element:
> 
> <xsl:template match="p">
>   <p><xsl:apply-templates/>
> 	<xsl:if test="/text/p[position()=last()]">
> 	<xsl:text> *</xsl:text>
> 	</xsl:if>
>   </p>
> </xsl:template>
> 
> But I get -- surprise, surprise -- a star beyond every 
> paragraph. Can anybody point me in the right direction?
> 

Since your test uses an absolute path expression (one starting with "/")
it should be pretty obviuos that it gives the same result for each "p"
element.

Try test="following-sibling::p"

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 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.