RE: KindTest for namespaces

> 
> > $alt/node() does not retrieve namespace nodes so count($alt/node()) 
> > should still return 0.
> 
> That is interesting. Could a note to this effect be added to 
> the spec? 
> Currently it says "node() matches any node" (3.2.1.2). As "namespace" 
> is listed under "nodes" in the Data Model 
> (http://www.w3.org/TR/xpath-datamodel/#NamespaceNode), I would expect 
> it to be matched as a node.

I think it's well known to all XPath 1.0 users that ./node() means
./child::node() and therefore retrieves only nodes found on the child axis.
It is indeed something that trips up newcomers, but there are now lots of
beginners' guides to XPath 1.0, and the place for such hints and tips is in
the tutorials, not in the spec.

Michael Kay

Received on Monday, 6 October 2003 18:18:19 UTC