You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Jeff Turner <je...@apache.org> on 2002/11/02 05:13:12 UTC

Re: Uber Document Splitting

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:transform>
    ...
   <map:serialize type="xml"/>
 </map:match>

The end result can be seen at http://aft.sourceforge.net/.

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

export CVSROOT=:pserver:anonymous@cvs.aft.sourceforge.net:/cvsroot/aft
cvs -z3 co Anteater
...
ant site   # Builds the Forrest site

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

> http://jakarta.apache.org/avalon/developing/index.html
> 
> 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.


--Jeff


[1] http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12235
> -- 
> Cheers,
> 
> Peter Donald
> --------------------------------
>  These aren't the droids you're 
>  looking for. Move along. 
> -------------------------------- 
> 
> 

Re: Docbook in forrest (was RE:Uber Document Splitting)

Posted by Jeff Turner <je...@apache.org>.
On Mon, Nov 04, 2002 at 11:06:31AM +0100, Carles Canellas wrote:
> I know there was a discussion about using docbook in
> forrest or not. The resolution was not using it.
> 
> But there's a need for some people to use docbook
> without losing the information that a translation via
> XSLT to the forrest's dtd will produce.
> 
> My solution was, in my skin, to change the xslt
> stylesheets to use docbook instead of the forrest
> dtd's. It implied some changes in the sitemap too, in
> some library stylesheets, in the ant to allow own
> defined library override the default ones, and also in
> the css to reflex the way the docbook elements I want
> to appear.
> 
> I can give a summary of changes, in order to create a
> document "using other xml-doc in Forrest".

Yes please, that sounds useful.  Forrest should certainly be flexible
enough to allow the use of Docbook.

> I think that Forrest will improve with a xml-source
> independence, putting in the hands of the user to
> decide the use of the dtd gived by default or the one
> preferred, for example docbook.

+1

--Jeff

> =====
> Carles Canellas.
> VicerTec S.L.

Re: Docbook in forrest (was RE:Uber Document Splitting)

Posted by Steven Noels <st...@outerthought.org>.
Carles Canellas wrote:

> I think that Forrest will improve with a xml-source
> independence, putting in the hands of the user to
> decide the use of the dtd gived by default or the one
> preferred, for example docbook.

In order to do this in a manageable way, I'd prefer to stick with the 
two-step view idea instead of doing direct authoring grammar->rendition 
format conversion.

What I would like to work on after the Cocoon GetTogether is making sure 
we have a stabilized mid-tier format (doc-v11++ I was thinking), and 
stylesheets doing the authoringformat->midtier-format and 
midtier-format->XHTML.

And using CAP pipelines to select the correct processing, so that it 
becomes transparent to the document author 
(http://xml.apache.org/forrest/cap.html).

</Steven>
-- 
Steven Noels                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org                      stevenn@apache.org


Docbook in forrest (was RE:Uber Document Splitting)

Posted by Carles Canellas <cc...@yahoo.es>.
I know there was a discussion about using docbook in
forrest or not. The resolution was not using it.

But there's a need for some people to use docbook
without losing the information that a translation via
XSLT to the forrest's dtd will produce.

My solution was, in my skin, to change the xslt
stylesheets to use docbook instead of the forrest
dtd's. It implied some changes in the sitemap too, in
some library stylesheets, in the ant to allow own
defined library override the default ones, and also in
the css to reflex the way the docbook elements I want
to appear.

I can give a summary of changes, in order to create a
document "using other xml-doc in Forrest".

I think that Forrest will improve with a xml-source
independence, putting in the hands of the user to
decide the use of the dtd gived by default or the one
preferred, for example docbook.



=====
Carles Canellas.
VicerTec S.L.

_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es

Re: Uber Document Splitting

Posted by Henri Yandell <ba...@generationjava.com>.

On Sat, 2 Nov 2002, Jeff Turner wrote:

> 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...

I'm using DocBook at the moment to write some Apache Jakarta
documentation, [I wanted to be able to have it think more in book-form
than web-form]. Currently I use the xsl sheets from the sourceforge
repository which seem to have some definite issues, using forrest on these
would be very interesting.

Hen