You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Klaus Drechsler <dr...@gmx.net> on 2001/02/10 20:03:50 UTC

How to handle results from actions ?

Hi,

I am trying to use actions to validate sessions, but I have still some 
problems how to handle the results from actions:

What works is something like that:

    <map:match pattern="sm/*">
     	<map:act set="mytest"/>
   	<map:generate type="serverpages" src="xyz/{1}.xsp"/>
   	<map:transform src="xyz/sm-stylesheet.xsl"/>
   	<map:serialize type="html"/>
    </map:match>

"mytest" is a simple action, that prints some strings to the dos-box and 
returns "null".
Now I want to return a HashMap (is this okay?) with a key called 
"validSession" and the values "true" or "false".

How can I handle this result within the sitemap?

I tried the following to test it, but it doesn´t work:

    <map:match pattern="sm/*">
     <map:act set="mytest">
     	<map:select>
     		<map:when test="validSession=true">
     			<map:generate type="serverpages" src="xyz/{1}.xsp"/>
     			<map:transform src="xyz/sm-stylesheet.xsl"/>
     			<map:serialize type="html"/>
     		</map:when>
     	</map:select>
     </map:act>
    </map:match>

I always get the following error:
***
Can't read file: 
file:/C:/jakarta-tomcat-4.0-b1/webapps/cocoon/dbprakhouse/null.xsp
...
***

My questions:

1. Is the Syntax i used correct to deal with the returned HashMap?
2. Why did I get such an error message? Where does the "null" in "null.xsp" 
come from?
3. Could someon give me an example?

Thanks in advice!

Bye,
  Klaus



-- 
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
---------------------------------------------
PGP-Key: http://pgp.kdnet.de (soon!)
---------------------------------------------


[C1.8.2] ESQL and null fields

Posted by Drasko Kokic <dr...@yahoo.com>.
Hi there,

I have seen quite a few posts about the subject of
presenting null results ... but none descrubes the
peculiar situation I have got:

If I remove the XSLT stage, then the resulting XML
data contains null nodes (eg. <SOMETHING/>) for each
null field from the data resultset.  I guess that's
OK.
If I enable the XSLT stage (do some styling to produce
HTML code), then the situation is quite different. The
emtpy fields now contain string "null" !!!

I would need some help with this as I was trying the
whole day to find out what and where is controling
this behaviour.
Why is the XSP stage giving different resulting XML
code depending on having XSLT stage or skipping it
over?  (once <SOMETHING>null</SOMETHING> and the other
time <SOMETHING/>)

Thanks in advance
Drasko

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

---------------------------------------------------------------------
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>