XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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] namespaces redux (was: Re: [xml-dev] [XML Schema]Here's how to empower instance document authors to create their own root element)

On 16 October 2012 15:45, Liam R E Quin <liam@w3.org> wrote:
> On Tue, 2012-10-16 at 09:34 +0100, Andrew Welch wrote:
>> >> On 10/15/2012 12:09 AM, Liam R E Quin wrote:
>> >> (in fact, best practices uses of W3C namespaces are not, ultimately, so
>> > bad).
>
> They might or might not be but I didn't write that.

Ah sorry, thats the way it looked in the reply.

> Actually I think
> "best practice" is a term that often gets used in a way that is far from
> helpful, even if that's not how it's being used in this thread, by
> implying that anything else is "bad practice" and "wrong"...

I remember when I first had to design some xml and went looking for
some advice, I think I may have even asked on here... There was pretty
much zero advice when it came to namespaces - whether to use one, what
namespace to use, what about versioning, whether to use a prefix etc.

What I needed was some pithy bullet points that would help avoid some
of the pitfalls (bear traps...)  Iirc, I didn't use a prefix, and
included a version number in the namespace.... there were big problems
with versioning, and people struggled with the default namespace.  So
much aggro that could so easily have been avoided.


>> 1. Always use a prefix, never change the default namespace.
> I'd say the opposite here.

For internal formats intended to be consumed by a wide variety of devs
"always use a prefix" is good advice.

>> 2. Choose a namespace that will never, ever change - eg don't include
>> version numbers or dates
> "never" is a long time, and there are arguments on both sides, depending
> on circumstance.

Supporting multiple namespaces is a real pain... What is the benefit
at all putting version numbers in a namespace?  (as opposed to just
using a version attribute on the root element)


>> 6. Always declare all the namespaces on the root element
> This last is also not always possible. For example, a SOAP system might
> not know the prefixes declared in the payload in advance.

True, if it's not possible it's not possible...

> I think I'm with Tommie Usdin on this one, as she said in her Balisage
> Keynote a little over a year ago, best practices aren't always best.

I don't know... I've done several contracts over the last few years
and you see the same mistakes over and over again.  Some people *hate*
xml... and they hate it because they struggle with it, and the
struggle could easily be avoided if only some simple rules were
followed when deciding on things like namespaces.



-- 
Andrew Welch
http://andrewjwelch.com


[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