cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alfred Nathaniel (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-2247) Default matcher no longer works when divider character part of match
Date Wed, 07 Jan 2009 00:41:44 GMT

    [ https://issues.apache.org/jira/browse/COCOON-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661389#action_12661389
] 

Alfred Nathaniel commented on COCOON-2247:
------------------------------------------

Latest Cocoon 2.2 and 2.1 behave in the same way.  Before 2.1.10 the WildcardMatcherHelper
was a handmade parser which had a number of subtle bugs.  Now the match pattern is translated
into an RE and handed to the Apache regexp package.  

In that translation " is handled as "[^/]*", i.e. greedy match except slash.  Unfortunately
there are only testcases for the greediness of "" but not for *.  Therefore the behaviour
for " is open for discussion.

I think " should remain greedy as it is now because
a) "" is definitely greedy and * should not be the other way around
b) in other RE languages the default is usually greedy

If you want non-greedy matches, there is <match type="regexp"> to use general REs.
(Visible to all-developers group)
> Default matcher no longer works when divider character part of match
> --------------------------------------------------------------------
>
>                 Key: COCOON-2247
>                 URL: https://issues.apache.org/jira/browse/COCOON-2247
>             Project: Cocoon
>          Issue Type: Bug
>          Components: * Cocoon Core
>    Affects Versions: 2.1.11
>            Reporter: Kamal Bhatt
>
> Example sitemap:
>       <!-- Generates a CFORM selection list based on all images accessible to publication
-->
>       <map:match pattern="image_list_*_*">
>         <map:generate type="imagedirectory" src="../cmsblocks/holidayImg/{1}/{2}">
>           <map:parameter name="depth" value="2"/>
>         </map:generate>
>         <map:transform src="xslt/brandimagedirectory_list.xsl">
>           <map:parameter name="list_level" value="file"/>
>         </map:transform>
>         <map:serialize type="xml"/>
>       </map:match>
> Using the following match:
> image_list_images_TE_tours
> You get the following error:
> ../cmsblocks/holidayImg/images_TE/tours is not a directory.
> The match is completely foobar. This used to work in 2.1.9
> I have not had a chance to see how it works in 2.2.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message