cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [C2] sitemap namespaces
Date Thu, 15 Jun 2000 19:23:34 GMT
Giacomo Pati wrote:
> 
> Hi all
> 
> I still have some black spots on my view of the C2 sitemap. Maybe some of you smart XML
peoples
> can enlight me. Who or what benefits from the separate namespace we introduced for the
loader
> attributes (src:class=..., src:file=..., src:local=...)?

It was my idea and maybe is not smart at all...

The problem is there can be several ways to access a resource, thus the
need to define different loaders. So far so good.

There are two ways to indicate this:

 - URI-encoding
 - XML-encoding

Let's consider URI encoding:

 class:org.apache.whatever.Component
 file:/home/mystuff/java/MyDirGenerator.class
 local:./classes/IPValidityMatcher.class
 jar:./apps/faq-o-matic.cocoon#*

where ":" is the separator. This doesn't work for windows. So

 class://org.apache.whatever.Component
 file://home/mystuff/java/MyDirGenerator.class
 local://./classes/IPValidityMatcher.class
 jar://./apps/faq-o-matic.cocoon#*

but "//./classes" might be very confusing. We can do

 class|org.apache.whatever.Component
 file|/home/mystuff/java/MyDirGenerator.class
 local|./classes/IPValidityMatcher.class
 jar|./apps/faq-o-matic.cocoon#*

which works on every platform (for what I know) and cannot be confused
with files (being "|" invalid in filenames in most platforms).

Anyway, we have to "encode" semantic information, but, guess what?, we
are creating an XML schema, let's use it!

Possible XML encodings are

 src-class="org.apache.whatever.Component"
 src-file="/home/mystuff/java/MyDirGenerator.class"
 src-local="./classes/IPValidityMatcher.class"
 src-jar="./apps/faq-o-matic.cocoon#*"

which require a change in the sitemap schema for the addition of a new
loader or

 src:class="org.apache.whatever.Component"
 src:file="/home/mystuff/java/MyDirGenerator.class"
 src:local="./classes/IPValidityMatcher.class"
 src:jar="./apps/faq-o-matic.cocoon#*"

which restrict the schema change at the "loading" namespace, thus
creating a multidimensional space for the sitemap where resource
indication and their loading are "orthogonal" (and this is the right
term now).

I believe this latest solution is the best and more future compatible,
even if requires a little more XML understandings to grasp its design
implications.

Anyway, maybe I overlooked even simpler ways to do this... any comment
is welcome, as always.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message