path-predicate question

Subject: path-predicate question
From: Perry Roland <pdr4h@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Aug 2000 09:56:58 -0400
Hello, XSLT Wizards,

I thought I understood position() in predicates, but my self-
confidence has been shaken by the following --

<xsl:when
test="preceding-sibling::*[starts-with(name(),'div')][position()=1]">

The question is: Is this statement true only when the immediately
preceding sibling is a div or is it also true when there are any div
preceding siblings?  If the latter, then how do I select the first div
preceding sibling, skipping any non-div siblings?  Does

<xsl:value-of
select="preceding-sibling::*[starts-with(name(),'div')][position()=1]"/>

do the trick?  If so, then the [position()=1] part of the predicate
behaves differently when used with 'test' than with 'select', no?

I'm soooo confused.

--
perry


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


Current Thread