OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xml-dev] Global or shared namespace?



Ronald Bourret wrote:

> I don't see what harm this would do. In practice, it is what happens
> anyway. For example, if an element/attribute name is not in a namespace,
> DOM level 2 uses a null for the URI and SAX 2 uses an empty string.


OTH, XML Infoset is clear that the elements or attributes "without 
namespaces" have no namespace name:

http://www.w3.org/TR/xml-infoset/#infoitem.element

   "1. [namespace name] The namespace name, if any, of the element type. 
If the element does not belong to a namespace, this property has no value".

I wonder if the reason shouldn't be searched in the objectives of namespaces:

http://www.w3.org/TR/REC-xml-names/#sec-intro

"Software modules need to be able to recognize the tags and attributes 
which they are designed to process, even in the face of "collisions" 
occurring when markup intended for some other software package uses 
the same element type or attribute name."

When a namespace is used, it is clear that I can compare 
"{http://example.org/ns}foo"; with "{http://example.org/ns}foo"; or with 
"{http://example.org/ns1}foo";.

Considering that elements which do not belong to any namespace belong to a 
global, shared or default namespace and giving it a name might be confusing 
since people could think that "{http://whatever.org/global/namespace}foo";
can be compared to "{http://whatever.org/global/namespace}foo"; which is
not always legitim and "{[no value]}foo" may give a better indication that 
there might be a problem.

I any case, XPath considers that {[no value]}foo is identical to 
{[no value]}foo and this seems to be the only sensible position to adopt.

If we come back to the idea of tag "recognition", we may also wonder 
what's the real benefit of using element types and attribute names, 
especially now that W3C XML Schema is a rec.

Namespaces in XML says that a namespace is a collection of names:

"An XML namespace is a collection of names, identified by a URI 
reference [RFC2396], which are used in XML documents as element 
types and attribute names." 

When DTDs were used, there was an implicit assumption that an element type
was identifying a content model and a certain semantic and the element type
was often used as an ID (for instance by RDF).

With W3C XML Schema and the possibility to define different content models 
and different semantics to the same element type, the usage of the element
type as a "name" seems to be broken.

If you search for "element type" in the schema recommendation, you will find 
the string mentioned once in each part and the concept seems to have been
renamed "element name" in W3C XML Schema.

But those names aren't IDs. The schema for schemas for instance defines 3
different "{http://www.w3.org/2001/XMLSchema}restriction"; elements with 3
different content models and 3 fairly different semantic (for simple types,
complex types/simple content and complex types/complex content models).

We may thus wonder what's the meaning of 
"{http://www.w3.org/2001/XMLSchema}restriction"; and if it can still be 
used to solve one of the problems which namespaces were aiming to solve:

"Such documents, containing multiple markup vocabularies, pose problems 
of recognition and collision. Software modules need to be able to 
recognize the tags and attributes which they are designed to process, 
even in the face of "collisions" occurring when markup intended for some 
other software package uses the same element type or attribute name."

Eric


-- 
See you in Orlando for XML 2001.
                                     http://www.xmlconference.net/xmlusa/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------