cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Diego Moller" <diego_mol...@hotmail.com>
Subject Nothing when using sql-tag lib
Date Fri, 23 Jun 2000 12:05:22 GMT
Hi All,

I seem to have run into some quite bizarre problems.

I'm using cocoon v.1.7 together with mysql on an NT-workstation with Apache 
and have made a little test-code to check that the sql-tag-lib with xsp 
works and it does (perfectly actually). Now i have tried to port the same 
code and the exact same versions to a linux environment and here I run to a 
strange problem. It seem that cocoon doesn't execute the sql-query!?

Here is the code I've made

XML-file
------------------
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="simple-taglib-html.xsl" type="text/xsl"?>


<xsp:page
  language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:request="http://www.apache.org/1999/XSP/Request"
  xmlns:util="http://www.apache.org/1999/XSP/Util"
  xmlns:sql="http://www.apache.org/1999/SQL"
>

<page>
<title>Cocoon XSP SQL TagLibs </title>
<author>
  <name>Nicki Moller (stjaalet fra Stefano Mazzocchi og Brian Millet)</name>
</author>

<p>
    Cocoon's SQL/XSP tag library. Samt en lille liste i XSL</p>

<sql:execute-query>
   <sql:driver>org.gjt.mm.mysql.Driver</sql:driver>

<sql:dburl>jdbc:mysql://localhost:3306/diego</sql:dburl>

   <sql:username>diego</sql:username>
   <sql:password>none</sql:password>
   <sql:skip-rows>0</sql:skip-rows>
   <sql:max-rows>20</sql:max-rows>
   <sql:null-indicator>y</sql:null-indicator>
   <sql:count-attribute>count</sql:count-attribute>
   <sql:query-attribute>sqlquery</sql:query-attribute>
   <sql:doc-element>ROWSET</sql:doc-element>
   <sql:row-element>ROW</sql:row-element>
   <sql:query>SELECT * FROM Users;</sql:query>
</sql:execute-query>

</page>
</xsp:page>
-------------

XSP-file

-------------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="page">
   <xsl:processing-instruction 
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <head>
     <title>
         <xsl:value-of select="title"/>
     </title>
<!-- Changed by: D.K.S., 02-Mar-2000 -->
    </head>
    <body bgcolor="#ffffff">

    <xsl:apply-templates/>

    </body>
   </html>
  </xsl:template>

<xsl:template match="title">
    <h1>
    <xsl:apply-templates/>
    </h1>
</xsl:template>


<xsl:template match="p">
   <xsl:copy>
    <xsl:apply-templates/>
   </xsl:copy>
</xsl:template>


<xsl:template match="a">
     <a href="{@href}"><xsl:apply-templates/></a>
</xsl:template>


<xsl:template match="author">
  Lavet af
    <i>
    <xsl:apply-templates/>
    </i>
</xsl:template>

<xsl:template match="name">
    <xsl:apply-templates/>
</xsl:template>


<xsl:template match="ROWSET">

<p>
Query: <xsl:value-of select="@sqlquery"/>
</p>
  Der er  <xsl:value-of select="@count"/> entries i databasen.

    <table border="2" cellspacing="1" cellpadding="6">
    <tr>
        
<td>Name</td><td>NickName</td><td>Email</td><td>User</td><td>Passwd</td><td>Server</td>
     </tr>
     <xsl:for-each select="ROW">
      <tr>
      <td><xsl:value-of select="Name"/></td>
      <td><xsl:value-of select="NickName"/></td>
      <td><xsl:value-of select="Email"/></td>
      <td><xsl:value-of select="User"/></td>
      <td><xsl:value-of select="Passwd"/></td>
      <td><xsl:value-of select="Server"/></td>
      </tr>
     </xsl:for-each>
    </table>
    <p>Hurraaaaa det virker ogsaa!!!</p>
</xsl:template>

</xsl:stylesheet>

------------

And here is the result I get

-------------
Cocoon XSP SQL TagLibs
Lavet af Nicki Moller (stjaalet fra Stefano Mazzocchi og Brian Millet)
Cocoon's SQL/XSP tag library. Samt en lille liste i XSL

org.gjt.mm.mysql.Driver jdbc:mysql://localhost:3306/diego diego none 0 20 y 
count sqlquery ROWSET ROW SELECT * FROM Users
--------------

When I in fact should have had a list of the User tables content

My very simple question is this:
Is it me who have forgotten something in the test-code or is it in my 
cocoon-configuration I have made an error???

PS. I'm a newbie in all of this cocoon/xml/xsl/xsp so please take this into 
account when answering 8-)

Thanx in advance
Diego



________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


Mime
View raw message