cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: flaws in XSP implementation PLUS sql taglib features discussion
Date Thu, 03 Feb 2000 07:44:45 GMT
On Tue, 1 Feb 2000, Luis Arias wrote:

> ----- Original Message -----
> From: Donald Ball <balld@webslingerZ.com>
> To: Cocoon <cocoon-dev@xml.apache.org>
> Sent: Monday, January 31, 2000 10:20 PM
> Subject: flaws in XSP implementation PLUS sql taglib features discussion
> >
> > <sql:execute-query>
> >  <sql:row-element>article</sql:row-element>
> >  <sql:query>
> >   select id,name,subject_id from article_table
> >   <sql:execute-query>
> >    <sql:query>
> >     select name as subject_name from subject_table where id =
> >     <sql:value-of select="../subject_id"/>
> >    </sql:query>
> >   </sql:execute-query>
> >  </sql:query>
> > </sql:execute-query>
> >
> 
> Hi,
> 
> I was just wondering why you were thinking of using an "all-xslt" approach
> to this ...  Wouldn't it be better for this type of problem to have another
> separate mechanism in your taglib that allows you to keep the current row in
> the outer result set around for this type of purpose ?  That way if you
> could refer to previous result set columns by automagically having them
> bound to some name.
> 
> For instance, taking up on your example :
> 
> <sql:execute-query>
> <sql:row-element>article</sql:row-element>
> <sql:query id="first">
>  select id,name,subject_id from article_table
>  <sql:execute-query>
>   <sql:query id="second">
>    select name as subject_name from subject_table where id =
>    <sql:result column="first.id"/>
>   </sql:query>
>  </sql:execute-query>
> </sql:query>
> </sql:execute-query>
> 
> (Here "first.id" refers to the id column in the result set "of query
> "first", of course, and not the "id" attribute in the xml tag.)
> 
> Am I missing something big here ?

I'm not exactly sure - I'm not relying on XSLT in any way here except in
my choice of element names. The only real difference between your syntax
and my own is my

<sql:value-of select="../id"/>

is replaced by

<sql:result column="first.id"/>

(and of course the id attributes in the query elements)

sql:value-of isn't an element in the XSLT namespace, but an element in the
SQL namespace. I deliberately chose the element's name to be similar to
the XSLT element, but I was under the impression that I'd have to write my
own code to do the value-of lookup routine as I don't see how I could rely
on XSLT (or more generally speaking, an XPath, uh, resolver) to do it for
me. Mind you, if I could, I'd be inclined to do so, but I really can't
visualize a clean way to do so.

Assuming that's correct, I think I like your syntax better. Thanks. If I
can tackle the namespace prefix problem, we'll see how well it works in
practice.

- donald


Mime
View raw message