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] |
<?xml version="1.0"?>
<elementList>
<element>
<x>
<y>a</y>
</x>
</element>
<element>
<x>
<y>z</y>
</x>
</element>
</elementList>
And a stylesheet of:
<xsl:variable name="pos">
<xsl:for-each select="//element[descendant::y[.='z']][1]">
<xsl:number/>
<xsl:for-each>
</xsl:variable>
Thr question arose in 4XSLT when we tested this and got different results then expected. After reading the spec we came to our question.
When filtering a node set with multiple predicates, does the context size and context proximity position change after each predicate is tested, or are the size and position of the node set that results from the node test used?
In section 2.4, the spec gets really unclear with a lot of node-set and new node-set references.
It would seem from the above xslt and answer that size and position
do change, as [1] would only evaluate to true for the second "element"
if it was in the first position in the "new node-set". If position
does not change with each new predicate then the above xslt would not work
because there is no "element" with a descendant of y equal to z that is
the first "element" in the descendants.
Mike
-- Mike Olson Senior Consultant Fourthought, Inc. http://www.fourthought.com http://www.opentechnology.com 720-304-0152
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |