cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Kuhnle <li...@kuhnle.net>
Subject Re: [RFE] Some enhancements to XSP
Date Mon, 06 Jun 2005 17:08:41 GMT
Vadim Gritsenko <vadim@reverycodes.com> wrote on 06.06.2005 16:28:19:

> > I think it is a bad idea to use exactly the same syntax as for 
> XSLT because it
> > makes really awkward to use XSP attribute interpolation inside 
logicsheets.
> 
> You haven't written any XSLT producing Ant files recently, have you? :-)
> Now it seems really easy to me, you simply write:
> 
>    <img src="{{foo}}"/>
> 
> in the XSLT.

I have submitted a first patch for XSP expressions [1]. See the patch 
description what is implemented right now (the parser is easily 
replaceable :).

The patch uses "{#" and "}" because IMO it best suits the requirements:

1. The parser shouldn't need to know about the programming language.

2. Unlikely occurrence in existing XSPs

3. Unlikely occurrence in implemented programming languages (I think it's 
only perl with "$#array" or something).

4. Code is movable between XSPs and logic sheets.

5. Minimum interference with XSLT syntax. Logicsheets already contain lots 
of "{var}" and "{{quotedText}}".

> 
> 
> > You end up wasting your time figuring out which curly mountain is 
needed to
> > get the expression to be interpreted by the right engine.
> > 
> > It should be easy for both humans and the XSP processor to 
> distinguish between
> > XSP and XSLT expressions.
> 
> I don't get your point about XSP processor. It is already dead easy for 
it.

We probably would have to write "{{{{quotedText}}}}". The logic sheet 
expression filter reduces this to "{{quotedText}}" and the XSLT processor 
then to "{quotedText}". 

> 
> 
> > I don't know AxKit in detail but I assume that them using "{foo}" 
> syntax means
> > that they are not using XSLT-based logicsheets.
> 
> It's implemented in PERL, for logicsheets they have .pm files, iirc.
> 
> 
> > Anyway, we can still claim to
> > use a common standard by defining:
> > 
> >    interpolated-expr ::= '{' language-expr '}'
> >    language-expr ::= perl-expr | '?' java-expr | '?' javascript-
> expr | '?' python-expr 
> 
> Extra character does not add any elegance, imho.
> 
> 
> >>As for backward compatibility, is is already solved by:
> >>
> >>   <xsp:page attribute-value-interpolation="no">
> > 
> > 
> > But the default value should be attribute-value-
> interpolation="yes", provided
> > we can agree on a syntax which is highly unlikely to be used in 
> existing XSPs.
> 
> If default is "yes" by default :-) then you'll break all the 
installations of 
> Cocoon out there in one shot. *Not* nice!
> 
> Hence, default must be at least configurable - in the cocoon.xconf.

It is.

> 
> Vadim

Regards,
Jochen

[1] http://issues.apache.org/bugzilla/show_bug.cgi?id=35228

Mime
View raw message