XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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

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]


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