ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: String -> Ressource (was Re: archivefileset resources)
Date Fri, 23 Mar 2007 17:27:20 GMT
> > --- Steve Loughran <stevel@apache.org> wrote:
> rule 1 of xml: nobody understands XML namespaces
> rule 2: anybody who says they do. still doesnt.
>
> so there are the following categories
>
> -ignorant of xmlns
> -vaguely aware, but doesnt understand
> -think they understand,  but doesnt really
> -knows xmlns enough to know it doesnt make sense, and doesnt understand

Maybe I'm being naive Steve, but the rules for XML NS are *NOT* that complex.

It's fairly easy to know which NS an element or attribute belongs to,
and the parser tells you anyway.

> if you meet someone who thinks they do understand it, ask them if, in
> xml schema, the ##local namespace is in ##other, or not.

How namespaces are used in XSDs for validations is not really part of XML NS.

Here's my limited understanding of XML NS which is enough to know AFAIK:

1) attributes are in no namespace, unless they have an explicit
namespace prefix, which of course must have been declared and be in
scope.

2) elements with an explicit namespace prefix, which of course must
have been declared and be in scope, belong to that explicit namespace.

Sure, the prefix can be remapped to another namespace anywhere in the
document, but people rarely do that, and the parser keeps track of
that for you.

3) elements with no explicit namespace prefix either are not in a
namespace at all, or belong to the namespace mapped to the "default"
namespace in scope, i.e. the one declared with a xmlns="..."
declaration, as opposed to a xmlns:prefix="..." one.

Again, people rarely remap the "default" (missing) namespace prefix in
their documents to differing namespaces.

And that's IT. How can you say that it's THAT complicated ;-)

I consider it unfriendly to map a given NS prefix to more than one NS
in a given file, and to not declare all namespaces in the root
element, especially if there is a "default" namespace.

Stop spreading false information about namespaces Steve ;-))) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message