You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Frédéric Glorieux <fr...@ajlsm.com> on 2002/10/02 18:44:45 UTC

generic resources

    Hello developpers

I'm essentially a cocoon user (degree: coding pipes like serializers and so
on) but I got some tools in my box wich can take a place in webapp distrib,
especially :

an xsl stylesheet to show xml source in html, well commented for adaptation
to replace simple-xml2html.xsl
    - interesting features
            forget MS.IE styles and give your colors to XML
            all xmlns:*="uri" attributes
            no more "+" to clean-up after copy/paste (but still toggles on
tags, with DOM  conformant JS)
            text with <br/> - &amp; - non breakable space
    - usage
            global xsl on input
            as an import on xml blocks (for documentation)

Don't you think that cocoon needs is own style to show xml ? Source code
given on request, other features possible (if you have ideas).



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: generic resources

Posted by Steven Noels <st...@outerthought.org>.
Frédéric Glorieux wrote:

> Fastest way to test it, open it in an XSL compliant browser (IE 5.5 under
> windows, others ?)

Hi Frédéric,

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

It only work for some of the leaf nodes (containing text), higher level 
nodes aren't collapsed.

Dunnow if this is a Mozilla bug or something in your Javascript.

HTH,

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org                      stevenn@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: generic resources

Posted by Frédéric Glorieux <fr...@ajlsm.com>.
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" <st...@outerthought.org>
To: <co...@xml.apache.org>
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" <ov...@cup.hp.com>
To: <co...@xml.apache.org>
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

src/webapp/stylesheets
src/webapp/cocoon/samples/hello-world/style/xsl
src/webapp/samples/common/style/xsl/html

and 4 sitemaps

src/webapp/sitemap.xmap
src/webapp/mount/lint/sitemap.xmap
src/webapp/samples/sitemap.xmap
src/webapp/samples/hello-world/sitemap.xmap

view-source.xsp is used in

src/webapp/sitemap.xmap
sub\sitemap.xmap

> 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:components>
        <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"
src="org.apache.cocoon.generation.ServerPagesGenerator"
logger="sitemap.generator.serverpages" pool-max="32" pool-min="4"
pool-grow="2"/>
        </map:generators>

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

<doctype-system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-s
ystem>
                <encoding>iso-8859-1</encoding>
            </map:serializer>
        </map:serializers>

</map:components>

        <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"/>
            </map:match>
            <!-- 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"/>
            </map:match>
        </map:pipeline>


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.

Re: generic resources

Posted by Ovidiu Predescu <ov...@cup.hp.com>.
On Thursday, October 3, 2002, at 03:28  AM, Frédéric Glorieux wrote:

> XML code in cocoon colors
> Here is as an attached file (in hope that will work)
> Fastest way to test it, open it in an XSL compliant browser (IE 5.5 
> under
> windows, others ?)
> Remove stylesheet processing instruction to compare

Clever stylesheet, Frédéric, I love it!! (The colors are awful IMO, but 
that can be changed ;)

I think we should replace the ugly view-source.xsp with your 
stylesheet, the output is so much better. In case you're not familiar 
with this, the 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.

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.

> 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.

Best regards,
-- 
Ovidiu Predescu <ov...@apache.org>
http://webweavertech.com/ovidiu/weblog/ (Weblog)
http://www.geocities.com/SiliconValley/Monitor/7464/ (Apache, GNU, 
Emacs ...)

> ----- Original Message -----
> From: "Joerg Heinicke" <jo...@gmx.de>
> To: <co...@xml.apache.org>
> Sent: Thursday, October 03, 2002 1:41 AM
> Subject: Re: generic resources
>
>
>> Hello Frédéric,
>>
>> can you provide the code, either (if it's not too much) on the list
>> (zipped) or as patch in bugzilla? I'm really interested in some code
>> better than simple-xml2html.xsl.
>>
>> Regards,
>>
>> Joerg
>>
>> Frédéric Glorieux wrote:
>>>     Hello developpers
>>>
>>> I'm essentially a cocoon user (degree: coding pipes like serializers 
>>> and
> so
>>> on) but I got some tools in my box wich can take a place in webapp
> distrib,
>>> especially :
>>>
>>> an xsl stylesheet to show xml source in html, well commented for
> adaptation
>>> to replace simple-xml2html.xsl
>>>     - interesting features
>>>             forget MS.IE styles and give your colors to XML
>>>             all xmlns:*="uri" attributes
>>>             no more "+" to clean-up after copy/paste (but still 
>>> toggles
> on
>>> tags, with DOM  conformant JS)
>>>             text with <br/> - &amp; - non breakable space
>>>     - usage
>>>             global xsl on input
>>>             as an import on xml blocks (for documentation)
>>>
>>> Don't you think that cocoon needs is own style to show xml ? Source 
>>> code
>>> given on request, other features possible (if you have ideas).
>>
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: generic resources

Posted by Frédéric Glorieux <fr...@ajlsm.com>.
XML code in cocoon colors
Here is as an attached file (in hope that will work)
Fastest way to test it, open it in an XSL compliant browser (IE 5.5 under
windows, others ?)
Remove stylesheet processing instruction to compare

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 ?

----- Original Message -----
From: "Joerg Heinicke" <jo...@gmx.de>
To: <co...@xml.apache.org>
Sent: Thursday, October 03, 2002 1:41 AM
Subject: Re: generic resources


> Hello Frédéric,
>
> can you provide the code, either (if it's not too much) on the list
> (zipped) or as patch in bugzilla? I'm really interested in some code
> better than simple-xml2html.xsl.
>
> Regards,
>
> Joerg
>
> Frédéric Glorieux wrote:
> >     Hello developpers
> >
> > I'm essentially a cocoon user (degree: coding pipes like serializers and
so
> > on) but I got some tools in my box wich can take a place in webapp
distrib,
> > especially :
> >
> > an xsl stylesheet to show xml source in html, well commented for
adaptation
> > to replace simple-xml2html.xsl
> >     - interesting features
> >             forget MS.IE styles and give your colors to XML
> >             all xmlns:*="uri" attributes
> >             no more "+" to clean-up after copy/paste (but still toggles
on
> > tags, with DOM  conformant JS)
> >             text with <br/> - &amp; - non breakable space
> >     - usage
> >             global xsl on input
> >             as an import on xml blocks (for documentation)
> >
> > Don't you think that cocoon needs is own style to show xml ? Source code
> > given on request, other features possible (if you have ideas).
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

Re: generic resources

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Frédéric,

can you provide the code, either (if it's not too much) on the list 
(zipped) or as patch in bugzilla? I'm really interested in some code 
better than simple-xml2html.xsl.

Regards,

Joerg

Frédéric Glorieux wrote:
>     Hello developpers
> 
> I'm essentially a cocoon user (degree: coding pipes like serializers and so
> on) but I got some tools in my box wich can take a place in webapp distrib,
> especially :
> 
> an xsl stylesheet to show xml source in html, well commented for adaptation
> to replace simple-xml2html.xsl
>     - interesting features
>             forget MS.IE styles and give your colors to XML
>             all xmlns:*="uri" attributes
>             no more "+" to clean-up after copy/paste (but still toggles on
> tags, with DOM  conformant JS)
>             text with <br/> - &amp; - non breakable space
>     - usage
>             global xsl on input
>             as an import on xml blocks (for documentation)
> 
> Don't you think that cocoon needs is own style to show xml ? Source code
> given on request, other features possible (if you have ideas).


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org