Your example shows that it's possible to have one nested query inside
another one. But it doesn't show that you may have sibling nested queries.

as far as I remember, you can have only one child (nested query), but that
child can have one child too and so on. you can't have this:
      <page xmlns:sql="http://apache.org/cocoon/SQL/2.0";>
        <execute-query xmlns="http://apache.org/cocoon/SQL/2.0";>
         <query name="department" >
              select id,name from department_table
         </query>
         <execute-query>
          <query name="employee">
           select id,name from employee_table where department_id =
             <ancestor-value  sql:name="id" sql:level="1"/>
          </query>
         </execute-query>
         <execute-query>
          <query name="employee1">
           select id,name from employee_table where department_id =
             <ancestor-value  sql:name="id" sql:level="1"/>
          </query>
         </execute-query>
        </execute-query>
      </page>

> I've to correct me on this one. My short looks into the source
> were obviously not enough ...
> 
> This example is taken from
> http://xml.apache.org/cocoon/userdocs/transformers/sql-transfo
rmer.html

<example>

      <page xmlns:sql="http://apache.org/cocoon/SQL/2.0";>
        <execute-query xmlns="http://apache.org/cocoon/SQL/2.0";>
         <query name="department" >
              select id,name from department_table
         </query>
         <execute-query>
          <query name="employee">
           select id,name from employee_table where department_id =
             <ancestor-value  sql:name="id" sql:level="1"/>
          </query>
         </execute-query>
        </execute-query>
      </page>

</example>

So according to the user docs this *is* possible. (Haven't testet it
though)


Regards,


---------------------------------------------------------------------
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]>

Reply via email to