Hello,
        I am using cocoon 2.0.3 from CVS..

In XSP's , if I defined a function which o/p's data, it gives an error
in compilation
Variable xspAttr is not defined, because the XSP generator defines the
variable only for the method
        public void generate() throws SAXException, IOException,
ProcessingException;


Upon declaring xspAttr in my function the XSP started working. Following
is the illustration of my function declaration

XSP page snippet:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp";  
          xmlns:xsp-session="http://apache.org/xsp/session/2.0";  
          xmlns:xsp-request="http://apache.org/xsp/request/2.0"; 
          xmlns:capture="http://apache.org/cocoon/capture/1.0";>
           
<xsp:structure>
        
<xsp:include>org.apache.avalon.framework.parameters.Parameters</xsp:incl
ude>
</xsp:structure>               

<xsp:logic> <![CDATA[
        public void printParameters(Parameters params) throws
SAXException{
                String [] paramNames = params.getNames();
                
                AttributesImpl xspAttr = new AttributesImpl();
                if(paramNames != null && paramNames.length > 0) {
                        for(int i=0; i < paramNames.length; i++) {
                                System.out.println("I am here");
        ]]>     
                <para>Hello</para>
        <![CDATA[
                        }
                }
                else {
        ]]>
                <para>No parameters</para>
        <![CDATA[
                }
        }
        ]]>
</xsp:logic>


<page>
......
</page>

</xsp:page>


I know that that the function if used are only to manipulate data and
not for content generation, hey but why not....

Could any one of the developers, acknowledge whether this is a bug or
not..........


Thanks in Advance,

Regds,
Chiths


---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to