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 02:27:09 GMT
On Mon, 7 May 2001, Mark McGettrick wrote:

> you mean my file? it's valid and works fine if i cut the java out and run it
> as part of a java app... it seams like this specific problem was very common
> with an older version of cocoon so i felt like it was natural to figure that
> there might still be a similar problem...

well, this is just your logicsheet, presumably there's also an xsp page
it operates on, but i see errors:

> it's generated by this code:
>
> <?xml version="1.0"?>
> <xsl:stylesheet
>     version = "1.0"
>     xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
>     xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>     xmlns:db="http://www.snotgoth.net/NS/db-taglib"
> >
>     <xsl:template match="xsp:page">
>         <xsp:page>
>             <xsl:copy>
>                 <xsl:apply-templates select="@*"/>
>             </xsl:copy>
>             <xsp:structure>
>                 <xsp:include>java.sql.*</xsp:include>
>             </xsp:structure>
>             <xsp:logic>
>
>         /* get a profile - nUid is temporarily not used. */
>     private static String getProfile(Int nUid) {
>         String url = OMMITTED;
>         String user = OMITTED;
>         String pass = OMITTED;
>         String sQuery = "SELECT * FROM users WHERE id = 1";
>
>         try {
>             Class.forName("org.gjt.mm.mysql.Driver");
>             Connection c = DriverManager.getConnection (url,user,pass);
>             Statement s = c.createStatement();
>             ResultSet rs = s.executeQuery(sQuery);
>             while (rs.next()) {
>                 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.

- 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