You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by sudhi <su...@insage.com> on 2000/09/26 19:51:14 UTC
Re: Simple SQL and XSP problem..
Hi,
Try moving ur PI's in this order.
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
HTH
Sudhi
Richard Turner wrote:
>
> Hi
>
> I am relatively new to Cocoon, but I can see that can do everything I
> need. I've got the SQL connection made to a postgres server and results
> coming back. (BTW is there a postgres schema for the example databases
> ?) What I want is to do is format the results from the SQL query with a
> XSL sheet. When I add the xsl-stylesheet tag, the HTML produced shows
> the original query code rather than the results. What do I need to do
> in order to apply formatting to the esql.xml or taglib.xml examples
> (Taglib version below). Is there an example anywhere for this as I'm
> sure that everyone would want to do this at some stage.
>
> TIA
>
> Richard
>
> taglib1.xml
>
> <?xml version="1.0"?>
> <?cocoon-process type="xslt"?>
> <?cocoon-process type="xsp"?>
> <?xml-logicsheet
> href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
>
> <?xml-stylesheet href="taglib.xsl" type="text/xsl"?>
> <xsp:page
> language="java"
> xmlns:sql="http://www.apache.org/1999/SQL"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:request="http://www.apache.org/1999/XSP/Request"
> >
>
> <page title="SQL Search Results">
>
> <sql:execute-query>
> <sql:driver>org.postgresql.Driver</sql:driver>
> <sql:dburl>jdbc:postgresql://localhost/test</sql:dburl>
> <sql:username>postgres</sql:username>
> <sql:doc-element>things</sql:doc-element>
> <sql:row-element>thing</sql:row-element>
> <sql:query>select * from column_type_table </sql:query>
> </sql:execute-query>
>
> </page>
>
> </xsp:page>
>
> taglib.xsl
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> 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>
> Database Test
> </title>
> </head>
> <body bgcolor="#ffffff">
> <xsl:apply-templates/>
> </body>
> </html>
> </xsl:template>
>
> <xsl:template match="id">
> <b>
> <xsl:apply-templates/></b>
> </xsl:template>
>
> <xsl:template match="my_date">
> <b>
> <xsl:apply-templates/></b>
> </xsl:template>
>
> <xsl:template match="my_time">
> <b>
> <xsl:apply-templates/></b>
> </xsl:template>
> </xsl:stylesheet>
>
> Confidentiality: This e-mail message and any attachments may contain
> confidential and/or legally privileged information. It is intended for
> the addressee only and if you are not the intended recipient you should
> not copy or use the contents nor disclose them to anybody else.
> In such a case please notify the sender by return e-mail immediately
> and delete this message and its attachments together with all copies
> in whatever form.
>
> Business Use: Any views or opinions expressed in this message (and any
> attachments) that do not relate to the official business of First Option
> Limited are neither given nor endorsed by it.
>
> Viruses: This e-mail and any attachments has been checked for viruses
> using Mime Sweeper but First Option Limited accepts no responsibility
> for any viruses not revealed by such check and in accordance with good
> computing practice recipients should ensure that they are actually
> virus free.
>
> Contact: In case of any query relating to this message or its content please
> contact the Sender or our System Administrator webmaster@firstoption.com)
> by return e-mail or telephone +44 (0)1962 738200 or by post at
> First Option Limited, Signal House, Jacklyns Road, Alresford, Hants.
> SO24 9JJ, United Kingdom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org