Joachim Breitsprecher wrote:
Thorsten Scherler schrieb:

http://forrest.apache.org/docs_0_80/locationmap.html


Geee... Thanks. :) I saw that document but somehow missed the part about Lenya ;-)


<map:match pattern="lenya/**.xml">
  <map:generate type="html" src="{lm:{0}}" />
  <map:transform src="{forrest:stylesheets}/html2document.xsl" />
  <map:serialize type="xml"/>
</map:match>

Basically you need to transform the html to our internal format first with above pipe you can do this. Add it to the sitemap.xmap of your project.


The HTML serializer does not seem to work with Lenya's data - probably because of the xhtml namespace. I solved it this way:

<map:match pattern="lenya/**.xml">
  <map:generate src="{lm:{0}}"/>
<map:transform src="{project:resources.stylesheets}/lenyaxhtml2html.xsl"/>
  <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
  <map:serialize type="xml"/>
</map:match>

Where lenyaxhtml2html.xsl is just a (incorrectly named) simple stylesheet that strips out all namespaces.

Anyway, it works now, thanks for the help!

lenyaxhtml2html.xsl should not be in {project:resources.stylesheets} since it will be the same for all documents, it should be in a central location...

This work should be in a plugin. If you look at the Daisy plugin (in whiteboard) you will see a fairly complete integration of Daisy (another Cocoon based CMS) and Forrest.

I'd recomend using that as a base for the Lenya plugin as it has quite a few additional features like pre and post filtering and navigation inclusion. It is fairly well documented within the plugin.

If you have some working code that you can attach to the issue tracker? I will take care of it. ;-)


Sure. I will probably do that tomorrow when I am back in the office. Is there a particular issue I should attach it to or should I just open a new one?

It's a new one (don't worry if you haven't made it a plugin, either Thorsten or I will do that if you don't have the time).

Ross

Reply via email to