Namespaces !

Patrice Bonhomme Patrice.Bonhomme at loria.fr
Tue Aug 4 11:06:03 BST 1998


<xml:hi/>

I read the last specification of the XML Namespaces this night. To tell the 
truth it disturbed me somewhat !

 * Namespace Constraint: Prefix Declared

The WD says: "The namespace prefix, unless it is xml or xmlns, must have been 
declared in a namespace declaration. The namespace prefixes xml and xmlns are 
reserved, and considered to have been implicitly declared."

 1/ The example following this definition uses a NS declared after its use :
	"<html:html xmlns:html='http://www.w3.org/TR/REC-html40'>"
    I am not sure that attribute-based is the best way for declaring NS. Why 
not have preserved the old specification for the declarations of XML 
Namespaces (using PI) ? And use something like :

	<?xml:namespace ns="http://www.w3.org/TR/REC-html40" prefix="html"?>
	<html:html xml:ns='html'> ... </html:html>

    Create another reserved name (xmlns) weighs down the XML notation and 
opens the door to already encountered problems (remenber HTML!). Each one 
(Microsoft, Netscape, Sun, ...) will arrive with its own reserved name and one 
will fall down in the same problems as with HTML (<OBJECT> vs <EMBED> for 
example).  We should have only one reserved name : "xml" !!!

 2/ There is a redundancy of information. 

A simple prefix is enough to specify the namespace used :

	<book xmlns='urn:loc.gov:books' xmlns:isbn='urn:ISBN:0-395-36341-6'>
	  <title>Cheaper by the Dozen</title>
	  <isbn:number>1568491379</isbn:number> ...

Should be :

	<book xml:ns="books"> <!-- the default NS is "books" -->
	  <title>Cheaper by the Dozen</title>
	  <!-- switch to "isbn" NS -->
	  <isbn:number>1568491379</isbn:number> ...

    This makes also XML document not easily readable. 

 3/ Implementation.

If i understand the new WD, it's possible to have everywhere within the 
document (in each Element start tag) a Namespace declaration. Hum, i agree 
with James Clark that it is easy to implement but we have to provide for each 
Element object an 'xmlns' attribute and make inherited each one of its 
descendants.


Pat.

-- 
  ==============================================================
  bonhomme at loria.fr               |      Office : B.228
  http://www.loria.fr/~bonhomme   |      Phone  : 03 83 59 30 52
  --------------------------------------------------------------
   * Serveur Silfide  : http://www.loria.fr/projets/Silfide
   * Projet Aquarelle : http://aqua.inria.fr
  ==============================================================



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list