You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sonny Sukumar <ah...@hotmail.com> on 2003/07/30 21:33:16 UTC

defining methods in XSP?

Hi guys,

I know it's possible to define class-level methods in an XSP by means of 
<xsp:logic> blocks placed outside the user root element, BUT it doesn't seem 
to work when my class-level method is outputting XML content.

I just want to separate a big block of code that outputs part of the XML doc 
out into 1 method (becuase I figure this would save some on-the-fly 
compilation time), so it doesn't have to be inlined so many times, but 
apparently the "xspAttr" variable is missing from the class-level method's 
scope because Cocoon defines it local to generate().

Is there any (elegant) way around this?  Or can class-level methods only be 
used for "utility" purposes like calculating values and such?

Also, other than generator code readibility, is there any real advantage to 
doing this?  I guess not since the generator is only compiled once unless 
the XSP code is changed and inline code is a bit faster.

I'd appreciate any thoughts,

Sonny

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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