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

RE: RE: Namespace use cases

  • From: "Michael Kay" <mike@saxonica.com>
  • To: "'Kurt Cagle'" <kurt.cagle@gmail.com>,"'Micah Dubinko'" <Micah.Dubinko@m...>
  • Date: Thu, 23 Jul 2009 09:49:18 +0100

RE:  RE: Namespace use cases
Well, using a URI scheme that hasn't been registered in the register of URI schemes is cheating and some would look on it with horror. But I've done it myself, and better people than me have done it, and it hasn't caused the world to stop turning on its axis; and in my mind it's in many ways much cleaner than the ghastly abuse of the http scheme which was designed and registered for a completely different purpose.
 

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

 


From: Kurt Cagle [mailto:kurt.cagle@gmail.com]
Sent: 23 July 2009 06:23
To: Micah Dubinko
Cc: XML Developers List; rjelliffe@allette.com.au
Subject: Re: RE: Namespace use cases

One of the facets that I've often wondered about with namespaces is the degree to which protocols should enter into the URI. For instance, I recently wrote an article (that will get reposted once XMLToday.org is back online - waiting for a check to come in to pay my ISP for the next few months) looking at developing modules in XQuery. In that context, I percieved that you could in fact use a Java like construct (as is frequently done when declaring Java classes within XSLT or XQuery) but with the protocol changed to xquery:

declare namespace stats = "xquery:org.xmltoday.xqlib.statistics";

declare function stats:average($numseq as xs:double*) as xs:double {...};

It makes no real difference to the processor, of course, but from an organizational standpoint it opens up a number of possibilities. For instance, a specific module of financial statistics functions might exist within a separate but related namespace

declare namespace finstats = "xquery:org.xmltoday.xqlib.statistics.finance";

The other advantage to this approach is that it makes it easier for Java-like preprocessors to import multiple namespaces that have preferred prefixes within the context of a given system.

<?import "xquery:org.xmltoday.xqlib.statistics.*"?>

It may also allow for creating umbrella bindings in other contexts:

<?bind "xquery:org.xmltoday.xqlib.statistics.*" as="st"?>

so that both statistics and financial statistics functions would be referenceable via the st: namespace, even though they are technically in different namespaces.

May be apropos of nothing, just random thoughts firing.


Kurt Cagle
Managing Editor
http://xmlToday.org


On Sun, Jul 19, 2009 at 6:54 PM, Micah Dubinko <Micah.Dubinko@marklogic.com> wrote:
Another question on this thread:
In terms of namespace approaches, the Java model is frequently pointed to as a good way to do it. At least I haven't heard any Java people complaining about namespaces in any way remotely close to how the XML people talk about it.

Has anyone written down a proposal for "Java-style" namespaces in a markup language, specifically HTML?

There is this starting point:
http://www.xml.com/pub/a/2005/04/13/namespace-uris.html

(As you can see in the comments of that article, this issue has been a thorn in my side for many years)

A slightly different approach, worth note:
http://web.archive.org/web/20040609023416/www.tbradford.org/clean-namespaces.html

If anyone knows of a more recent revision of this, let me know.

A survey of the existing art will be a good start toward proposing something ourselves on this list. We can keep accumulating use cases as we go.

Thanks, -m







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