View Single Post
  #2 (permalink)  
Old August 12th, 2004, 03:26 AM
pgtips pgtips is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well, it all depends what you think a node is. The node() test matches all types of nodes, i.e. comment, PI, element and text nodes, so if you're getting the "wrong" answer, then you're using the wrong test!

I don't see how you get 30 from the sample XML you posted, nor do I see why you expect 20. I suggest you look at the alternatives to node() at http://www.w3.org/TR/xpath and decide which one(s) you want to count.
Reply With Quote