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] To namespace or not to Namespace ....

Been holding my tounge on this ...
you may not go "wrong" but there is definately a reasonably large "cost" 
in adding namespaces.
Not referring to the Theoretical "cost" of following the right design 
I'm refering to the practical cost of the programmers getting it right.
I'd love to pretend that using namespaces is just as easy as not, but 
its not true.

ALL (bar none) of the XML tools, frameworks, and technologies, are more 
work to actually use and get to work right when dealing with namespaces 
then when not.   How much more work ? It depends on the programmer and 
the tools.
But everything from the basics of xpath to the details of getting a 
QName() element created right, to parsing a SAX stream to serialization 
etc ... all are harder with namespaces then without.

Now the opposite is also true ... once you get the 'plunbing worked out' 
and suppose your expert at all the tools and technologies,
then dealing with complex XML from multiple sources can be vastly easier 
with namespaces then without ...
Or perhaps even impossible without namespaces ...
But by no means is it B&W.

I see a startum ... its probably a n-dimensional one but lets pick 1D 
(to use the spherical elephant example).

One end:
"One Shot" I write it and read it and noone else needs it XML.
==> Namespaces are just extra work with little benefit.

Other End.
"Published Standard Modules" ... Stuff thats intended to be vastly 
consumed, and plugged into other vocabularies.
===> Probably wont work at all without namespaces

Then there's the middle which is most everything ...

By the way, I have loved this debate ! I particularly enjoy the fact 
that I keep being swayed over the fence by nearly every comment.

David A. Lee

On 4/7/2010 4:33 PM, Andrew Welch wrote:
>> I just hope people will actually evaluate the costs of using namespaces
>> before automatically sticking them on everything.
> You can't go far wrong if:
> - You pick a namespace that will never change: don't use dates, or
> words like 'proposed' or 'beta', or embed version information
> - You always use a prefix
> - You tell the team to always use an XML parser to read the XML, and
> an XML writer to serialise the XML, and never ever process XML as a
> string

[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