You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Ferdinand Soethe <fe...@apache.org> on 2007/05/08 16:33:03 UTC

Why not use regexp-matcher for *.html-pipelines

Looking at Cyriaques elegant solution for php-processing and finding a
similar one used for matching fo's in sitemap

>  <map:match type="regexp" pattern="^(.*?)([^/]*).fo$">

I wonder why we are not using as similar matcher to get rid of that
redundant code in sitemap

> <!--pipeline that "marries" the docs in the root dir with the skin to produce html-->
>       <map:match pattern="*.html">
>         <map:aggregate element="site">
>           <map:part src="cocoon:/skinconf.xml"/>
>           <map:part src="cocoon:/build-info"/>
>           <map:part src="cocoon:/tab-{0}"/>
>           <map:part src="cocoon:/menu-{0}"/>
>           <map:part src="cocoon:/body-{0}"/>
>         </map:aggregate>
>         <map:call resource="skinit">
>           <map:parameter name="type" value="transform.site.xhtml"/>
>           <map:parameter name="path" value="{0}"/>
>         </map:call>
>       </map:match>
> <!--pipeline that "marries" the docs in all other dirs then root with the skin to produce html-->
>       <map:match pattern="**/*.html">
>         <map:aggregate element="site">
>           <map:part src="cocoon:/skinconf.xml"/>
>           <map:part src="cocoon:/build-info"/>
>           <map:part src="cocoon:/{1}/tab-{2}.html"/>
>           <map:part src="cocoon:/{1}/menu-{2}.html"/>
>           <map:part src="cocoon:/{1}/body-{2}.html"/>
>         </map:aggregate>
>         <map:call resource="skinit">
>           <map:parameter name="type" value="transform.site.xhtml"/>
>           <map:parameter name="path" value="{0}"/>
>         </map:call>
>       </map:match>

Is there a reason it is not used?

Thanks,
Ferdinand

Re: Why not use regexp-matcher for *.html-pipelines

Posted by Ross Gardler <rg...@apache.org>.
On 08/05/07, Ferdinand Soethe <fe...@apache.org> wrote:
> Looking at Cyriaques elegant solution for php-processing and finding a
> similar one used for matching fo's in sitemap
>
> >  <map:match type="regexp" pattern="^(.*?)([^/]*).fo$">
>
> I wonder why we are not using as similar matcher to get rid of that
> redundant code in sitemap

...

> Is there a reason it is not used?

The only reason I can think of  is that the wildcard matchers are much
easier to read than the RE ones.

Personally, I have no problem with them being changed but they should
have a clear comment indicating what they will match for those people
who cannot read RE's

Ross