forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <>
Subject Re: map:transform to docbook xsl
Date Tue, 05 Oct 2004 04:31:17 GMT
Sean Wheller wrote:
> David Crossley wrote:
> > > > David Crossley wrote:
> > > > > Add an extra transformation after the DocBook one to use
> > > > > core/context/resources/stylesheets/html2document.xsl
> Adding another map:transform does nothing but bring up a part of the HTML 
> output from the docbook.xsl
> Transitional//EN""">
> <document>
> <header>
> <title>XML Solves Tech Publishing Problems</title> <!-- <meta content="DocBook

> XSL Stylesheets V1.64.1" name="generator"> --> </header>
> <body></body>
> </document>
> As you see BODY is blank.

Which is correct, according to your sitemap.

This shows that you still have not quite grasped
the sitemap behaviour. (I did point this out already,
but i understand that comments are easy to miss in
the volume.)

You are erroneously matching the db-article.html
and therefore handling *every part* of the processing
in your project sitemap. So you are transforming the
output from the DocBook XSL into Forrest "document-v*"
and sending that to the browser.

Instead, see my sitemap below.

> The sitemap looks like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <map:sitemap xmlns:map="">
>     <map:pipelines>
>         <map:pipeline>
>             <map:match pattern="db-*.html">
>                 <map:generate src="{project:content.xdocs}db-{1}.xml"/>
>                 <map:transform 
> src="/usr/share/xml/docbook/stylesheet/nwalsh/1.64.1/html/docbook.xsl"/>
>                 <map:transform 
> src="/home/sean/projects/forrest/src/core/context/resources/stylesheets/html2document.xsl"/>
>                 <map:serialize type="html"/>
>             </map:match>
>         </map:pipeline>
>     </map:pipelines>
> </map:sitemap>
> Did you mean to add the map:transform here?

Yes, that is the correct place. However you need
the following sitemap. Note my match for db-*.xml
This is because we need to supply content for the
"body" section. Look at core/context/sitemap.xmap
(at today's SVN revision for it, i.e. 47180).
Around line 582 it aggregates all the pieces: skinconf,
tab, menu, and body. For the "body" it sends a request
for cocoon:/body-db-article.html which gets matched at
line 493. This then generates the raw content for body
using the request cocoon:/db-article.xml which would
normally be matched at line 384. This is where we
intercept the *.xml request with our project sitemap.

<?xml version="1.0"?>
<map:sitemap xmlns:map="">
   <map:match pattern="db-*.xml">
    <map:generate src="{project:content.xdocs}db-{1}.xml"/>
     <map:transform src="{forrest:stylesheets}/html2document.xsl"/>
     <map:serialize type="xml-document"/>

This does what we want. However, it reveals a similar glitch
with the empty body content.

I think that i may have found the issue. The DocBook XSL
is generating the page with <div> containers. Fair enough.

However, the html2document.xsl is not expecting divs.

The problem can be duplicated in the "forrest seed" site,
by adding a div container to samples/ihtml-sample.ihtml

Anyway, i get the feeling that this is not a good solution.
We are replacing one workaround (docbook2document.xsl) with
another workaround (html2document.xsl). Is it better?

It is probably worth persisting, if only as an exercise
to help you (and others, and me) to understand the sitemap.

David Crossley

View raw message