[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
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|