xsl-list
[Top] [All Lists]

Re: [xsl] count following-sibling node()

2008-11-15 13:16:20
Got it, thanks!

On Fri, Nov 14, 2008 at 10:50 AM, Vasu Chakkera <vasucv(_at_)hotmail(_dot_)com> 
wrote:

Calling node() is not the same as calling the Element itself
Node in Xpath means:
element, attribute, text, namespace, processing-instruction, comment, and 
document (root) nodes.

This is the tricky bit you should be careful about when you are using the 
position() function or calculating the following sibling etc..

Your logic will if there are other elements , or text nodes etc..

the easiest way to explain your problem is to introduce another element after 
your sixth EVENT , call it

 will call ONLY EVENT nodes
 WILL CALL even the NEW-EVENT nodes


This is easy identification of problem.


 It gets tricky when there are invisible nodes like the text nodes.
 will call ONLY EVENT nodes
 WILL CALL *ALL* the nodes including the invisible text nodes.

Its really not *invisible* text nodes for a pair of eyes seeing XML for a 
long time. But it could be confusing!!

I think this is where you got confused.

 HTH

Vasu Chakkera
Numerical Algorithms Group.
Oxford
www.vasucv.com




Date: Thu, 13 Nov 2008 21:57:24 -0700
From: kstubs(_at_)gmail(_dot_)com
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] count following-sibling node()

Assuming the context is:
EVENT[6]
And there are 10 EVENT elements.

Why am I getting different results for the following counts:




Assume the following XML:



_________________________________________________________________
Register once and play all contests. Increase your scores with bonus credits 
for logging in daily on MSN.
http://specials.msn.co.in/msncontest/index.aspx
--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--