[daisy] navigation aggregation question

Bruno Dumon bruno at outerthought.org
Mon Nov 27 03:34:50 CST 2006


On Mon, 2006-11-27 at 13:58 +1100, Nick dos Remedios wrote:
> I've been customising the "navigation aggregation" by making changes
> to the navaggregator cocoon extension (Daisy 1.51). I'm trying to
> create a "printable" version of a site, with all pages from that site
> concatenated together, as specified by the Navigation document.
> 
> 
> I've run into a problem to do with the document styling of pages
> pulled in by the navaggregator request. 
> 
> 
> The individual pages have a disclaimer box at the bottom which is
> added by a document specific styling XSL (the disclaimer text is hard
> coded into the XSL file). For the navaggregator version, I only want
> to display the disclaimer once at the bottom of the "entire" document
> but it appears at the end of each included page, thus many times in
> the navaggregator version. 
> 
> 
> I initially thought I could use the "isIncluded" attribute of the
> d:document node to differentiate between these contexts but this does
> not work for the navaggregator extension, only for Daisy includes (I
> did get this working for a test include version).
> 
> 
> I also tried to follow some advice from the mailing lists archives
> from Bruno (6 Apr 2006):
> 
> 
> > However, you can disable doctype styling (by removing
> > the applyDocumentTypeStyling="true" attribute in navaggr_pubreq.xsl
> > and removing the insertStyledDocument tag from the
> > navaggr_result.xsl) and then just do the desired formatting in the
> > navaggr_result.xsl
> 
> 
> I made the following changes to navaggr_result.xsl (note I'm no expert
> in XSLT):
> 
> 
> > <xsl:for-each
> > select="p:publisherResponse/p:document/p:preparedDocuments">
> >           <!-- <insertStyledDocument
> > styledResultsId="{@styledResultsId}"/> -->
> >           <xsl:apply-templates
> > select="p:preparedDocument/p:publisherResponse/d:document/d:parts/d:part/html/body/*" mode="copy"/>
> 
> 
> where copy mode is defined:
> 
> 
> >   <xsl:template match="@*|*|processing-instruction()|comment()"
> > mode="copy">
> >     <xsl:copy>
> >       <xsl:apply-templates select="*|@*|text()|
> > processing-instruction()|comment()" mode="copy"/>
> >     </xsl:copy>
> >   </xsl:template>
> 
> 
> The results is kind-of what I want but... some of the HTML looks like
> this:
> 
> 
> > <img src="daisy:1307" align="top">
> > <p:linkInfo src="daisy:1307" align="top"
> > documentName="agrotrans-title_full" documentType="Image">
> > <p:linkPartInfo id="3" name="ImageData"
> > fileName="agrotrans-title_full.gif"/>
> > </p:linkInfo></img>
> 
> It seems the applyDocumentTypeStyling performs other important
> transformations apart from the document-specific styling???

Yes, document type styling is crucial (in fact, the word 'type' in there
is a bit redudant, it is simply the styling of the document, which
happens to be customisable per document type). It basically takes the
output of the publisher, which is just a bunch of XML, and turns it into
a published piece of HTML. The document type specific XSLT is just one
part of this process.

The purpose of the document styling is to produce a rendered piece of
HTML which can be inserted into any location, so if you need something
which is only displayed on stand-alone pages, see below.

> 
> Is there another/smarter way to solve this problem?
> 

I would add the disclaimer box in the documentlayout.xsl (below the
"insertStyledDocument" tag). If it only needs to be shown for one or
some document types, you can still check on the document type there
($document/@typeName).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org                          bruno at apache.org



More information about the daisy mailing list