>harder to think about it. The fact that the namespace prefix may actu=
ally
>be declared physically in the document after the DOCTYPE doesn't matte=
r. At
>the time when the instance is to be compared to see if it matches the
>declaration in the DTD, the prefix to URI mapping is available. Can y=
ou do
>this without modifying your validation code? Certainly not.
>
>However, the approach I've outlined above still has a severe problem, =
which
>I don't think is so easily solved. In order to do this form of valida=
ton,
>what gets put in the DTD is the prefix, and not the URI. That is a fa=
tal
>flaw, because it makes it impossible to re-use a DTD for more than one=
>document unless all documents that use that DTD use the same prefix fo=
r the
>same URI. That elevates the prefix to the same status as the URI --
>something one must take care to keep globally unique. The prefix is n=
ot
>syntactically suited to this task."
I keep coming back to namespaces in the context of the programming lang=
uages
that have used them, and think that these experiences should apply to X=
ML's use
to some degree or another. Maybe their uses in XML will be radically di=
fferent
becaues of the different uses of the two, but overall, past experience =
should
be some guide.
The C++ scenario is much like that of XML. The prefixes themselves must=
be
unique within any conglomeration of code from multiple sources. Has thi=
s been a
severe restriction in the C++ world? I don't think it has really, but s=
ome
might argue that its because XML will much more often be used to slap t=
ogether
bits and pieces than a C++ application would. Mostly, the namespaces us=
ed are
those of well known companies or standards organizations, right? We all=
know
their prefixes and how to stay away from them. Any locally used namespa=
ces are
ours to pick, but if a clash occurs we have to deal with it manually.
So, I guess the question is, how similar to C++ do people see XML's use=
being?
Will their primarily be large, well defined namespaces that make up the=
bulk of
the reusable goodies out there? Or, will it be the opposite? To the fol=
ks who
say that it will be the opposite, I'd reply that we software coders kee=
p saying
the same thing too, but I'm not sure its happened yet :-)
The other possible model, is that of Java. Java's model is basically li=
ke the
"Use the whole URI" method, which is obviously yucky give the syntax of=
URIs.
But in terms of bulk and usage, that's pretty much what Java has done. =
You have
to use fully qualified name of a class to indicate a particular class. =
The
obvious advantage that Java has in this respect is that they forsaw and=
built
this in, so the names are a relatively reasonable hierarchical system t=
hat can
fit over the whole universe. Perhaps this would not be a bad idea for X=
ML as
well, instead of allowing any random URL. The ability to package XML fr=
agments
as 'classes' and being able to say foons=3D"com/ibm/xml/Businesswidgets=
" to get
access to any of the Businesswidgets provided by IBM, would be a nice w=
ay to
go. And, if there are disambiguations to do, the developer of the sourc=
e
document handles it, just as they do in Java by using the fully qualifi=
ed name.
That's just the way that the cookie crumbles, and we shouldn't expect a=
ny more
magical way to deal with it?
So, anyway, overall I'm just asking "How real are the problems being di=
scussed
in the domains where namespaces have been in real use" and "How relevan=
t are
those previous experiences vis a vis how similarly we feel XML's use wi=
ll be to
that of traditional programming languages" and "If they are relevant, a=
nd some
previous experience matches expected XML usage closely, why not apply t=
hat
previous experience now while we have the chance even if its a somewhat=
radical
departure".
Ok, so blast away :-)
----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
roddey@us.ibm.com
=