Subject: Re: position() problem with // axis + parent numbering problem From: David Carlisle <davidc@xxxxxxxxx> Date: Tue, 18 Apr 2000 11:11:30 +0100 (BST) |
> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: position() problem with // axis, Warren Hedley | Thread | Re: position() problem with // axis, Warren Hedley |
Re: Variable Scope and xsl:if, David Carlisle | Date | RE: simple:xsl, Kay Michael |
Month |