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

RE: count following-sibling node()

Subject: RE: count following-sibling node()
From: Vasu Chakkera <vasucv@xxxxxxxxxxx>
Date: Fri, 14 Nov 2008 17:50:12 +0000
RE:  count following-sibling node()
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.


Vasu Chakkera
Numerical Algorithms Group.

> Date: Thu, 13 Nov 2008 21:57:24 -0700
> From: kstubs@xxxxxxxxx
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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.

Current Thread


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.
First Name
Last Name
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.