














































|
The ESQL logicsheet is an
XSP logicsheet that performs sql queries and serializes their
results as XML. This allows you to work with data from a wide variety of different sources when using Cocoon.
It has a number of important advantages over the old (deprecated) SQL logicsheet and SQL processor.
For example, it allows you to mix esql with other logicsheets
(although, if you make your own logicsheet which uses esql, due to a current
bug in Cocoon 1, you
must declare the esql namespace in the source xml file as well as the logicsheet). It also
supports prepared statements (which gives you automatic parameter escaping) - and even multiple encodings
in a single query!
The name was chosen merely to emphasise the fact that this is an extended version of the old sql logicsheet -
esql still uses standard SQL syntax. In fact, it is just a conversion wrapper around your JDBC database
driver, so it supports no more and no less SQL syntax than your JDBC driver supports.
|
At the moment documentation on esql is quite thin on the ground - however, it should be enough to get
you started.
In the samples/sql directory you will find esql.xml , which is an example
of two esql queries, demonstrating "nested" queries and dynamic prepared statements. However, much more
comprehensive is the schema in esql.xsd which is a formal specification,
written in the W3C standard language XML Schema, of every single esql element and attribute.
It is fairly human-readable and includes comments for the purpose of each tag.
The ultimate reference, is of course the source code, which is an XSLT logicsheet contained in the
file src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl
Of course, we would be very grateful for any improvements on this documentation
or further examples - please send them to
cocoon-users@xml.apache.org!
|
|
|