You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Saif Khaja <ks...@hotmail.com> on 2000/09/12 21:53:22 UTC

cannot get ESQL to work... urgent

Hi everyone,
I have Cocoon1.7.4 installed on my system. And then I wanted to use ESQL's 
advanced features which will be a great help.
I downloaded the esql.xsl in its position 
(src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl), added the line

processor.xsp.logicsheet.esql.java =
resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl

in the cocoon.properties file. Is there anything else I need to do to get 
the esql working. I tried the following code, but it says "The namespace 
prefix 'esql' was not declared".


<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?xml-logicsheet 
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>

<xsp:page
  language="java"
  xmlns:sql="http://www.apache.org/1999/SQL"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core">

  <page title="SQL Search Results">

	<xsp:logic>
<esql:execute-query>
<esql:driver>sun.jdbc.odbc.JdbcOdbcDriver</esql:driver>
<esql:dburl>jdbc:odbc:Cr7DS</esql:dburl>
<esql:username>rxt1</esql:username>
<esql:password>rxt11</esql:password>
<esql:query>select * from Features</esql:query>
<esql:results>
  <id><esql:get-string column="QID"/></id>
  <name><esql:get-string column="FKey"/></name>
</esql:results>
</esql:execute-query>

	</xsp:logic>

  </page>

</xsp:page>

Any help in this regard will be highly appreciated.

Thanx,
saif.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Re: cannot get ESQL to work... urgent

Posted by Nicola Ken Barozzi <ni...@supereva.it>.
----- Original Message ----- 
From: "Saif Khaja" <ks...@hotmail.com>
To: <co...@xml.apache.org>
Sent: Tuesday, September 12, 2000 9:53 PM
Subject: cannot get ESQL to work... urgent

everything is urgent ;-)


> Hi everyone,
> I have Cocoon1.7.4 installed on my system. And then I wanted to use ESQL's 
> advanced features which will be a great help.
> I downloaded the esql.xsl in its position 
> (src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl), added the line
> 
> processor.xsp.logicsheet.esql.java =
> resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl
> 
> in the cocoon.properties file. Is there anything else I need to do to get 
> the esql working. I tried the following code, but it says "The namespace 
> prefix 'esql' was not declared".

Easy. :-)
The namespace prefix is that [esql:] in front of every esql tag:
 <esql:execute-query>
Namespaces serve to integrate different tag sets in the same page so they don't
have collisions, even with the same name.
The fact is that you have to declare them before using them.
In this page, they are declared for the whole page in the root tag (they can
have scope and be declared in inner elements):
  
> <xsp:page
>   language="java"
[declaration]-->   xmlns:sql="http://www.apache.org/1999/SQL"
[declaration]-->   xmlns:xsp="http://www.apache.org/1999/XSP/Core">

As you can see you have declared the namespaces [sql:] and [xsp],
but no [esql:].
The right declaration is:

<xsp:page
  language="java"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

nicola_ken

Nicola Ken Barozzi - AISA Industries S.p.A
http://www.aisaindustries.it/
Via Leonardo da Vinci,2 Ticengo (CR) Italy
Research Activity:
Politecnico di Milano - Dipartimento di Meccanica
Piazza Leonardo da Vinci, n.32 - 20133 Milano (Italy)