Cocoon: variables in the sitemap

M

mcv

I'm currently learning to use Cocoon, and although I really like it,
there are a couple of things that don't seem to be explained very well.
I've seen lots of articles explaining really complicated stuff with
actions and selectors and stuff, but I can't find a simple explanation
of how variables in the sitemap actually work. Can anyone direct me to
a good article on that?

Another problem I'm having is that for some strange reason, my stylesheet
replaces the XML file, instead of being applied on the XML. What I'm
doing seems right, and my stylesheet looks perfect, but for some reason
it doesn't work.

Below I've included my sitemap file, because I suspect both problems
are caused by me completely misunderstanding how the sitemap works.
Note that apart from these problems, this is a pretty trivial exmaple,
just intended for to learn to use Cocoon.

The "analyse" pipeline should be triggered by a http GET-request that
contains a URL which then needs to be passed to the HTML Generator,
which doesn't seem to work, whatever I try. At the moment I receive
an error that no pipeline matched request analyse. With slight changes
to the sitemap I receive a variety of exceptions, including one that
says a file with the name of the root directory of this project doesn't
exist. When I put a hard URL in the sitemap, I get the stylesheet
problem mentioned above.

<?xml version="1.0"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

<map:components>
<map:generators>
<map:generator name="html" src="org.apache.cocoon.generation.HTMLGenerator"/>
</map:generators>
<map:transformers>
<map:transformer name="mytransformer" src="MyTransformer"/>
<map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"/>
</map:transformers>
<map:serializers>
<map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer"/>
</map:serializers>
</map:components>

<map:pipelines>

<map:pipeline>
<map:match pattern="">
<map:generate type="file" src="formpage.html"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>

<map:pipeline>
<map:match pattern="analyse?url-form=*">
<map:generate type="html" src="{1}"/>
<map:transform type="mytransformer"/>
<map:transform type="xslt" src="stylesheet.xsl"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>
</map:pipelines>

</map:sitemap>

I'm using Cocoon 2.1.5.1, Java 1.5.0 (shouldn't be relevant) and
Windows 2000 (shouldn't be relevant either).

I'm happy with just a pointer to an article explaining clearly how
these things should work, but if someone could explain it for me here,
that would be great too, ofcourse.


mcv.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top