You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Fiedler, Raul" <Ra...@ecb.int> on 2002/02/25 14:38:45 UTC

What is happening to {1} in this case?

What is happening to {1} in this case?

I have a form(s) called:
   xxxxx-input.xml
which has an action sending data to the URI: 
  xxxxx-store

When it is successful I want it to re-direct back to:
  xxxxxx-input.xml

But what is happening instead is that Cocoon is trying to re-direct to:
    xxxxxx-store
which is wrong (and it also throws a 404 page not found error).

What is happening to {1} in this case? and why is the rest, ie -input.xml,
being ignored in my generate tag????

<map:pipelines>
    <map:pipeline>
        <map:match pattern="*-store">
            <map:act type="web-action">
                <map:generate src="docs/{1}-input.xml"/>
                <map:transform type="xslt" src="stylesheets/xml2html.xsl"/>
                <map:serialize type="html"/>
            </map:act>
        </map:match>
    </map:pipeline>
    <map:pipeline>
        <map:match pattern="*.xml">
            <map:generate type="file" src="docs/{1}.xml"/>
            <map:transform type="xslt" src="stylesheets/xml2html.xsl"/>
            <map:serialize/>
        </map:match>
    </map:pipeline>
</map:pipelines>

> Raul Fiedler
> European Central Bank
> DG Information Systems - Business Development
> *   +49 (0) 69 1344 6870 
> * raul.fiedler@ecb.int
> 

Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither be binding nor construed as constituting a commitment by the ECB except where provided for in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised disclosure, use or dissemination, either in whole or in part, is prohibited.
If you have received this e-mail in error, please notify the sender immediately via e-mail and delete this e-mail from your system.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: What is happening to {1} in this case?

Posted by Vadim Gritsenko <va...@verizon.net>.
Read some clarifications below,

Regards,
Vadim

> From: Chris Newland [mailto:chris.newland@emorphia.com]
> 
> Hi Raul,
>
> When you use wildcard parameters with actions, the parameters are
treated
> like they are on a stack so that for each action you execute,

Read: ...for each action, selector, matcher you execute...

> your original parameters are pushed down the stack

and parameters from the executed action/selector/matcher are appended to
this stack.

>. You must then specify which
> level of the stack you want to retrieve the parameters from

using directory-like (or XPath-like) path, where '../' expression allows
to access parameters on one level down from the top of the stack.


> Your parameter is inside 1 level of action so to access it you need to
do
> the following:
> 
> <map:pipeline>
>          <map:match pattern="*-store">
>              <map:act type="web-action">
>                  <map:generate src="docs/{../1}-input.xml"/>
>                  <map:transform type="xslt"
src="stylesheets/xml2html.xsl"/>
>                  <map:serialize type="html"/>
>              </map:act>
>          </map:match>
> </map:pipeline>
> 
> If it was inside 2 nested actions you would access it like {../../1}
etc.
> 
> Hope this helps,
> 
> Regards,
> 
> Chris
> 
> > -----Original Message-----
> > From: Fiedler, Raul [mailto:Raul.Fiedler@ecb.int]
> > Sent: 25 February 2002 13:39
> > To: 'cocoon-users@xml.apache.org'
> > Cc: Shaw, Chris
> > Subject: What is happening to {1} in this case?
> >
> >
> > What is happening to {1} in this case?
> >
> > I have a form(s) called:
> >    xxxxx-input.xml
> > which has an action sending data to the URI:
> >   xxxxx-store
> >
> > When it is successful I want it to re-direct back to:
> >   xxxxxx-input.xml
> >
> > But what is happening instead is that Cocoon is trying to re-direct
to:
> >     xxxxxx-store
> > which is wrong (and it also throws a 404 page not found error).
> >
> > What is happening to {1} in this case? and why is the rest, ie
-input.xml,
> > being ignored in my generate tag????
> >
> > <map:pipelines>
> >     <map:pipeline>
> >         <map:match pattern="*-store">
> >             <map:act type="web-action">
> >                 <map:generate src="docs/{1}-input.xml"/>
> >                 <map:transform type="xslt"
> > src="stylesheets/xml2html.xsl"/>
> >                 <map:serialize type="html"/>
> >             </map:act>
> >         </map:match>
> >     </map:pipeline>
> >     <map:pipeline>
> >         <map:match pattern="*.xml">
> >             <map:generate type="file" src="docs/{1}.xml"/>
> >             <map:transform type="xslt"
src="stylesheets/xml2html.xsl"/>
> >             <map:serialize/>
> >         </map:match>
> >     </map:pipeline>
> > </map:pipelines>
> >
> > > Raul Fiedler
> > > European Central Bank
> > > DG Information Systems - Business Development
> > > *   +49 (0) 69 1344 6870
> > > * raul.fiedler@ecb.int
> > >


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: What is happening to {1} in this case?

Posted by Chris Newland <ch...@emorphia.com>.
Hi Raul,

When you use wildcard parameters with actions, the parameters are treated
like they are on a stack so that for each action you execute, your original
parameters are pushed down the stack. You must then specify which level of
the stack you want to retrieve the parameters from.

Your parameter is inside 1 level of action so to access it you need to do
the following:

<map:pipeline>
         <map:match pattern="*-store">
             <map:act type="web-action">
                 <map:generate src="docs/{../1}-input.xml"/>
                 <map:transform type="xslt" src="stylesheets/xml2html.xsl"/>
                 <map:serialize type="html"/>
             </map:act>
         </map:match>
</map:pipeline>

If it was inside 2 nested actions you would access it like {../../1} etc.

Hope this helps,

Regards,

Chris

> -----Original Message-----
> From: Fiedler, Raul [mailto:Raul.Fiedler@ecb.int]
> Sent: 25 February 2002 13:39
> To: 'cocoon-users@xml.apache.org'
> Cc: Shaw, Chris
> Subject: What is happening to {1} in this case?
>
>
> What is happening to {1} in this case?
>
> I have a form(s) called:
>    xxxxx-input.xml
> which has an action sending data to the URI:
>   xxxxx-store
>
> When it is successful I want it to re-direct back to:
>   xxxxxx-input.xml
>
> But what is happening instead is that Cocoon is trying to re-direct to:
>     xxxxxx-store
> which is wrong (and it also throws a 404 page not found error).
>
> What is happening to {1} in this case? and why is the rest, ie -input.xml,
> being ignored in my generate tag????
>
> <map:pipelines>
>     <map:pipeline>
>         <map:match pattern="*-store">
>             <map:act type="web-action">
>                 <map:generate src="docs/{1}-input.xml"/>
>                 <map:transform type="xslt"
> src="stylesheets/xml2html.xsl"/>
>                 <map:serialize type="html"/>
>             </map:act>
>         </map:match>
>     </map:pipeline>
>     <map:pipeline>
>         <map:match pattern="*.xml">
>             <map:generate type="file" src="docs/{1}.xml"/>
>             <map:transform type="xslt" src="stylesheets/xml2html.xsl"/>
>             <map:serialize/>
>         </map:match>
>     </map:pipeline>
> </map:pipelines>
>
> > Raul Fiedler
> > European Central Bank
> > DG Information Systems - Business Development
> > *   +49 (0) 69 1344 6870
> > * raul.fiedler@ecb.int
> >
>
> Any e-mail message from the European Central Bank (ECB) is sent
> in good faith but shall neither be binding nor construed as
> constituting a commitment by the ECB except where provided for in
> a written agreement.
> This e-mail is intended only for the use of the recipient(s)
> named above. Any unauthorised disclosure, use or dissemination,
> either in whole or in part, is prohibited.
> If you have received this e-mail in error, please notify the
> sender immediately via e-mail and delete this e-mail from your system.
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>



---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>