cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien Campagne <>
Subject Re: XSP problem/Cocoon1.7/tag-libs, how to..
Date Wed, 01 Mar 2000 18:14:39 GMT
Joseph, I confirm your results with cocoon 1.7. 

I several other elements of informations. They helped me
solve the problem with Cocoon 1.7. Here they are.

- Stefano Mazzocchi confimed to me that XSP has a problem
in cocoon 1.7, which has now been fixed in CVS (supposedly
packaged with the 1.7.1 to be).

- Peter Moravek sent me his solution to the problem. I add some of my
  observations to his material below:

With cocoon 1.7:
 1/ use xalan_0_19_3D03.jar,
 2/ make a directory where to hold the tag libraries, for instance /usr/local/cocoon/taglibs
    put the XSP part of your style sheets there. (see below for an example).
 3/ add this directory to the JServ engine classpath
 4/ use the resource:/ way to point to the XSP .xsl file.
    eg = resource://samplelib.xsl
 5/ restart the jserv engine that serves cocoon (you need to restart after each
    modification you make to a library: serious restriction at development time
    in my opinion)
 6/ touch sample.xml (the source) or clean the repository (there is a cache problem:
    the page is not recompiled when a library changes, even when you kill and restart
    the cocoon jserv engine! Now that's really not intuitive..).

 7/ access sample.xml

When you develop, you need to go through steps 5-7 each time you make a change to the 
library. Great fun!

Well, at least this is a work-around. I wonder if these cache problems will be solved in
cocoon 1.7.1.

Fabien Campagne

Fabien Campagne      -- Dept. of Physiology and Biophysics,   
phone: (212)-241-0860   Box 1218, Mount Sinai School of Medicine,
fax:   (212)-860-3369   One Gustave L. Levy Place,
---------------------   New York, NY 10029-6574 -----------------

sample.xml --------------------------------------------- 
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
 <?xml-stylesheet href="sample.xsl" type="text/xsl"?>

       <page title="Time of Day">
      To the best of my knowledge, it's now
          <!-- Substitute time of day here -->
        <sample:time-of-day format="yy/MM/dd hh:mm:ss aa"/>

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

<xsl:template match="page">

samplelib.xsl in /usr/local/cocoon/taglibs -----------------------
<?xml version="1.0"?>

<xsl:template match="xsp:page">
            <xsl:apply-templates select="@*"/>
                                          /* "Example" Class Level Logic */
                                          private static String formatDate(Date date, String
pattern) {
                                            if (pattern == null || pattern.length() == 0)
                                              pattern = "yyyy/MM/dd hh:mm:ss aa";
                                            return ("date: " + (new SimpleDateFormat(pattern)).format(date));

<xsl:template match="time-of-day">
   formatDate(new Date(), "<xsl:value-of select="@format"/>")

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


"Joseph B. Ottinger" wrote:
> On Wed, 1 Mar 2000, James & Sue Ann Birchfield wrote:
> > That would help, huh? :)
> >
> > Let's see.
> >
> > I added thiks to my
> > = file:/usr/local/apache/xsp/mail.xsl
> >
> > And I added the taglib class files to my servlet classpath.
> >
> > I believe that is all I had to change.
> > Let me know if that works for you, and if
> > not, I will investigate further(Sorry, it
> > has been a while since I have been able to look
> > at the cocoon stuff)
> I tried this as a variation, as well as just
> /home/joeo/public_html/fusion2.xsl (the full path), and various
> combinations of valid and invalid URIs, including the one you're
> using. Using just the path (no protocol) didn't throw a
> FileNotFoundException, but it didn't work.
> Using file:/home... threw the filenotfound exception.
> Using the full proper URI (file:///home/joeo...) threw the file not found
> exception.
> using file://home/joeo... had the same effect. Only by not using the
> protocol at ALL did I not get the file not found exception, but that also
> did nothing (it didn't apply the stylesheet.)
> Using an HTTP protocol (i.e.,
> was the line in ALSO threw a file not found exception,
> which I rather expected. :)
> I suppose that by now, it's safe to say that' internal
> notes are incorrect - it's not using a URL to the file. (I've verified the
> path is correct.) It's fully possible my XSL file isn't correct, of
> course, but that shouldn't be causing these problems.
> -----------------------------------------------------------
> Joseph B. Ottinger     
>      HOMES.COM Developer
> PGP Key is :

View raw message