Robert,
you could try using SQLTransformer to handle just your SQL queries and then apply a
stylesheet to transform them, if need be, in
another XML dictionary before the final rendegin in HTML, WML, PDF, etc.
The advantages are:
- a streamlining of the source code
- the ability to easily replace XML produced by a query with a static XML file (and
viceversa)
The caveats are:
- SQLTranformer in slower than ESQL
- use 2.0.4, since there is a nasty bug in 2.0.3 making hard, at times, the use of
XSLT after an SQLTransformer step
Best regards,
---------------------------------------------
Luca Morandini
GIS Consultant
[EMAIL PROTECTED]
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------
> -----Original Message-----
> From: Robert S�semann [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 12:22 PM
> To: [EMAIL PROTECTED]
> Subject: XSP/ESQL - separation of concerns?
>
>
> Hello,
>
> in my current project I am using xsp and esql logicsheet for db retrivieval
> and tag generation only.
> Although I know that this is good for developing (no extra compilation) I am
> not very happy with it.
>
> What I don't like is:
> -------------------
> - many SQL statement (complex tag structure) mixed cionfusingly with the
> actual document elements
> - the low readability of the code, also hard to debug...
> - no "cocoon-like" separtion of concerns (mix SQL-logic with tags)
> - the feeling that it is not the most performant way of doing this
>
> What I would like better (but don't excately know how):
> -------------------------------------------------------
> - put all SQL that is needed for generating on specific page into another
> "thing" (beans?) that has no tags
> - make my xsp shorter, more readable
> - have the good balance of performance, easy debugging, extensibility and
> the typical "cocoon separation of concerns"
>
> Here is a short but typical code snippet:
> ---------------------------------------
> <ROOT>
> <esql:connection>
> <esql:pool>mysql_pool</esql:pool>
>
> <esql:execute-query>
> <esql:query>
> *COMPLEX QUERY, SOMETIMES 5 <esql:query> PER XSP *
> </esql:query>
>
> <esql:results>
> <esql:row-results>
> <ARTICLE>
> <xsp:attribute name="ID"><esql:get-int
> column="5"/></xsp:attribute>
> <xsp:attribute name="MAIN"><esql:get-string
> column="7"/></xsp:attribute>
> <xsp:attribute name="SUB"><esql:get-string
> column="8"/></xsp:attribute>
> <xsp:attribute name="PDFPRINT"><esql:get-int
> column="9"/></xsp:attribute>
>
> <!-- Attribute evtl. NULL bei Direktanzeige -->
> <xsp:logic>
> if(!<esql:is-null column="3"/>) {
> <HEADER><esql:get-string
> column="1"/></HEADER>
> }
>
> </xsp:logic>
>
> <esql:get-xml column="2"/>
>
> <DATE><esql:get-string column="11"/></DATE>
> <AUTHOR><esql:get-string column="12"/></AUTHOR>
> </ARTICLE>
> </esql:row-results>
> </esql:results>
> <esql:no-results></esql:no-results>
> <esql:error-results></esql:error-results>
> </esql:execute-query>
> </esql:connection>
> </ROOT>
>
> </xsp:page>
>
>
> Should I better use own generators or beans? What are your experiences?
>
> Robert
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>