[Home] [By Thread] [By Date] [Recent Entries]
At 08:34 AM 8/5/2006 (ages ago), Ken wrote:
/Trade//Value - returns all 3 <Value> nodes /Trade//Value[1] - also returns all 3 <Value> nodes (why is that ?) /Trade//Value[2] - returns nothing (why is that ?) ... I've started teaching /descendant::Value[1] as a more intuitive and transparent solution to this little (but consequential) conundrum. It's also reassuring to newcomers who want a simple thing to be simple, and who get scared when they learn that parentheses have such magic power without fully understanding why. One has to be willing to think with the literal-mindedness of a machine to tell the difference between /descendant-or-self::node()/child::Value[1] and (/descendant-or-self::node()/child::Value)[1], and that can take a bit of practice. Cheers, Wendell
|

Cart



