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 rootelement)

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. 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"...

> Here are some namespace best practices for someone about create their
> own markup:
> 1. Always use a prefix, never change the default namespace.
I'd say the opposite here.

> 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.

> 3. Avoid using URLs, the globally unique benefit is far outweighed by
> the confusion cost
A namespace URI is by definition a URI. Yes, you can use a URN, and I
think if URNs had been further along it might have been a better choice,
but there are plenty of reasons to use a URL, one of which is that some
(very broken) software thinks the namespace name points directly to a
W3C XML Schema document.

> 4. Keep it short, XPath 3.0 can include the namespace directly in the xpath
> 5. Use the standard prefixes for existing namespaces
> 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.

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.


Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author, 5th edition of "Beginning XML", Wrox, July 2012

[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