Hi Thorsten,

you define the variable dateParam inside a try/catch-block. When you reference to it 
outside of this block you're out of scope.

try:
        <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"; 
xmlns:esql="http://apache.org/cocoon/SQL/v2"; 
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
                <dataset>
                        <xsp:logic>
              Date myDate = "";
              String dateParam = null;

              try{
                myDate = (new 
SimpleDateFormat("dd.MM.yyyy")).parse(request.getParameter("date"));
               dateParam = (new SimpleDateFormat("MM/dd/yyyy")).format(myDate);
              } catch(Exception e){
                getLogger().error("XSP date error: ", e);
              }
           </xsp:logic>
                        <test>
                                <xsp:expr>dateParam</xsp:expr>
                        </test>
                </dataset>
        </xsp:page>

        Bye
        Judith

> -----Ursprüngliche Nachricht-----
> Von:  Scherler, Thorsten [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Freitag, 31. Januar 2003 18:01
> An:   [EMAIL PROTECTED]
> Betreff:      AW: AW: AW: AW: AW: AW: AW: xsp-element equivalent to xsl:param?
> 
> I correct it and now:
> 
> description org.apache.cocoon.ProcessingException: Language Exception: 
>org.apache.cocoon.components.language.LanguageException: Error compiling 
>IDC2_info_int_xsp: Line 286, column -1: incompatible types Line 309, column 48: 
>variable dateParam not found in class org.apache.cocoon.www.logic.IDC2_info_int_xsp 
>Line 0, column 0: 2 errors 
> 
> the xsp:
> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"; 
>xmlns:esql="http://apache.org/cocoon/SQL/v2"; 
>xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
>       <dataset>
>               <xsp:logic>
>       Date myDate = "";
>       try{
> myDate = (new SimpleDateFormat("dd.MM.yyyy")).parse(request.getParameter("date"));
> String dateParam = (new SimpleDateFormat("MM/dd/yyyy")).format(myDate);
>       }catch(Exception e){
> getLogger().error("XSP date error: ", e);
> }
>    </xsp:logic>
>               <test>
>                       <xsp:expr>dateParam</xsp:expr>
>               </test>
>       </dataset>
> </xsp:page>
> 
> the request: ?date=31.01.2003
> 
> -----Ursprüngliche Nachricht-----
> Von: Andrew Timberlake [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 31. Januar 2003 17:49
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: AW: AW: AW: AW: AW: xsp-element equivalent to
> xsl:param?
> 
> 
> On Fri, 2003-01-31 at 18:37, Scherler, Thorsten wrote:
> > Hello again,
> > 
> > I have shorten the xsp:
> > <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"; 
>xmlns:esql="http://apache.org/cocoon/SQL/v2"; 
>xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
> > <dataset>
> > <xsp:logic>
> > Date myDate = "";
> > try{
> > myDate = (new
> > SimpleDateFormat("dd.MM.yyyy")).parse(request.getParameter("date"));
>                              ---^
> You had a missing ')'
> 
> > String dateParam = (new SimpleDateFormat("MM/dd/yyyy")).format(myDate);
> >       }catch(Exception e){
> > getLogger().error("XSP date error: ", e);
> > }
> > </xsp:logic>
> > <test>
> > <xsp:expr>myDate </xsp:expr>
> > </test>
> > </dataset>
> > </xsp:page>
> > 
> 
> -- 
> Andrew Timberlake <[EMAIL PROTECTED]>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to