OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
RE: [xml-dev] 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.


Michael Kay


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: [xml-dev] 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

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:

(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:

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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS