[Home] [By Thread] [By Date] [Recent Entries]

  • From: Kurt Cagle <kurt.cagle@g...>
  • To: Micah Dubinko <Micah.Dubinko@m...>
  • Date: Wed, 22 Jul 2009 22:22:53 -0700

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@m...> 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]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member