This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

path-predicate question



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]