[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] get immediat preceeding node, if it is a comment
Subject: RE: [xsl] get immediat preceeding node, if it is a comment From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx> Date: Fri, 4 Oct 2002 15:16:31 +0100 |
DC: > All later predicates refer to nodes for which earlier predicates are > true. That sums it up nicely, cheers andrew > -----Original Message----- > From: David Carlisle [mailto:davidc@xxxxxxxxx] > Sent: 04 October 2002 14:25 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] get immediat preceeding node, if it is a comment > > > > > It seems that any predicates after the positional predicate refer to > > that node, not to the node that the predicates before the positional > > predicate refer to... > > yes but that's a special case. You can have any number of [] > predicates > in a step and after each one the remaining nodes in the current node > list are those nodes for which the predicate was true. while > evaluating > the next [] position() and last() and count() all refer to the current > node list (ie the list of nodes that have survivied any previous [] > predicates in the step) > > > > preceding-sibling::node()[normalize-space()][1][self::comment()] > > > > this gets 'test1' and 'test3' as we would expect > > anything that involves [1] (anywhere) will select a node set > of at most > one node. Your description in english suggests you used the expression > > */preceding-sibling::node()[normalize-space()][1][self::comment()] > > while <root> is your current node. > > ie find all children that have the stated condition. > > > So is it the case that all predicates to the right of the positional > > predicate refer to that node? (they change the context node) > > Yes but there is nothing special about the positional predicate it is > just shorthand for the boolean test [position()=1]. > All later predicates refer to nodes for which earlier predicates are > true. > > David > > _____________________________________________________________________ > This message has been checked for all known viruses by Star Internet > delivered through the MessageLabs Virus Scanning Service. For further > information visit http://www.star.net.uk/stats.asp or > alternatively call > Star Internet for details on the Virus Scanning Service. > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.394 / Virus Database: 224 - Release Date: 03/10/2002 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 03/10/2002 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] get immediat preceeding n, Passin, Tom | Thread | Re: [xsl] get immediat preceeding n, David Carlisle |
RE: [xsl] Grouping with keys or xpa, Michael Kay | Date | RE: [xsl] get immediat preceeding n, Michael Kay |
Month |