cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: new spin on old xsp error?
Date Tue, 08 May 2001 03:39:07 GMT
On Mon, 7 May 2001, Mark McGettrick wrote:

> > well, this is just your logicsheet, presumably there's also an xsp page
> > it operates on, but i see errors:
>
> > >                 StringBuffer sbCols = new StringBuffer();
> > >                 sbCols.append(<fname>);
> > >                 sbCols.append(rs.getString(2));
> > >                 sbCols.append(</fname>);
> > >                 sbCols.append(<lname>);
> > >                 sbCols.append(rs.getString(3));
> > >                 sbCols.append(</lname>);
> > >                 sbCols.append(<email>);
> > >                 sbCols.append(rs.getString(4));
> > >                 sbCols.append(</email>);
> >
> > this isn't the way that you create elements in xsp. read the xsp docs. you
> > might also want to try using the esql logicsheet.
>
> i know about esql... i've read the XSP docs. this is a simple example of
> other things i have planned that require greater code control than esql
> allows. so, other than the fact that you don't agree with what i'm doing can
> you make any determinations regarding exactly what is causing my error?
> _that_ would be useful.
>
> a helpful reply would go something like this: "hey! you're getting the error
> because line 5 of your code is missing a magical character. add that and
> you'll be all set!".

well, i'm afraid it's not that simple. your problem is both syntactical
and grammatical, as it were. for instance:

> > >                 sbCols.append(<fname>);

isn't valid java code, it would have to be:

sbCols.append("<fname>");

but even that's not going to do what you want, from a grammatical point of
view - it's not going to end up creating an element named fname in the
result set, it's going to end up creating a text string that will render
as &lt;fname&gt;. you _can_ construct a string containing well-formed xml
and then parse it into the output stream using the util logicsheet, but
that's not really the recommended solution. better to create result
elements using xsp's features - namely literal elements embedded in the
xsp code and/or xsp:element. or you could make your life a lot easier and
just use esql to format the results of a sql query as an xml fragment. see
the esql sample in the cocoon distro for inspiration.

- donald


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message