Correct me if I'm wrong, but instead of:

>     BufferedReader r =
>       new BufferedReader(
>         new InputStreamReader(source.getInputStream()));
>     StringBuffer sb = new StringBuffer();
>     for (String s=r.readLine(); s != null; s=r.readLine())
>       sb.append(sb);

you could just use:

String sb = XSPUtil.getContents(source); 

--Steve


> -----Original Message-----
> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]] 
> Sent: Saturday, July 13, 2002 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PROPOSAL] Remove SQLTransformer in 2.1
> 
> 
> > From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
> > 
> > Vadim Gritsenko wrote:
> > 
> > >>From: Luca Morandini [mailto:[EMAIL PROTECTED]]
> > >>
> > >>Andrew,
> > >>
> > >>do you mind terribly showing an example of an ESQL feeded by
> > >>a dynamic query produced by XSLT ?
> > >
> > >I don't mind. Moreover, something tells me I already 
> answered similar 
> > >question on user list...
> > >
> > >Will it help you if I answer?
> > >
> > If he isn't interested in your answer than I am!   So 
> please fire away
> > :-)  (Then I'll document it in a couple days)
> 
> Here it is (untested, from the top of my head):
> 
> <xsp:logic>
>   String query;
>   Source source;
>   try {
>     source = resolver.resolve("cocoon://dynamic-sql");
>     BufferedReader r =
>       new BufferedReader(
>         new InputStreamReader(source.getInputStream()));
>     StringBuffer sb = new StringBuffer();
>     for (String s=r.readLine(); s != null; s=r.readLine())
>       sb.append(sb);
>   } finally {
>     source.recycle();
>   }
> </xsp:logic>
> 
> Then follows your esql code (syntax of esql I do not know 
> 'cause never used it ;).
> 
> PS Snippet above could be a prototype for <util:include-uri 
> as="string"/>
> 
> PPS I assume here that cocoon://dynamic-sql has text serializer.
> 
> Vadim
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 

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

Reply via email to