forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Re: Where to put components (Re: cvs commit: ...)
Date Fri, 08 Aug 2003 15:57:05 GMT

Thank you very much about this explanation, I found it very useful. I
belive that this is a minor issue but it helps to define a pattern to
write xmaps.

We are moving now to define the best pattern to use in the xmap so it is
 easier to read and maintain.

> What does the following subsitemap do?
> <map:sitemap xmlns:map="">
>   <map:pipelines>
>     <map:pipeline>
>       <map:match pattern="aaa"/>
>       <map:generate src="bbb"/>
>       <map:transform src="ccc"/>
>       <map:serialize/>
>     </map:pipeline>
>   </map:pipelines>
> </map:sitemap>
> There is no way to tell, because it depends on what the parent sitemap
> has declared as the defaults.
> If you add:
> <map:components>
>   <map:generators default="serverpages"/>
>   <map:transformers default="xslt"/>
>   <map:serializers default="fo2pdf"/>
> </map:components>
> Then
> - You immediately know that 'aaa' is a PDF, 'bbb' is an XSP, and 'ccc'
>   is an XSLT stylesheet.  This is the documentation effect
> - Say some day we decide to switch the default transformer from XSLT
>   to STX.  If we handn't explicitly said "ccc is an XSLT" then this
>   sitemap would quietly fail.  But as we've defined it, the sitemap
>   will work fine if we keep the 'xslt' component, and fail in a
>   sensible manner if we don't.

To probe that your proposal it is less apropiate I will point a few  facts:

In our code there is 13 declarations that the default serializer is
"html"(  grep "serializers default" *.xmap | wc -l) , It has been used
only in one place that is raw.xmap (it was omited)

On the declarations there is no way to ensure that what you declare it
is used or not on the submap.

Overwriting a default declaration is another way to duplicate, to  allow
 explicit declaration use type="..."

You even got confused in your own example!!. aaa is "wildcard"


View raw message