Actually, there's another one. See my other post on a related thread. I
think that I was confused here. What I think I did was that stuff in the
global namespace really did have an empty URI. I think that the one I
kludged was "xmlns:foo". In this case, the spec says that xmlns maps to
nothing. However, that cannot work because we can't really get more
'nothing' than an empty URL. So there would have been no way to distinguish
this one from something in the global namespace. So I think I mapped it to
an arbitrary internal URL in order to distinguish it.
I'd really hate to have to start having an explicit null representation,
unless we could do it as a string (e.g. <null> or something like that.) But
not matter what, it would require more special case code in client apps that
could have been avoided.
According to the other thread, the W3C has made relative namespace URLs
verboten. But there's no admonishment in the namespace spec to enforce this.
It would have to be added to the parser to check for that. If that were
done, then we'd still have to deal with the 'xmlns as prefix' scenario to
distinguish it from something with no prefix.
--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 3:50 PM
To: [EMAIL PROTECTED]
Subject: RE: Namespace problem in latest code
Actually, I believe there are three states to consider:
1. Element is not in a namespace
2. Element is a namespace whose URI is a zero-length string
3. Element is in a namespace whose URI is a non-zero length string.
Clearly 3 is no problem, but 1 and 2 are a problem. Believe it or not,
this exact issue just come up in Xalan. I think it implies that elements
not in a namespace must a some sort of "null" value for their namespace
URI, which is distinguishable from a zero-length string.
I'd be interested to hear other people's opinion on this. Is it legal to
have a zero-length namespace URI? The parser seems to allow it.
Dave
Dean Roddey
<droddey@port To:
"'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
al.com> cc: (bcc: David N
Bertoni/CAM/Lotus)
Subject: RE: Namespace problem
in latest code
04/02/2001
11:46 AM
Please
respond to
xerces-c-dev
So is it legal to do this:
<foo xmlns:bar="">
<bar:baz someattr="abc"/>
</foo>
If so, then there would be no way to know that baz was in a namespace,
because it would look exactly the same. I know its kind of contrived, but
given that it can probably easly happen, it would have just made a lot more
sense to have a URL for the global namespace. You can say there isn't a
global namespace, but in effect that's what it is. They all have the same
'lack of namespaceness' which makes them all a set that it would have been
good to be able to unambiguously identify.
Anyway, spilt milk under the bridge I guess.
--------------
Dean Roddey
Software Geek Extraordinaire
Portal, Inc
[EMAIL PROTECTED]
-----Original Message-----
From: David E. Cleary [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 10:38 AM
To: [EMAIL PROTECTED]
Subject: RE: Namespace problem in latest code
> But is there anything in the namespace spec that says that the URL for a
> namespace cannot be empty? I didn't see anything that said that, which is
> why I provided a real URL for the global namespace to map to. Personally
I
> think that they should have provided one, since its not true that they
> aren't in any namespace. They are in the global namespace, which is a
well
> defined namespace that's treated as a separate entity.
>From the namespace spec:
A default namespace is considered to apply to the element where it is
declared (if that element has no namespace prefix), and to all elements
with
no prefix within the content of that element. If the URI reference in a
default namespace declaration is empty, then unprefixed elements in the
scope of the declaration are not considered to be in any namespace. Note
that default namespaces do not apply directly to attributes.
There is no such thing as a global namespace. Any elements and attributes
that are not in a namespace should have a URI of "" (the zero length
string).
David Cleary
Progress Software
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]