cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier Lange" <ola...@petit-atelier.ch>
Subject Wildchar URI matchers inclusive or exclusive?
Date Mon, 13 Oct 2003 17:17:25 GMT
Hello all,

Is it true that nested wildchar URI matchers are "inclusive" and trigger on
_all_ matches, while the top level matchers are "exclusive" and trigger on
_first match_ only?

I noticed that Cocoon 2.1 behaves like that and could not confirm it from
the documentation.

For instance, with the following sitemap fragment:

  <map:pipeline>
    <!-- Top level matcher -->
    <map:match pattern="*/events/**.html">

      <!-- Nested matcher 1 -->
      <map:match pattern="*/events/index.html">
        <map:generate src="cocoon:/xpg/{1}/even-home"/>
      </map:match>

      <!-- Nested matcher 2 -->
      <map:match pattern="*/events/*.html">
        <map:generate src="cocoon:/xpg/{1}/even-{2}"/>
      </map:match>

      <!-- Transformation + serialization -->
      <map:call resource="xpg-xhtml"/>
    </map:match>
  </map:pipeline>

If I request URI fr/events/index.html, both nested matchers 1 + 2 will
trigger, resulting in a "Generator already set. You can only select one
Generator" message.

Now, if the sitemap is written as:

  <map:pipeline>
    <!-- Top level matcher 1 -->
    <map:match pattern="*/events/index.html">
        <map:generate src="cocoon:/xpg/{1}/even-home"/>
        <map:call resource="xpg-xhtml"/>
    </map:match>

    <!-- Top level matcher 2 -->
    <map:match pattern="*/events/*.html">
      <map:generate src="cocoon:/xpg/{1}/even-{2}"/>
      <map:call resource="xpg-xhtml"/>
    </map:match>
  </map:pipeline>

and if I request the URI fr/events/index.html, then only the first matcher
will trigger.

I believe this is the intended behavior, but could someone confirm it?

In case it is, I suggest adding a note at least here for this subtle
behaviorial change (I would submit a patch):
http://cocoon.apache.org/2.1/userdocs/matchers/matchers.html#Order

Olivier


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


Mime
View raw message