Thursday, October 18, 2007

XPath features

hard to recognize at the first try feature of XPath




return different answers. This becomes more clear when "//" is replaced with what it stands for:


This suggests two things that need to be addressed when XPath is covered in class:

  • Location steps are evaluated in their full, each input node from the sequence (nodelist) at a time.
  • The exact verbose equivalent to "//" is "/descendant-or-self::node()/", which means that any //x expression is actually two location steps, not one.

O'Reiley's book on XQuery actually has this example.

No comments: