Hello Vadim, Thanks for the quick respose..
Shouldn't the XSP generator create the declaration for xspAttr for the functions generation code Or make xspAttr as a class member variable .. Having to define variables, which I will not be using in every function to ensure XSP gets compiled, kind a make it slightly unattractive isn't it .... Regds, Chiths -----Original Message----- From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 7:55 PM To: [EMAIL PROTECTED] Subject: RE: Urgent:Error in XSP Generation... > From: Chitharanjan Das [mailto:[EMAIL PROTECTED]] > > 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; Yup. > Upon declaring xspAttr in my function the XSP started working. Yup. > 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> Why so many CDATA sections? If you have no '<' and '>', CDATA is not required: > } > } else { > <para>No parameters</para> > } > } > </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.......... Nope. All is normal. Vadim > > 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]> --------------------------------------------------------------------- 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]>