cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin <jus...@netwerkelectric.com>
Subject Re: How to make custom XSP-like language??
Date Sat, 01 Jun 2002 00:23:11 GMT
Thanks for the quick reply Vadim.

I'm pretty confused by the difference in the cocoon.xconf files that 
come with the Cocoon instalation and the file in the documentation and 
your example in this email.

>> 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.

>> 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
>> this.
>>
>> I'd imagine that I'd need to add something like this to cocoon.xconf:
>>
>>    <markup-languages>
>>      <xsp-language name="MyML">
>>        <parameter name="prefix" value="mml"/>
>>        <parameter name="uri" value="http://paraliansoftware.com/myml"/>
>>        <target-language name="java">
>>          <parameter name="core-logicsheet"
>> value="resource://com/paralian/myml/myml.xsl"/>
>>        </target-language>
>>      </xsp-language>
>>
>> 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?
>
> Here is the snippet from cocoon.xconf:
>
> <component-instance
> class="org.apache.cocoon.components.language.markup.myxsp.MyXSPMarkupLan
> guage"
>     name="myxsp" logger="core.markup.myxsp">
>   <parameter name="prefix" value="myxsp"/>
>   <parameter name="uri" value="http://my.org/myxsp"/>
>   <target-language name="java">
>     <parameter name="core-logicsheet"
> value="resource://org/my/myxsp/java/myxsp.xsl"/>
>   </target-language>
> </component-instance>

This snippet seems match the cocoon.xconf in the online documentation, 
but not the cocoon.xconf file that's packaged with the 2.0.2 installer. 
Will this still work? Why are the cocoon.xconf files different?

By the cocoon.xconf in the documentation I assume I would place this 
snippet in the component element with the role of 
MarkupLanguageSelector. In the cocoon.xconf file that's packed with 
cocoon 2 I don't know quite where to place it. I would think that a new 
markup language definition would go inside the markup-languages element, 
but nowhere in this file are there general component, or 
component-instance definitions.

I'd love some clarification on this.

Thanks,
   Justin

> If you don't need changes in XSPMarkupLanguage, you can use it instead
> of writing MyXSPMarkupLanguage.
>
> In sitemap.xmap:
>
> <map:generator name="myxsp" ...
> src="org.apache.cocoon.generation.ServerPagesGenerator">
>   <markup-language>myxsp</markup-language>
> </map:generator>
>
> That's it.
>
>
> Vadim


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


Mime
View raw message