[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: Andrew Welch <andrew.j.welch@gmail.com>
  • To: liam@w3.org
  • Date: Wed, 17 Oct 2012 09:57:35 +0100

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


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.