[
Lists Home |
Date Index |
Thread Index
]
<Quote1>
Title and table...what more examples are there?
</Quote1>
There are actually many - but I think the point is that namespaces can
be used as a "protection" against name collision, even if name collision
never occurs. That is, if I write a schema that has no target namespace,
and I pull in another schema that has no target namespace, I might be
fine at the outset (or perhaps for the life of both schemas). But there
is always a chance that the second schema (the one that I am pulling in)
can be updated (beyond my control!) to include an element whose name is
the same as an element in my schema, but of a different declaration.
Having a target namespace in my schema protects against that.
Of course, the same could happen if both schemas have the same target
namespace - but the assumption (not always true!) is that both schemas
would be developed and maintained by the same organization, and so
(ideally) the second schema will use the same vocabulary as the first
schema. Therefore, the assumption (again not always true!) would be that
there would be some control mechanism to ensure that element
harmonization takes place.
<Quote2>
is it right to say that namespaces are more useful for document
processing?
</Quote2>
Since "data processing" and "document processing" are subjective terms,
I would be interested to learn of your definitions of these.
<Quote3>
It seems they are used more as a way to tell which parts of the document
should be processed by which application.
</Quote3>
I wouldn't say more (but I've never done a survey, of course). I think
that they are useful not only for indicating which parts of the document
should be processed by which application, but also for indicating what
version of a single application a construct conforms to. Consider for
example W3C Schema - as you know, at the top of a schema we place the
following declaration:
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Let's suppose (completely hypotetically) that a new version of W3C
Schema comes out later this year - if we'd like to use constructs from
the new W3C Schema version (or new versions of constructs that existed
in the current version), we could have the following declarations:
xmlns:xsd1="http://www.w3.org/2001/XMLSchema"
xmlns:xsd2="http://www.w3.org/2003/XMLSchema"
Let's further suppose that a new simple type called "fooType" is defined
in the new W3C Schema version. If I want to declare an element of
"fooType" I could write:
<xsd1:element name="MyElement" type="xsd2:fooType"/>
And a schema processor that is compliant with both W3C Schema versions
would recognize the above declaration as valid.
<Quote4>
Still the specification seem to be all about how to solve name
conflicts.
</Quote4>
I'm not so sure that my above W3C Schema example and name conflict
resolution are 2 different things. One way to view name conflict
resolution is to consider names as belonging to vocabularies. In my
above example, the name "fooType" (forgetting for the moment that it is
a datatype) is indicated as belonging to the vocabulary of the
(hypothetical) new version of W3C Schema, indicated by namespace
identifier "http://www.w3.org/2003/XMLSchema". If there existed a
"fooType" datatype in the current version of W3C Schema, above we are
indicating that we are using the new version of that datatype (perhaps
its lexical space has been expanded in the new version).
So if you consider everything a name at its most basic level, we're
really resolving name conflicts here as well.
Kind Regards,
Joe Chiusano
Booz | Allen | Hamilton
Gustaf Liljegren wrote:
>
> Got some inspiration from the "Looking for an example of a name collission"
> thread. It's funny that no one seem to be able to present a *good* working
> example of how namespaces solves name conflicts. I'm not opposing
> namespaces myself, but I still try to find the right place for them.
>
> Namespaces doesn't seem to contribute much to data processing. I've found
> them more useful when mixing tags from document schemas, where tags are
> more likely to have the same generic names like <paragraph>, <list>,
> <table> and so on. It's much harder to find examples when working with
> data, because homonyms where both words are nouns (assuming element names
> are always nouns) are rare. Title and table...what more examples are there?
>
> So, assuming that you limit their use to solving name conflicts, is it
> right to say that namespaces are more useful for document processing?
>
> In actual use however, namespaces are not limited to solve name conflicts.
> It seems they are used more as a way to tell which parts of the document
> should be processed by which application. Still the specification seem to
> be all about how to solve name conflicts. Perhaps it would have been better
> if namespaces had been presented as a way to tie groups of element names to
> a certain processing enviroment, instead of merely solving name conflicts?
>
> Gustaf
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
begin:vcard
n:Chiusano;Joseph
tel;work:(703) 902-6923
x-mozilla-html:FALSE
url:www.bah.com
org:Booz | Allen | Hamilton;IT Digital Strategies Team
adr:;;8283 Greensboro Drive;McLean;VA;22012;
version:2.1
email;internet:chiusano_joseph@bah.com
title:Senior Consultant
fn:Joseph M. Chiusano
end:vcard
|