This will produce the same XML 

<esql:connection> 
  <esql:pool>your_pool_name</esql:pool>
  <esql:execute-query>
    <esql:query>
        SELECT ID, DESCRIPTION, COUNTRY_ID
        FROM LANGUAGE_TYPE
        ORDER BY ID
    </esql:query>
  <esql:results>
    <languages>
      <esql:row-results>
         <language>
            <esql:get-columns/>
            <!--OR get manually the columns:
              <id><esql:get-int column="id"/></id>
              <description><esql:get-strint
column="description"/></description>
               .....
              -->
          </language>
      </esql:row-results>
    </languages>
  </esql:results>                                                       
  <esql:no-results>
    <error>No language</error>
  </esql:no-results>
  <esql:error-results>
    <error><esql:get-message/></error>
   </esql:error-results>
  </esql:execute-query>
</esql:connection> 

Zsombor

> -----Original Message-----
> From: Alexander Shopov [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 21, 2006 4:22 PM
> To: [email protected]
> Subject: Using Cocoon's ESQL as replacement for Oracle's XSQL servlet
> 
> Hello everybody,
> 
> I am trying to use the ESQL functionality of Cocoon as a 
> replacement for Oracle's XSQL servlet.
> 
> What I am trying to do is more or less have simple select 
> queries automatically converted to XML.
> 
> For example:
> 
> In Oracle's XSQL the followinng XML file:
> 
> <xsql:query xmlns:xsql="urn:oracle-xsql"
>              connection="test"
>              tag-case="lower"
>              max-rows="-1"
>              null-indicator="no"
>              row-element="language"
>              rowset-element="languages">
>        SELECT ID,
>               DESCRIPTION,
>               COUNTRY_ID
>          FROM LANGUAGE_TYPE
>      ORDER BY ID
> </xsql:query>
> 
> 
> would generate the following XML:
> 
> <languages>
>    <language num="1">
>      <id>1</id>
>      <description>English</description>
>      <country_id>111</country_id>
>    </language>
>    <language num="2">
>      <id>4</id>
>      <description>Japanese</description>
>      <country_id>222</country_id>
>    </language>
>    <language num="3">
>      <id>5</id>
>      <description>Traditional Chinese</description>
>      <country_id>333</country_id>
>    </language>
> </languages>
> 
> 
> Is there an easy way to achieve something reasonably similar (and
> simple) with ESQL? Generating XML data with a simple SQL query?
> 
> I have read the documentation and I am trying the examples 
> but Cocoon architecture is turning out to be really hard for 
> me to grasp.
> 
> Kind regards:
> al_shopov
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to