You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Lassi Immonen <la...@valkeus.com> on 2002/06/28 13:02:47 UTC

RE: Using Jython in Cocoon

 >Have you tried Python XSPs in Cocoon 2.1-dev?

Yes, but it had some problems with indents at that time (like 1,5 months 
ago) and I couldn't get my own tests to run. It actually had something 
to do with to way I intended xml-tags in xsp file. I quickly tried to 
look for the problem, but it seemed too complicated for me.

I have to test has those bugs gone away.

I really like to treat logic inside python and then shoot xml out of it 
than rather wrap my code in xml. XSP:s are so messy.

 >Have a look at PythonGenerator in 2.1. IIRC, it pre-"compiles" Python
 >scripts.

Do you think it would be possible to get this "pre-compile" thing 
happening at ordinary generator, not in component/language/markup/xsp 
generator.
I don't understand Cocoon structure well enough to answer to this question.

Lassi




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


RE: Using Jython in Cocoon

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Lassi Immonen [mailto:lassi.immonen@valkeus.com]
> 
>  >Have you tried Python XSPs in Cocoon 2.1-dev?
> 
> Yes, but it had some problems with indents at that time (like 1,5
months
> ago) and I couldn't get my own tests to run. It actually had something
> to do with to way I intended xml-tags in xsp file. I quickly tried to
> look for the problem, but it seemed too complicated for me.
> 
> I have to test has those bugs gone away.

Don't bother: it was not changed since then, and unless you ideally
indent your XML tags it will not work (that's because every tag is
Python instruction).


> I really like to treat logic inside python and then shoot xml out of
it
> than rather wrap my code in xml. XSP:s are so messy.

The only disadvantage of your approach is performance loss. Unless you
want to shoot SAX events out of your script by the usage of
contentHandler, performance of your approach will be lower then XSP's.


>  >Have a look at PythonGenerator in 2.1. IIRC, it pre-"compiles"
Python
>  >scripts.
> 
> Do you think it would be possible to get this "pre-compile" thing
> happening at ordinary generator, not in component/language/markup/xsp
> generator.

I don't remember details, but I guess it should be possible, and Store
can be used to save pre-compiled scripts.

Vadim


> I don't understand Cocoon structure well enough to answer to this
question.
> 
> Lassi
> 


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