[daisy] Why is the document content included after layout.xsl?
[was: How to fill META tags ?]
Bruno Dumon
bruno at outerthought.org
Thu Mar 20 10:46:56 CET 2008
Hi,
On Thu, 2008-03-20 at 00:54 +0100, Olivier Lange wrote:
> By the way: I have always wondered why the pipeline was designed this
> way, the document content being inserted after the layout was done?
> Was it to enforce some separation of concerns? (content styling or
> «logical styling» vs layout or «physical styling»)
It's because the process of 'styling a document' is completely
context-independent: the styled document might be displayed by itself on
a page (the common case), but it could also be included within another
document, be used in an aggregation (RSS feed, document basket), etc. So
the 'styled document' is a piece of HTML embeddable in various
locations.
As a side effect, not pushing the rendered document through the
layout.xsl improves performance, as it avoids needless data-copying. One
of the nice things about Daisy is that we have great document publishing
performance, despite the use of XML and XSL, which are often associated
with "slow".
> IMHO this design lowers the ability to provide advanced styling for
> custom document types, as the content inclusion at a later stage
> "boxes" the content to its container element (div id="content" for
> instance).
That's true, and when using Daisy for general-purpose websites that's
too limitting indeed. We need to work on this in the future.
I've had some ideas on this long ago. Basically I would allow the
document-publishing XSLT (for the main document displayed on a page) to
produce a piece of extra XML besides the published document, this extra
XML would be provided to the layout.xsl. The use cases you list further
on would be solved by this.
> If the inclusion of the content happened before, the layout could
> split the content apart, put some piece of it here (main part), and
> the rest there (some fields, links, or some other part).
You can change this by moving the transform
"DaisyIncludePreparedDocuments" before the layout.xsl transform. I've
not tried this, but this should transparently work, since this only adds
more stuff to the page-specific content, which the layout.xsl simply
copies over to the output.
> The only use case I can remember for now is that I was not able to
> place part of a document content beneath the navigation tree -- such
> as sidenotes, additional links and ressources --, when the navigation
> tree sat in its own column and when I used tables to do the page
> layout. I had to rewrite the layout with advanced CSS styling
> (multi-columns and floats).
>
> Olivier
--
Bruno Dumon http://outerthought.org/
Outerthought http://www.daisycms.org/
bruno at outerthought.org http://www.kauriproject.org/
More information about the daisy
mailing list