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

Re: selecting similar nodes

Subject: Re: selecting similar nodes
From: "Pete Johnston" <P.Johnston@xxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Sep 1999 17:06:13 GMT
Re: selecting similar nodes
[Richard Sargeant]

> If my current node is 1001,  I want to be able to process 1002, and 1003 at
> the same time. So I thought the following would work...
> 
> 	<xsl:for-each select="from-following(DESCR[text()=text()])">
> 		<xsl:call-template name="Details"/>
> 	</xsl:for-each>
> 
> What am I doing wrong ?

I'm not clear exactly where your loop is located (i.e. in the 
template matching which element), but I think it might help to make 
use of the current() function somewhere.... something like (this in a 
template matching ITEM):

<xsl:for-each
select="following::*[DESCR[text()=current()/DESCR/text()]]">

[Do whatever you want to do]

</xsl:for-each>

Current() was only added in the last draft and your syntax 
suggests you're using an earlier one, so if you don't upgrade you may 
need to save the current DESC/text() in a variable and then compare 
against the value of the variable. 

Also, as I set it up, this will process items 1002 and 1003 with 
1001, but also item 1003 with 1002 when the latter is reached... that 
may be what you want or it may not!

Pete Johnston
University of Glasgow


 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.