- From: Sarah Wilkin <swilkin@apple.com>
- Date: Mon, 6 Oct 2003 16:43:38 -0700
- To: "Kay, Michael" <Michael.Kay@softwareag.com>
- Cc: public-qt-comments@w3.org
- Message-Id: <E8684C21-F856-11D7-B75D-000A278462D6@apple.com>
Thank you for this explanation. Coming from an XQuery standpoint, I was not aware of the namespace axis in XPath, nor that it was deprecated. I originally got stuck on this point because fn:node-kind states it can return "namespace" and I could find no way to get at a namespace node (since even computed namespaces must be within an element). --Sarah On Oct 6, 2003, at 3:17 PM, Kay, Michael wrote: > > However, writing it inline gives the impression that it could be > > matched as an attribute, such as $alt/@xmlns:metric. From what I > > understand, this is not the case. So count($alt/attribute()) would > > return 0, but count($alt/node()) would return 1. If this is the case, > > then it seems to be an omission not to have a namespace kind test > > (especially when there is one for every other kind of node). > > You can retrieve namespace nodes using the namespace axis, > count(namespace::*) will return the number of namespace nodes. But we > have deprecated the namespace axis in XPath 2.0 because we want > implementations to have maximum freedom in how they represent the > information that modelled formally in the Data Model using namespace > nodes. In XQuery, and in XPath 2.0 if the namespace axis is not > provided, there is no expression that returns a namespace node. > > There is no need for a KindTest for namespace nodes, because they are > found only on the namespace axis, so looking for all nodes on the > namespace axis works fine. > > > > > I can see no other way to do such matching/resolving other than using > > get-in-scope-namespaces then resolving each prefix. > > get-in-scope-namespaces() was indeed provided as a replacement for the > namespace axis. It provides the information that's needed (the set of > namespace prefix/uri pairs for each element) without imposing > semantics that aren't needed (namespace nodes have distinct identity, > they have parents, they have an ordering in document order). > > Michael Kay
Attachments
- text/enriched attachment: stored
Received on Monday, 6 October 2003 19:43:05 UTC