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

Re: position() problem with // axis + parent numbering probl

Subject: Re: position() problem with // axis + parent numbering problem
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 18 Apr 2000 11:11:30 +0100 (BST)
Re: position() problem with // axis + parent numbering probl
>  In fact they are mutually exclusive (whooops), 

exactly!

> just not what I was expecting.
what were you expecting? It looks OK to me.
Perhaps you wanted the (//text)[1] form which only returns one node
(see the second half of my example in first reply).



> Note that the first template has been called twice, and a position() call
> inside the template returns the correct position in the context list, yet
> the result appears to conflict with the predicate [1]

no they are not in conflict.

//text[1] is short for

/descendant-or-self::node()/child::text[1]

so the [1] refers to the order in the last step, ie the count from the
parent. this is not the same as /descendant-or-self::text[1] 
so your node list selected in teh for-each selects every text node
that is the first text child of its parent. there are two of those
in your example, and so when _that_ list is being processed they have
position() 1 and 2 respectively.

David


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


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.