cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Maloney <coc...@chrismaloney.com>
Subject map:mount - ish question
Date Wed, 27 Apr 2005 01:14:51 GMT
Hi, this is my first time writing something to this list.  I'm a bit
of a Cocoon n00b, but not new to XSLT.  I just discovered Cocoon, and
I love it!

I'm setting up a web site that consists of two main directories:
  Main - contains my sitemap and all my main XML content
  Other - heritage image of a bunch of source code

I want to keep these separate, because the "Other" directory is under
its own CM system (SourceSafe, blech).

I'd like to serve the content from "Other", though, from URLs like
http://host/Other/...., where "...." could be just about any type
of file.

When just serving files from "Main", I started out with a bunch of
patterns in my sitemap to feed "straight-thru" files, like

  <map:match pattern='**.txt'>
    <map:read mime-type='text/plain'
              src='{1}.txt'/>
  </map:match>

Then I augmented them like so:

  <map:match pattern='**.txt'>
    <map:select type='resource-exists'>
      <map:when test='{1}.txt'>
        <map:read mime-type="text/plain"
                  src="{1}.png"/>
      </map:when>
      <map:otherwise>
        <map:read mime-type="text/plain"
                  src="../Other/{1}.png"/>
      </map:otherwise>
    </map:select>
  </map:match>

My question is, is there an easy way to do this across the board,
without having to rewrite every straight-thru pipeline?  I'd like
something like this in the front:

  <map:match pattern='Other/**'>
    <!-- reset the 'src' base directory to '../Other', and continue
         matching  -->
  </map:match>

Any help would be fantastically appreciated.  BTW, I have really
looked for this answer in the two books I have and in the online
docs.

Thanks,
Chris


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


Mime
View raw message