Subject: Re: [xsl] preceding-sibling inside for-each appears to fail From: Francis Norton <francis@xxxxxxxxxxx> Date: Mon, 10 Feb 2003 06:32:31 +0000 |
Wow... that did the trick, but I'm not sure I fully understand the positional predicate.
Because this is the kind of person I am, I also tried running it with "-1" to see if, in fact, you could "reverse" the direction (and effectively reproduce the results of following-sibling). The results show that you can not:
What I'm having a little difficulty understanding is exactly why preceding-sibling, in this example, requires a positional predicate while following-sibling doesn't.
Also, I thought that the node-set returned by the select attribute in the for-each element was complete. In other words, I thought that the select attribute function a little like a select statement in SQL and that the contents of the for-each element acted on the results of the select "statement", but the behavior demonstrated by this code implies that the resulting node-set is built during the loop and NOT as some internal mechanism fetching a "record set" (in MS terminology).
I think some of my difficulty understanding how this works stems from my background with other programming languages where the result of a function is returned at the end, and not during execution.
Thank you very much for your prompt (and accurate) reply. I am now able to proceed with my project (this had me stuck for a week).
[1] http://www.w3.org/Style/XSL/ [2] http://zvon.org/o_html/group_xsl.html [3] http://www.w3.org/TR/xslt#value-of [4] http://www.w3.org/TR/xpath#function-string
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] preceding-sibling inside , Ted Stresen-Reuter | Thread | RE: [xsl] preceding-sibling inside , Michael Kay |
Re: [xsl] Problems copying elements, Dimitre Novatchev | Date | Re: [xsl] Full path to a node, Oleg Tkachenko |
Month |