You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Niels van Kampenhout <n....@hippo.nl> on 2005/03/22 17:12:50 UTC

Multiple ancestor queries on the same level not supported by SQLTransformer?

Is it possible to have more than one ancestor query in the input XML for the SQLTransformer? I don't see any reason why it shouldn't be, but I cannot get it to work.

Example:

The query

<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
  <sql:execute-query>
    <sql:query name="person"> 
      select id, name, email, frequency from person; 
    </sql:query>
    <sql:execute-query>
      <sql:query name="themes"> 
        select theme
        from person_theme 
        where personid = <sql:ancestor-value sql:level="1" sql:name="person.id"/>;
      </sql:query>
    </sql:execute-query>
    <sql:execute-query>
      <sql:query name="types"> 
        select type 
        from person_type 
        where personid = <sql:ancestor-value sql:level="1" sql:name="person.id"/>;
      </sql:query>
    </sql:execute-query>
  </sql:execute-query>
</page>

returns

<page xmlns:sql="http://apache.org/cocoon/SQL/2.0"></page>

while

<page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
  <sql:execute-query>
    <sql:query name="person"> 
      select id, name, email, frequency from person; 
    </sql:query>
    <sql:execute-query>
      <sql:query name="themes"> 
        select theme
        from person_theme 
        where personid = <sql:ancestor-value sql:level="1" sql:name="person.id"/>;
      </sql:query>
    </sql:execute-query>
  </sql:execute-query>
</page>

returns the result of the SQL queries as it should.

Is this functionality simply not supported by the SQLTransformer, or is my input XML incorrect? Maybe I misinterpreted the meaning of the level attribute?

Niels

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Multiple ancestor queries on the same level not supported by SQLTransformer?

Posted by Torsten Schlabach <ts...@apache.org>.
Niels,

I ran into the same problem.

Did you ever get an answer or were you able to figure it out yourself?

Regards,
Torsten

> Is it possible to have more than one ancestor query in the input XML for
> the SQLTransformer? I don't see any reason why it shouldn't be, but I
> cannot get it to work.
>
> Example:
>
> The query
>
> <page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>   <sql:execute-query>
>     <sql:query name="person">
>       select id, name, email, frequency from person;
>     </sql:query>
>     <sql:execute-query>
>       <sql:query name="themes">
>         select theme
>         from person_theme
>         where personid = <sql:ancestor-value sql:level="1"
> sql:name="person.id"/>;
>       </sql:query>
>     </sql:execute-query>
>     <sql:execute-query>
>       <sql:query name="types">
>         select type
>         from person_type
>         where personid = <sql:ancestor-value sql:level="1"
> sql:name="person.id"/>;
>       </sql:query>
>     </sql:execute-query>
>   </sql:execute-query>
> </page>
>
> returns
>
> <page xmlns:sql="http://apache.org/cocoon/SQL/2.0"></page>
>
> while
>
> <page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>   <sql:execute-query>
>     <sql:query name="person">
>       select id, name, email, frequency from person;
>     </sql:query>
>     <sql:execute-query>
>       <sql:query name="themes">
>         select theme
>         from person_theme
>         where personid = <sql:ancestor-value sql:level="1"
> sql:name="person.id"/>;
>       </sql:query>
>     </sql:execute-query>
>   </sql:execute-query>
> </page>
>
> returns the result of the SQL queries as it should.
>
> Is this functionality simply not supported by the SQLTransformer, or is my
> input XML incorrect? Maybe I misinterpreted the meaning of the level
> attribute?
>
> Niels
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org