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

Interpretation of the XPath Rec.

Subject: Interpretation of the XPath Rec.
From: Mike Olson <Mike.Olson@xxxxxxxxxxxxxxx>
Date: Sun, 05 Mar 2000 20:08:28 -0700
Interpretation of the XPath Rec.
I have a qeustion about predicates and predicate lists.  We were going over an answer posted by Mike Kay a bit ago.  The example had input XML of:

<?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
 
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.