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


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] A proposal for application level XML 'namespaces'

Original Message From: "Michael Kay"

I've separated replies to this message into two e-mails for easier issue 

> Element names are either absolute (e.g. <:com.example.myschema:parent>) or 
> "relative" (<child>) or prefixed (<myschema:uncle>). A relative name is 
> expanded using the 'namespace' of its nearest absolute container element; 
> if there is none, it is a no-namespace name. The prefix of a prefixed name 
> must match the trailing component(s) of a containing absolute name, and is 
> expanded to be in the namespace given by that absolute name.
> Attribute names are the same except that relative names are always 
> no-namespace names.
> Only absolute names are used in APIs; applications cannot tell whether a 
> name was written in full or in abbreviated form.

I wonder whether the prefixed form can be removed in the interests of 
simplicity and just accept that in those corner cases where there's lots of 
interleaved namespaces you have to do it using absolute names.  If necessary 
the vocabulary designers could register their prefix with the registry I 
talked about in my earlier mail.  Thus they could register "myschema" as a 
prefix for "com.example.myschema" and then just use "myschema:parent".

I like the idea of the APIs always reporting the absolute names.  My concern 
with that is that it requires the parser to be re-written.  However, if 
you're using an existing XML parser, I think you could easily pipeline the 
processing of the XML so that relative names are expanded to absolute names 
before being handed to your existing XML parser, e.g.:


gets pre-processed to:


My next thought is, do we need the colons in the names?  Can we get away 
with names like "com.example.myschema.parent" and just say that the local 
part is a NDName (No Dot Name!)?  My concern is that the presence of colons 
may cause existing parsers to attempt to handle the names as existing 
namespaces, and that could cause problems.

Removing colons and adopting the same pre-processing means:


gets pre-processed to:


which I think looks pretty good!

Pete Cordell
Codalogic Ltd
Interface XML to C++ the easy way using C++ XML
data binding to convert XSD schemas to C++ classes.
Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com
for more info

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS