cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOZLOV Roman <r-koz...@opencascade.com>
Subject Re: Help on sitemap
Date Thu, 14 Mar 2002 07:51:20 GMT
Hi,

You can try this


   <map:match pattern="text.xml">
    <map:match type="request-parameter" pattern="style">
     <map:generate src="text.xml"/>
     <map:transform src="{1}"/>
     <map:serialize type="xml"/>
    </map:match>

    <map:generate src="text.xml"/>
    <map:serialize type="xml"/>
   </map:match>

or

   <map:match pattern="test.xml">
       <map:generate src="test.xml"/>
       <map:select type="request-parameter">
            <map:parameter name="parameter-name" value="style"/>
            <map:when test="test.xsl">
                 <map:transform src="test.xsl"/>
            </map:when>
            <map:otherwise>
            </map:otherwise>
       </map:select>
       <map:serialize name="xml"/>
   </map:match>

Best regards
    Roman


yuryx wrote:

> ÂÞÃù/eNet/¼¼Êõ·þÎñÊÂÒµ²¿/ϵͳ²¿/×ܼà wrote:
>
> > Hello All,
> >         I hava a question for sitemap
> >         how can i write a sitmap:
> >                 if i request http://site/test.xml
> >                                 it will transform by default.xsl
> >                 if i request http://site/test.xml?sytle=test.xsl
> >                                 it will transform by test.xsl
> >
> > Thanks
> >
> Try define sitemap parameter in action from request
> Like:
> public class MyAction extends AbstractAction {
>   public Map act (Redirector redirector,
>                   SourceResolver resolver,
>                   Map objectModel,
>                   String source,
>                   Parameters params) {
>
>     Map sitemapParams = new HashMap();
>     Request request = (Request)
> objectModel.get(Constants.REQUEST_OBJECT);
>     String mStyle=request.getParameter("style");
>     sitemapParams.put("style", mStyle);
>
>     return sitemapParams;
>   }
> }
>
> in sitemap:
>
>    <map:match pattern="test/*">
>     <map:generate type="serverpages" src="work/test/{1}.xsp"/>
>     <map:act type="MyAction">
>
>     <map:transform src="work/test/{style}"/>
>
>     </map:act>
>     <map:serialize type="html"/>
>
>    </map:match>
>
>  Regards.
> Yury.
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message