cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent-Olivier Arsenault" <vinc...@stria.com>
Subject Cocoon processor chaining problem.
Date Tue, 08 Feb 2000 20:53:02 GMT
Hi,

I'd like to do  XSP >>> XSLT >>> SQL >>>XSLT processing. The first
XSLT is
because we have all our "SQL-code" (<query> plus connection definitions) in
an XSL stylesheet, and the last one is for presentation.


When I remove the

<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>


for the presentation XSL, everything is fine (I get the processed database
content), but as is (see included code), the first SQL style sheet isn't
(the SQL processor is runned tough, I tested with directly embedding the
SQL, and it worked).

Can somebody please please help me,


thanks
voa

I included here all the relevant files:


################## BEGIN index.xml #####################
<?xml version="1.0"?>


<?cocoon-process type="xsp"?>

<?xml-stylesheet href="file:///usr/local/fusion3/sql/sql.xsl"
type="text/xsl"?>
<?cocoon-process type="xslt"?>


<?cocoon-process type="sql"?>


<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<xsp:page language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:fusion3="http://www.fusion3.com/XSP/fusion3"
>
<fusion3>
  <fusion3:getCategoryList/>
</fusion3>
</xsp:page>
################## END index.xml #####################

################## BEGIN fusion3.xsl (XSP sheet) #####################

<?xml version="1.0"?>


<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
 xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:fusion3="http://www.fusion3.com/XSP/fusion3">

 <xsl:template match="xsp:page">
      <xsp:page>
           <xsl:copy>
                <xsl:apply-templates select="@*"/>
           </xsl:copy>
          <xsl:apply-templates/>
      </xsp:page>
 </xsl:template>

 <xsl:template match="fusion3:getCategoryList">
  <xsp:logic>
     <xsp:content><SQL_getCategoryList/></xsp:content>
  </xsp:logic>
 </xsl:template>

 <xsl:template match="@*|node()" priority="-1">
   <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
 </xsl:template>

</xsl:stylesheet>

################## END fusion3.xsl (XSP sheet) #####################



################## BEGIN sql.xsl (SQL sheet)
#############################################

<?xml version="1.0"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">


 <xsl:template match="fusion3">

  <fusion3>
   <connectiondefs>
     <connection name="fusion3">
      <driver>postgresql.Driver</driver>
      <dburl>jdbc:postgresql://localhost/fusion3</dburl>
      <username>test</username>
      <password>test</password>
     </connection>
   </connectiondefs>


   <xsl:apply-templates/>

  </fusion3>

 </xsl:template>


  <xsl:template match="SQL_getCategoryList">


  <query connection="fusion3" doc-element="categoryset"
row-element="category">

    select distinct webgenre.name, webtree.categoryId from webtree, webgenre
     where webtree.categoryId = webgenre.id;

  </query>


 </xsl:template>


 <xsl:template match="@*|node()" priority="-1">
   <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
 </xsl:template>

</xsl:stylesheet>

################## END sql.xsl (SQL sheet) #####################


################## BEGIN index.xsl (Presentation sheet)
#############################################
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="html"/>


 <xsl:template match="fusion3">

  <html>
   <body>


    <xsl:apply-templates/>


   </body>
  </html>

 </xsl:template>


 <xsl:template match="@*|node()" priority="-1">
   <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
 </xsl:template>

</xsl:stylesheet>
################## END index.xsl (Presentation sheet) #####################


Mime
View raw message