cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Fagnani-Bell <>
Subject How to make custom XSP-like language??
Date Fri, 31 May 2002 19:19:58 GMT

   I'm new to the list, but have been working with Cocoon 1.x and 2 for 
over a year, recently adding lots of custom extensions.

I'm trying to create a new XSP-like language for my application. This 
language needs to have a different base class than XSPGenerator, and 
some changes are needed to the xsp.xsl logicsheet so that I can change 
how the generate() method is created.

I've got a prototype up and running with a few hacks that might be 
interesting to the list. First, I changed xsp.xsl so that I can specify 
a base-class attribute for xsp:page. (I'll append the changes to the 
bottom of this email). If none exists it uses XSPGenerator. Second, I 
created an XMLPipe that changes the SAX events to behave the way I need 
them. So far it's working but to implement some more advanced features I 
will need to change xsp.xsl more than I would like. I'm worried that I 
wouldn't be able to update my Cocoon installation if xsp.xsl was 

So I'd like to use my own stylesheet instead of xsp.xsl, but still keep 
xsp.xsl and the xsp sections of cocoon.conf as distributed so that 
normal xsp pages would still work. I can't find any documentation on 

I'd imagine that I'd need to add something like this to cocoon.xconf:

     <xsp-language name="MyML">
       <parameter name="prefix" value="mml"/>
       <parameter name="uri" value=""/>
       <target-language name="java">
         <parameter name="core-logicsheet" 

But should this really be in an xsp-language tag, or in a myml-language 
tag? And once I did this would I just pass "myml" to 
ProgramGenerator.load() and it would choose the right core logicsheet?


Changes to xsp.xsl:
		<xsl:variable name="base-class">
		    <xsl:when test="@base-class">
		      <xsl:value-of select="@base-class"/>

      * Generated by XSP. Edit at your own risk, :-)
     public class <xsl:value-of select="@file-name"/> extends 
<xsl:value-of select="$base-class"/> {

To unsubscribe, e-mail:
For additional commands, email:

View raw message