[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: namespaces redux (was: Re: [XML Schema]Here's ho

  • From: Liam R E Quin <liam@w3.org>
  • To: Andrew Welch <andrew.j.welch@gmail.com>
  • Date: Tue, 16 Oct 2012 10:45:19 -0400

Re:  namespaces redux (was: Re:  [XML Schema]Here's ho
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

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.