forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Crossley <cross...@apache.org>
Subject Re: Using Docbook
Date Fri, 26 May 2006 04:33:48 GMT
Johnson, Eric wrote:
> I'm using the sitemap that Brian suggested, but with a local copy of the
> stylesheets. Most of the transform works great there are a few bugs
> though:
> 
> The document title gets repeated so if the source starts of like:
> <article>
> <title>Foo</title>
> ...
> The resulting HTML page from Forrest starts of:
> Foo
> -----
> Foo
> 
> All of the entries in the TOC are doubled up. So for each
> <sect1>
> <title>Bar</title>
> ...
> The TOC entry is:
> BarBar
> 
> All HTML generated from the <command> and <application> tags in docbook
> result in doubled up output.
> 
> Is there a way to figure out if the errors are in the docbook xslt or in
> the Forrest xslt? Is there a way to fix this?

Yes i noticed that too when i documented Brian's solution.

When in 'forrest run' mode, look at the intermediate xml
localhost:8888/eric-test-docbook.xml
That definitely shows the double-up.

Now temporarily adjust your sitemap.xmap to remove the
html-to-document transformer ...

...
<map:when test="docbook-v4.2">
 <map:generate src="{project:content.xdocs}{../1}.xml" />
 <map:transform src="file:///opt/local/share/xsl/docbook-xsl/html/docbook.xsl"/>
<!--
 <map:transform src="{forrest:stylesheets}/html-to-document.xsl" />
 <map:transform type="idgen" />
 <map:serialize type="xml-document"/>
-->
 <map:serialize type="xml"/>
</map:when>
...

localhost:8888/eric-test-docbook.xml
shows that these elements are not doubled here.

I notice that there is a <span> element around
each element that is causing the problem.

You would need to experiment with the XSLT in
that html-to-document.xsl

One workaround might be to insert an additional
transformer after the html-to-document transformer.
It would be a simple stylesheet to transform only
the <div class="toc"> to use the first link in
each <dt>. It would just copy other elements that
you don't want to transform (<xsl:include href="copyover.xsl"/>)

A better way might be to  insert a new transformer
before the html-to-document transformer to massage
the output of the docbook-to-html transformer.

As you can see, this approach of generating the docbook
to html, then html to forrest internal xdoc, then xdoc
to output html, is not ideal. We need help to implement the
planned internal xhtml2 rather than xdoc (document-v13).

-David

Mime
View raw message