cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Glorieux <>
Subject Re: generic resources
Date Tue, 08 Oct 2002 19:20:12 GMT
new to test
    margins with unbreakable-spaces to keep formatting in copy/paste
    no more html <pre/> tag in hope that search/replace are not too long

----- Original Message -----
From: "Steven Noels" <>
To: <>
Sent: Sunday, October 06, 2002 1:31 PM
Subject: Re: generic resources

> the collapse/expand function appears not to be working on my Mozilla 1.0
> under W2K.

Fixed for NS6-7, seems that DOM model is different between IE and mozilla
(empty text nodes are registred)
Orthogonal ids seems to work for me.

----- Original Message -----
From: "Ovidiu Predescu" <>
To: <>
Sent: Friday, October 04, 2002 7:55 AM
Subject: Re: generic resources

> (The colors are awful IMO, but
> that can be changed ;)

Cocoon colors I found, mine are theese ones.

> > About webapp hierarchy
> > For our apps, we usually share resources (like this one, or tuned error
> > messages and other xsl, js, css)
> > They are in a WEB-INF/res directory as if it was updatable (like a jar)
> > Some xsl seems to be duplicated in cocoon webapp, can't cocoon show a
> > good
> > practice on this question ?
> I think some of these duplicates are historic. You're more than welcome
> to point out these duplicates and provide a patch as an alternative.

simple-xml2html.xsl  appears in 3 places


and 4 sitemaps


view-source.xsp is used in


> Frédéric, would you like to pick up the task of refactoring the
> existing src/webapp/samples/sitemap.xmap to use your stylesheet instead
> of view-source.xsp? I'd gladly incorporate the changes, together with
> your stylesheet of course, into Cocoon.

I use this piece of code at top of root sitemap

        <map:generators default="xsp">
            <map:generator name="file"
src="org.apache.cocoon.generation.FileGenerator" label="content,data"
logger="sitemap.generator.file" pool-max="32" pool-min="8" pool-grow="4"/>
            <map:generator name="xsp"
logger="sitemap.generator.serverpages" pool-max="32" pool-min="4"

        <map:serializers default="html">
            <map:serializer name="html" mime-type="text/html"
            <map:serializer name="xhtml" mime-type="text/html"
src="org.apache.cocoon.serialization.XMLSerializer" pool-max="64"
pool-min="2" pool-grow="2">
                <doctype-public>-//W3C//DTD XHTML 1.0



        <map:pipeline id="utils">
            <!-- Utility for viewing generated source -->
            <map:match pattern="**.xsp2src">
                <map:generate type="xsp" src="{1}.xsp"/>
                <map:transform src="context://WEB-INF/res/xml.xsl"/>
                <map:serialize type="xhtml"/>
            <!-- Utility for viewing source of a file -->
            <map:match pattern="**2file">
                <map:generate type="file" src="{1}"/>
                <map:transform src="context://WEB-INF/res/xml.xsl"/>
                <map:serialize type="xhtml"/>

It's the fastest way I found to use it from browser.
For security reason, cocoon need perhaps to think before give this tip at
root sitemap, because web sites from cocoon newbies have then the key to be
understood. I can't take this decision alone.

> src/webapp/samples/docs/samples/slides/view-source.xsp
> is doing a similar job as your stylesheet, except that is a Java
> program hidden inside an XSP page, which constructs a DOM tree and
> walks on it to generate the output
If exigent code was needed (like in a browser for example), this kind of
generation could be useful for better handling of <![CDATA[ ]]>, or faster
search/replace. But even in this case, I would keep XSL transformation,
easier to ajust and modify presentation.

View raw message