Hello,

we are using Cocoon 2.0.1, Tomcat 4.0.2, JDK 1.3.1 and try to develop 
something with XSP using external Java-Classes to access Databases and 
performs some Calculation.
The two files (I know, there are a few things that can be done in a better 
way, like xsp:include in example.xsl ...) show our problems and are an 
extract of a larger file. We are using the example.xsl as a logicsheet and 
setup everything in cocoon.xconf, inserted the required fields in 
sitemap.xmap to match example.xsp with the serverpages-gererator (Can 
provide the files if neecessary). Basically, all this works, especially the 
output of our database-request is stored in msg and printed on the screen:

OUTPUT: file:///home/vorms/lomobjects/lo/vorms/tp3/author/stefanvoss_1_1.0.xml

We have to problems:

1: There seems to be some kind of caching in a way we do not want. We 
assume that the xsp is compiled to a generator whenever we change something 
in one of the files and reload the page in a browser (we tried 5 browser, 
all have the same problem). E.g., these files produce the output above. If 
we change something in the xsl-file (like  the "file://" in "foo://", the 
pages in the browser do not change. Furthermore, even a restart of cocoon 
(and tomcat) sometimes are not working either. Strange to say, it works 
sometimes but we could not discover any pattern. The question is: How do we 
prevent a caching and force a recompilation of the xsp-pages whenever we 
have a reload in the browser.

2:  We want to set a xsl:variable to the value of the variable of  "msg" 
being part of the xsl:logic. Using this structure, it seems that the 
xsp:expr is not evaluated and therefore not working. Is there any way to do 
this.

        <xsl:variable name="toInsert">
            <xsp:expr> msg  </xsp:expr>
        </xsl:variable>

    The reason for this solution is that we want to include another file with

     <xsl:apply-templates select="document($toInsert)" />

   and within document it is not allowed to use <xsp:expr>.


Thanks for your help
Torsten
---------------------------------------------------------------------------------------------------------------------------------------------
example.xsp
---------------------------------------------------------------------------------------------------------------------------------------------


<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
           language="java"
           xmlns:xsp="http://apache.org/xsp";
           xmlns:vormsexample="http://www.vorms.org/xsl";
 >

   <xsp:structure>
         <xsp:include>DBInterface</xsp:include>
   </xsp:structure>

   <vormsexample:page>
         <title> Simple Example </title>
         <vormsexample:torsten identifier="LOM"/>
   </vormsexample:page>
</xsp:page>

---------------------------------------------------------------------------------------------------------------------------------------------
example.xsl
---------------------------------------------------------------------------------------------------------------------------------------------

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                 xmlns:xsp="http://apache.org/xsp";
                 xmlns:vormsexample="http://www.vorms.org/xsl";
 >


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

<xsl:template match="vormsexample:torsten">
    <xsp:logic>
       DBInterface dbinterface = new DBInterface();

       
dbinterface.establishConnection("jdbc:mysql://134.169.75.183/vorms","vorms","vorms");

       String msg = "file://" + 
dbinterface.getURIForLM("LO_VORMS_TP3_AUTHOR_STEFANVOSS_1_1");
    </xsp:logic>

    <xsp:expr> msg  </xsp:expr>
    <xsl:variable name="toInsert">
        <xsp:expr> msg  </xsp:expr>
    </xsl:variable>

    <xsl:apply-templates select="document($toInsert)" />
</xsl:template>

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

</xsl:stylesheet>










-- 

                         __  __
                        _ OO\| O__
                         O\__/O / O
            /////        O O\ /
            O O              |
-----.oOOo------oOOo.---------------------------------
Torsten Reiners           Tel:++49-531-3913214
[EMAIL PROTECTED]        Fax:++49-531-3918144
http://server3.winforms.phil.tu-bs.de/~treiners

TU Braunschweig
Abteilung Allgemeine Betriebswirtschaftslehre,
  Wirtschaftsinformatik und Informationsmanagement
Abt-Jerusalem-Str.7
38106 Braunschweig, Germany

Other EMails:  [EMAIL PROTECTED]
                     [EMAIL PROTECTED]
------------------------------------------------------



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to