Re: SD5 - Namespaces

	A very simple way forward for the namespace problem
	---------------------------------------------------

This mail describes a very simple approach to the namespace problem that allows
us to manage fragments for all current XML DTDs.  It requires a very minor 
change to the XML-LANG as suggested by MartinB.  We can then create DTDs
which interoperate in both WF and validatable mode.  I also believe the
solution is in the spirit of SGML/XML.

<PROPOSAL VERSION="1.2">
We add a character to Miscname [3] for the sole purpose of managing 
namespace - I'd go along with ':'.  This character is not otherwise
specifically recognised by the parser and is passed unchanged to the 
application.  (We might have to change [5] slightly).
</PROPOSAL>

This allows an author to create their own fully qualified names for GIs,
thus avoiding tag collision.  How they do this is outside the scope of XML.
Examples could be CML:MOL or org.w3.MathML:PRODUCT.  If the convention is 
adopted that the namespace prefix is either the DTD name or a fully qualified
version the chances of collision are reduced to the chances of DTD names 
colliding.

It is possible to create one DTD that can be used for both forms (I hope
that I don't get shot down in flames...).  If we have:

<!ENTITY % fqdtd "CML:">
<!ELEMENT %fqdtd;MOL (%fqdtd;ATOM | %fqdtd;BOND)*>

the DTD expands these to CML:ATOM CML:BOND, etc.  If we wish to use the
DTD in short form, we simply predefine 
<!ENTITY % fqdtd "">

OK, the DTD isn't very readable, but most aren't anyway :-)

The instance can't be done quite as simply because there is no XML-based
way of substituting parameters in GIs (is there?).  But it allows someone
to create a sub-instance which is designed to interoperate with other
instances such as
<CML:MOL>
<CML:ATOMS>
...
</CML:ATOMS>
</CML:MOL>
<MathML:PRODUCT>
...
</MathML:PRODUCT>

This may be slightly longer (though that is a very small price to pay 
for interoperability and irrelevant if files are compressed).  It also means
that users are aware of the namespace problem.  

I would suggest that the application *may* recognise the namespace 
character and *may* for appropriate purposes (e.g. screen display)
remove the qualification.

I believe this would work *now*, would encourage good style and the change 
is minimal (after all we let in an underscore - and I don't think ':' is
feature creep yet).  Unless there are other ways of managing tag collision
at present, and they work, then this seems very attractive.  

The alternative is to do nothing while we try to arrive at a more general and
necessarily more complex answer.  Meanwhile people will all create tags of 
the form <A>, <Q>, <P> and make all soon-to-be-created XML documents 
completely non-interoperable.  The only namespace separator would be some 
morse code derived from '.' and '_' or a magic string like 'XYZZY'.  (For
the historical record my early DTDs (BXML) had tags of the form <XML.ARRAY> 
(sic) :-).

I don't believe this proposal will hinder any future efforts to remove
tag collision.

	P.

-- 
Peter Murray-Rust, domestic net connection
Virtual School of Molecular Sciences
http://www.vsms.nottingham.ac.uk/

Received on Tuesday, 20 May 1997 11:38:38 UTC