forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <>
Subject Re: Uber Document Splitting
Date Sat, 02 Nov 2002 04:13:12 GMT
On Sat, Nov 02, 2002 at 03:32:52PM +1100, Peter Donald wrote:
> Hi,
> Just say I wanted to develope a complete guide to MyMagic as one large 
> document. Then different presentation forms would arrange it differently 
> according to their specific requirements. 
> For example, lets say I adopt docbook that has chapters and sections. I would 
> potentially want the following generated...
> For PDF:
> /MyMagic.pdf
> For Html:
> /toc.html
> /intro.html
> /chapter1.html
> /chapter2.html
> ...
> or potentially
> /toc.html
> /intro.html
> /chapter1/section1.html
> /chapter1/section2.html
> /chapter1/section3.html
> /chapter2/section1.html
> ...
> or whatever. For an example of this in action see the following which I is 
> generated from docbook via cocoon.

That is exactly what I needed for a user manual: the ability to render as
one large HTML or PDF, or as individual chapters.

I developed a custom Cocoon XPathTransformer[1], which returns a
subsection of the XML doc based on an XPath expression.  To obtain the
XML for a single chapter, I have a sitemap rule:

<map:match pattern="manual/*.xml">
   <map:generate src="content/xdocs/Anteater.xml"/>
   <map:transform src="library/xslt/docv10todocv11.xsl"/>
   <map:transform type="xpath">
     <map:parameter name="include" value="document/header | document/body/section[title='{1}']"/>
   <map:serialize type="xml"/>

The end result can be seen at

If you want to look at the full sitemap, try:

cvs -z3 co Anteater
ant site   # Builds the Forrest site

I could create a template project that demonstrates doc splitting if you like.

> I guess my question is, will Forrest support this kind of behaviour? If so 
> what DTD for the uber guide would you recomend. Docbook seems to crush most 
> xml editors that I know of so there may be a lighter version that I could 
> use?

I used the older documentv10 format with extensions.  Kevin Ross just emailed
me a document2forrest.xsl stylesheet which "enable[s] an easier conversion from
docbook to forrest xdoc content model".  So with this it should be possible to
author in Docbook and convert+split on the fly.


> -- 
> Cheers,
> Peter Donald
> --------------------------------
>  These aren't the droids you're 
>  looking for. Move along. 
> -------------------------------- 

View raw message