You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Tomas Garijo (Click)" <tg...@clickonline.es> on 2007/03/19 15:56:24 UTC

redirect from xsl

I have this sitemap

<map:transformer name="transformer" src="es.clickonline.transformation.Transformer"/>
.
.
.

<map:match pattern="Login">			
<map:generate type="request"/>		
<map:transform src="./xslt/photoClickLoginRequest.xsl"/> 		
<map:transform type="transformer"/>
<map:transform src="./xslt/photoClickLoginResponse.xsl"/>				

<map:serialize type="html"/>
</map:match>	

then xslt photoClickLoginResponse.xsl return the word "true" if the login its true.

I want to take the word true and to forward to another page or a class java.

Thank you very much.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: redirect from xsl

Posted by Dev at weitling <de...@weitling.net>.
Hi Tomas,

> <map:match pattern="Login">			
> <map:generate type="request"/>		
> <map:transform src="./xslt/photoClickLoginRequest.xsl"/> 		
> <map:transform type="transformer"/>
> <map:transform src="./xslt/photoClickLoginResponse.xsl"/>				
> <map:serialize type="html"/>
> </map:match>	
>
> then xslt photoClickLoginResponse.xsl return the word "true" if the login its true.
>
> I want to take the word true and to forward to another page or a class java

That's a mistake I made, too. Think pull, not push!
You can't create a SAX stream and then send it actively to a pipeline.
It's the other way round: A pipeline retrieves/pulls a SAX stream
(eventually from another pipeline).
If you've to use a condition try a flowscript, a selctor or an action e.g.
   
    <map:match pattern"Login">
       <map:call function="makeMyDay"/>
    </map:match>

    <map:match pattern="photoClickLoginRequest">
       ... your stuff from above ...
    </map:match>

    <map:match pattern="truthAndNothingElseButTheTruth">
       ... something you want to forward to ...
    </map:match>

    <map:match pattern="thisSentenceIsFalse">
       ... something you want to forward to ...
    </map:match>


   function makeMyDay () {
       var buffer = new Packages.java.io.ByteArrayOutputStream();
       cocoon.processPipelineTo("photoClickLoginrequest", null, buffer);
       if ( buffer.toString().equals("true") ) {
          cocoon.redirectTo("truthAndNothingElseButTheTruth",false);
       }
       else {
          cocoon.redirectTo("thisSentenceIsFalse");
       }
    }

HopeI didn't make mistakes...

Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org