cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: XSP: HOW TO use more then one logicsheet?
Date Wed, 15 Nov 2000 02:41:25 GMT
On Wed, 15 Nov 2000, Herbert Hotz wrote:

> Hi all,
> 
> Can't manage to use two logicsheets. Would like to use esql.xsl
> within myls.xsl, like
> 
> <?xml-logicsheet href="/esql.xsl.v1.33"?>
> <?xml-logicsheet href="/myls.xsl"?>
> 
> <xsp:page
>  language="java"
>  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>  xmlns:esql="http://apache.org/cocoon/SQL/v2"
>  xmlns:util="http://www.apache.org/1999/XSP/Util"
>  xmlns:myls="/myls">
> 
>  <!-- this produces my query results -->
>  <mysl:do-query>
>   <from>5</form><to>25</to>
>  </mysl:do-query>
> 
> </xsp:page>
> 
> Need help from the community!

i do this all the time. i haven't ever had any trouble. look, before you
go much further, you might find this message helpful:

http://mailman.real-time.com/pipermail/cocoon-users/2000-September/004588.html

i can also give you an example of one of my own logicsheets:

<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0"
 xmlns:xsp="http://www.apache.org/1999/XSP/Core"
 xmlns:request="http://www.apache.org/1999/XSP/Request"
 xmlns:esql="http://apache.org/cocoon/SQL/v2"
 xmlns:calendar="http://apache.org/cocoon/contrib/calendar/v1"
 xmlns:mine="http://www.webslingerZ.com/balld/XML"
>

<xsl:template match="@*|*|text()|processing-instruction()">
  <xsl:copy>
    <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="mine:community-event">
  <esql:connection>
    <esql:driver><xsl:value-of select="$driver"/></esql:driver>
    <esql:dburl><xsl:value-of select="$dburl"/></esql:dburl>
    <esql:username><xsl:value-of select="$username"/></esql:username>
    <esql:password><xsl:value-of select="$password"/></esql:password>
    <esql:execute-query>
      <esql:query>select * from community_event_table where id =
<esql:parameter
type="int"><xsp:expr>Integer.parseInt(<request:get-parameter
name="id"/>)</xsp:expr></esql:parameter></esql:query>
      <esql:max-rows>1</esql:max-rows>
      <esql:results>
        <esql:row-results>
          <event>
            <id><esql:get-string column="id"/></id>
            <title><esql:get-string column="title"/></title>
            <date><esql:get-date column="my_date" format="dd MMM
yyyy"/></date>
            <location><esql:get-string column="location"/></location>
            <content><esql:get-string column="content"/></content>
            <type><esql:get-string column="type"/></type>
            <state><esql:get-string column="state"/></state>
            <contact>
              <name><esql:get-string column="contact_name"/></name>
              <email><esql:get-string column="contact_email"/></email>
              <phone><esql:get-string column="contact_phone"/></phone>
            </contact>
            <calendar>
              <calendar:generate-month>
                <calendar:date><esql:get-date
column="my_date" format="yyyy-MM"/></calendar:date>
                <calendar:format>dd MMM yyyy</calendar:format>
              </calendar:generate-month>
            </calendar>
          </event>
        </esql:row-results>
      </esql:results>
    </esql:execute-query>
  </esql:connection>
</xsl:template>

</xsl:stylesheet>

- donald


Mime
View raw message