cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Homayoun Pourheidari" <>
Subject SQL output format?
Date Wed, 19 Jul 2000 18:04:10 GMT

I'm a new cocoon user and I'm mainly focusing on using it as a way to
create xml files that can connect to a DB (using jdbc), retreive some
data, format it, and return the results back to the client.

It was fairly easy to figure out how to connect to the DB but once I
get my data, I can't quite figure out how to format it.  I only get
the raw results all munged up together and my attempts at creating a
reasonable .xsl that can somehow format it properly don't seem to

So, I was wondering if someone has run into the same type of problems
or whether there are better examples that can show me how to format
the output of the sql queries better.  I've attached what I have got
so far at the end.

Thanks in advance,

Here is what I've got:

------------------- foo.xml ----------
<?xml version="1.0"?>

<?cocoon-process type="sql"?>
<!-- <?cocoon-process type="xslt"?> --> I've this commented since it seems 
                                      remove the rowset/row tags if I
                                      include it.

<?xml-stylesheet href="db3.xsl" type="text/xsl"?>


<title>SQL Search Results for 'foo.xml'</title>

<connection name="myconnname">


<query connection="ora">
select key, value from dummy_table


---------------------- foo.xsl ---------------------
<?xml version="1.0"?>

<!-- Written by Stefano Mazzocchi "" -->

<xsl:stylesheet version="1.0" 

<xsl:template match="page">
    <xsl:value-of select="title"/>

   <body bgcolor="#ffffff">


<xsl:template match="title">
  <h1 align="center">

<!-- I only use this tag to form a reasonable table -->
<xsl:template match="tablewrapper">
  <table border="1">
      <td> Key</td>
      <td> Value</td>

<xsl:template match="rowset">
  <xsl:apply-templates select="row"/>

<xsl:template match="row">
      <xsl:value-of select="key"/>
     <xsl:value-of select="value"/>

Get Your Private, Free E-mail from MSN Hotmail at

View raw message