[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|