RE: KindTest for namespaces

$alt/node() does not retrieve namespace nodes so count($alt/node())
should still return 0.

Namespace nodes are problematic and we decided to have as little support
for them as we can. Also, we feel that we should not provide support for
queries such as "elements with a certain namespace prefix" since such
information should not be semantically relevant (the name of an element
is determined by the namespace uri/name and local name and not the
prefix).

Best regards
Michael

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Sarah Wilkin
> Sent: Monday, October 06, 2003 12:13 PM
> To: public-qt-comments@w3.org
> Subject: KindTest for namespaces
> 
> 
> A clarification:
> A namespace may be generated either inline
> let $alt := <altitude xmlns:metric="http://example.org/metric-system/>
> or with a constructor
> let $alt := element altitude { namespace metric {
> "http://example.org/metric-system" } }
> but not with an attribute named or prefixed with "xmlns".
> 
> 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).
> 
> KindTests namespace() and namespace(N) would help with several
> scenarios. For example, if you want to create a new element with the
> same namespaces of an old element, or if you want to match elements
> that contain a certain namespace prefix.
> 
> I can see no other way to do such matching/resolving other than using
> get-in-scope-namespaces then resolving each prefix.
> 
> Would the working please consider:
> - a clarification sentence regarding namespaces, though written inline
> as attributes, cannot be matched as such
> - adding the KindTests namespace() and namespace(N) where N is a QName
> 

Received on Monday, 6 October 2003 15:19:39 UTC