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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]