Lists Home |
Date Index |
----- Original Message -----
To: "Jeff Greif" <email@example.com>
Sent: Thursday, February 17, 2005 9:01 AM
Subject: Re: [xml-dev] Why associate an attribute with a namespace ?
> >By using an attribute from a particular namespace which has a "global"
>>declaration (for example in XML Schema), you can ensure that any reference
>>to that attribute name will require values of the same data type.
> This is a valid reason, indeed. The only valid reason in seven 7
your trolling is massive...
as noted by others, there are other reasons.
one does not necissarily need to process xml as a tree (though often common
and simpler), one can process xml via a number of passes (the attributes may
hold info irrelevant to the semantics of the format, but maybe relevant to a
now, yes, sometimes they are overused, or it is easier to fudge over the
semantics (eg: treating 'xml:lang' as if it were a normal format tag), but
on this route, why do we even need to distinguish between attributes and
tags at all?
everything done with attributes could also be done with tags, right?
until a certain kind of problem pops up:
one can't add tags in all circumstances without potentially effecting the
semantics of an app (or at least if the format ends up being designed
similarly to s-exps, vs. like tradiotional xml).
may not allways be safely altered to:
(foo "hello" (lang "english"))
as lang may well be interpreted as part of foo's data vs as a descriptive
tag. this is potentially remedied with namespaces:
(foo "hello" (bar:lang "english"))
implicitly, "hello" is under the default namespace, thus relevant to foo
(also under the same namespace), but lang is under the bar namespace, and
likely ignored by something only concerned with the default namespace.
imo, similar applies to attributes.
(I appologize to anyone if I am missing the point myself...).
not too long ago I had a similar kind of argument, however, with a person
who thought that dynamic typing offered no real possible advantage over
static typing (in the c++ or java sense), and that scripting languages and
interpreted languages had no practical reason to exist.
"dynamic" is sometimes important.
I will draw a comparrison.