OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Re: DOCBOOK-APPS: Generating Preview Documents


On Thu, Oct 17, 2002 at 07:27:26AM +0200, Stephan Wiesner wrote:
> Hi list,
> I want to automate the process of generating a preview document. For the
> HTML version this is very simple, I just enter the following XSLT into
> my master style.
> 
>   
>   <xsl:template match="chapter">
>     <xsl:if test="@id='chap_preview'">
>       <xsl:apply-templates />
>     </xsl:if>
>     
>     <!-- else nothing -->
>   </xsl:template>
>   
> Now, I get a document with TOC (including page numbers), appendixes and
> one chosen chapter.
> 
> When, however, I try it with FOP, I get a 'null' and that is that .-(
> The FO looks okay to me.
> The problem here is the chapter I want to render. If I don't have one
> with the given id in my document, the document is generated correctly.
> 
> Any ideas? Anybody did something like this before and can show me a
> different way?

I'm not completely clear on what you mean by a preview
document.  It seems you want a complete document except
all chapters but one do not appear?  If that is
the case, you might try using <xsl:apply-imports/> in your
customization instead of <xsl:apply-templates/>.

When you do apply-templates, it is only being applied to
the children of chapter.  But you need the chapter element
template to start the page-sequence.  By using
apply-imports instead, you tell the processor to use
the original chapter template.  Since it is conditional
on the selected id, only that chapter should be output.

If you just want to generate a chapter with its own TOC,
you can do it with a couple of parameters and the
stock fo stylesheet:

rootid="chap_preview"
generate.toc="chapter toc"

The first parameter selects only that element for output.
The second parameter causes the chapter to have a TOC
(which it normally does not have in print).

-- 

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC