forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: site and book documents
Date Wed, 08 Jan 2003 04:28:28 GMT
On Wed, Jan 08, 2003 at 07:50:14AM +1000, Keiron Liddle wrote:
> Hi,
> 
> I have had a look at creating books or collections of documents. The
> idea is to be able to create book.pdf's and a site.pdf.

Just to clarify.. site.pdf contains content for the whole site?  And
book.pdf for the whole subdir?

> This is just an attempt to look at the problem.
> 
> The normal tabs.xml and book.xml seem to have the wrong information for this.
> 
> I couldn't find a good way to handle it through the book.xml. For a few reasons:
> - it may contain external or other different url's
> - it would need to do some processing to get the actual xml input
> - it could be self referencing
> 
> Instead I thought that it could work with different files with the same
> format.  Instead ref-tabs.xml and ref-book.xml are used to refer to the
> xml files to be included. A stylesheet can then convert the
> ref-tabs.xml into a document containing all the referenced xml
> documents, the combined document can then be converted as normal.

That does seem better.

> Problems:
> - it gets an error due to not finding the dtd files, some resolver problem

I noticed that too when trying to use document('book.xml').  It looks
like the XSLT engine hasn't been told by Cocoon to use the catalog
EntityResolver.

> - documents in other directories can be included so that relative links will be wrong
> - if it refers to a generated xml (eg. todo.xml) then it cannot load the xml
> - the url does not relate to the resource
> - it means there are two books that need maintaining
> 
> There are probably better names for the parts.
> Can anyone see a better way of doing this?

I think it would be better to let the sitemap do all the XML merging,
transforming etc.

At:

http://cvs.apache.org/~jefft/forrest/samples/merge.tgz

there is a sample project with a 'BookView' menu entry, which has a HTML
and PDF containing all merged content in the directory.  Generated PDF at:

http://cvs.apache.org/~jefft/forrest/samples/book.pdf

This is implemented with the XPathDirectoryGenerator in Cocoon scratchpad.

   <!-- Support for merged views of a directory's contents -->
   <map:match pattern="body-book.xml">
     <map:generate type="xpathdirectory"
       src="content/xdocs#/document/*"/>
     <map:transform src="resources/stylesheets/directory2document.xsl"/>
     <map:call resource="skinit">
      <map:parameter name="type" value="document2html"/>
      <map:parameter name="path" value="book"/>
     </map:call>
    </map:match>

This isn't a full solution though, because formats other than doc-v11 won't be
integrated.  That would be easy with a <map:aggregate>, but I'm not sure how to
aggregate dynamically.


--Jeff

> Anyway I think this sort of things should be considered.
> 
> I have attached a sample of how it could be done. With an example in the fresh site.
> 
> Keiron
> 
> 



Mime
View raw message