"Matt Gushee" <mgushee / havenrock.com> wrote in message
news:20020930193709.GA1749 / swordfish...
> > >> <element1 xmlns:N='namespace1'>
> > >>     <element2 xmlns:N='namespace1'/>
> > >> </element1>
> > >>
> > >> is legal (though a questionable practice, and ignoring opinions
w.r.t.
> > >> Namespaces being URLs). In this example there are two namespaces but
only
> > >> one prefix is used. In general, the prefix mapping to namespace is
scoped.
> > >> This makes it impossible to answer the question you want to ask
unless you
> > >> can identify a spot in the document.
> > >
> > > I would say 'unreliable' rather than 'impossible'. You're quite right

What about scoped access:
ns_of_fullname("N") yields prefix for outermost scope
ns_of_fullname("N.N") yields namespace string of nested scope.
ns_of_name("N") yields best matching, preferring least nested scope in case
of a conflict.

Mikkel