cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject something that bugs me
Date Tue, 30 Oct 2001 19:08:05 GMT
Take a look at this sitemap fragment (used to generate our own docs):

   <map:match pattern="*.html">
    <map:aggregate element="site">
     <map:part src="cocoon:/book-{1}.xml"/>
     <map:part src="cocoon:/body-{1}.xml"/>
    </map:aggregate>
    <map:transform src="stylesheets/site2xhtml.xsl">
       <map:parameter name="use-request-parameters" value="true"/>
       <map:parameter name="header" value="graphics/{1}-header.jpg"/>
     </map:transform>
    <map:serialize/>
   </map:match>

   <map:match pattern="**/*.html">
    <map:aggregate element="site">
     <map:part src="cocoon:/{1}/book-{1}/{2}.xml"/>
     <map:part src="cocoon:/body-{1}/{2}.xml"/>
    </map:aggregate>
    <map:transform src="stylesheets/site2xhtml.xsl">
       <map:parameter name="use-request-parameters" value="true"/>
       <map:parameter name="header"
value="{1}/graphics/{2}-header.jpg"/>
     </map:transform>
    <map:serialize/>
   </map:match>

they look so much equal it really bugs me there is no simple way to
collapse them into one.

What do you think? I know I'm being overly picky but we should make an
effort to create the most clean sitemaps so that people learn from us.

Also, 

   <map:match pattern="**images/*.png">
    <map:read src="images/{2}.png" mime-type="image/png"/>
   </map:match>

   <map:match pattern="**images/*.jpg">
    <map:read src="images/{2}.jpg" mime-type="image/jpeg"/>
   </map:match>

   <map:match pattern="**images/*.gif">
    <map:read src="images/{2}.gif" mime-type="image/gif"/>
   </map:match>

could be condensed into 

   <map:match pattern="**images/*.*">
    <map:read src="images/{2}.gif" mime-type="image/{3}"/>
   </map:match>

assuming that nothing but images are stored there.

Thinking about it, for those like me who can't learn regexp (sorry, but
I don't have that mindset), what do you think about adding something
like

   <map:match pattern="**images/*.{gif|jpg|png}">
    <map:read src="images/{2}.gif" mime-type="image/{3}"/>
   </map:match>

which prevents curly braces from being used in URI, but it could be
useful for many to reduce sitemap verbosity by far in many situations.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message