AW: [docbook-apps] Listings placeable at the End of Printed Output?

From
Kallauch, Benjamin (EEIN) <>
Date
2015-04-22T09:05:49+00:00
ID
Thread
AW: [docbook-apps] Listings placeable at the End of Printed Output?
Hi, sorry for misunderstanding. It was not my intention to make you look a fool. I simply couldn’t understand the problem, because the example was plain enough and was running at once with my config.
 Sometimes I see really strange side effects when parsing/transforming invalid XML… So, I thought, let you know that it was not well formed, is a good idea. Ok, it wasn’t. ;-)

 

Regarding the issue: Combining the standard match=”appendix” template from fo/components.xsl helped me a little bit. At least you get an appendix title and a page number. Therefore, a toc entry with
 page number with link and also PDF bookmark.

 

Nevertheless: There is some fine tuning to do. Still, the LOTs don’t have titles generated in the toc.

 

I hope I didn’t get you wrong again.

regards,

Ben

 

Von: Eisele, Kai Alexander [mailto:]

Gesendet: Dienstag, 21. April 2015 16:35

An: 

Betreff: AW: [docbook-apps] Listings placeable at the End of Printed Output?

 

Hi,

 

As to the missing </xsl:if> tag in the customization example below: a copy fault, occurring quite frequently when copying something from sources all over the web.

 

But I did not report any XSLT syntax error being my current issue. Be assured, that the XSL customization layer I use is both well-formed and valid.

 

Eventually, after a series of misunderstandings the intended appendix elements (figures, tables, examples) are written to the end of FO output.

 

HOWEVER:

(1)

As TOC entry I currently receive: "APPENDIX A. List of Figures, Tables, Examples ....................................  " yet without a page number being displayed and therefore not a clickable TOC
 entry, which is rather unpleasant. 

So, how can I configure an appendix TOC entry according to the common chapter or section TOC entries?

(2)

Furthermore, the appendix configured this way does not have a title (like: "APPENDIX") displayed on the page, the appendix starts with. Instead of first showing an appendix title, the figure element
 title ("List of Figures") is directly displayed. How could I possibly adjust this? The related DocBook XML contains an appendix element with a "role=lot" attribute, a specified title and an "id=app_a" attribute, which does not prevent the Apache 1.1 FOP from
 displaying a "WARNING: Page 3: Unresolved ID reference "app_a" found." which is "WARNING: Page 3: Unresolved ID reference "d61e2804" found." otherwise, when not specifying an 'id' attribute value.

 

Kai

 

 

Von: Kallauch, Benjamin (EEIN) [mailto:]

Gesendet: Montag, 20. April 2015 17:24

An: 

Betreff: AW: [docbook-apps] Listings placeable at the End of Printed Output?

 

Kai,

 

I checked the example as well, using Xalan/FOP1.1 and DB4.5. Everything is fine, and I received the LOTs within my appendix at the end of the document.

 

Maybe some ideas:

-         
Check if you had an appendix element with a role attribute filled with ‘lot’.

-         
Check your template. The template below is not well formed by the way (missing closing xs:if element.)

 

Regards,

Ben

 

Von: Eisele, Kai Alexander [mailto:]

Gesendet: Montag, 20. April 2015 14:02

An: 

Betreff: AW: [docbook-apps] Listings placeable at the End of Printed Output?

 

No problem... I had also already tried leaving out the namespace prefix, the result is the same: No appendix is created at the end of the PDF.

 

Currently, I am using the following customization (extract):

 

<?xml version='1.0'?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook"
 version="1.0">

     ...

     <xsl:import href="">

     ...

     <xsl:param name="generate.toc">

     appendix nop <!-- tried also: toc,title resp. toc,title,figure,table,example -->

     ...

     book toc,title

     ...

     </xsl:param>

 

     <!-- Template adjustment to have lists of titles (figures, tables, examples) attached to the end of printed output -->

     <xsl:template match="appendix[@role = 'lot']">

 

        <xsl:variable name="lot-master-reference">

         <xsl:call-template name="select.pagemaster">

            <xsl:with-param name="pageclass" select="'lot'"/>

         </xsl:call-template>

        </xsl:variable>

 

        <xsl:if test="//figure">

         <xsl:call-template name="page.sequence">

            <xsl:with-param name="master-reference"

                               select="$lot-master-reference"/>

            <xsl:with-param name="element" select="'toc'"/>

            <xsl:with-param name="gentext-key" select="'ListofFigures'"/>

            <xsl:with-param name="content">

              <xsl:call-template name="list.of.titles">

                 <xsl:with-param name="titles" select="'figure'"/>

                 <xsl:with-param name="nodes" select="//figure"/>

              </xsl:call-template>

            </xsl:with-param>

         </xsl:call-template>

 

        <xsl:if test="//table">

         <xsl:call-template name="page.sequence">

            <xsl:with-param name="master-reference"

                               select="$lot-master-reference"/>

            <xsl:with-param name="element" select="'toc'"/>

            <xsl:with-param name="gentext-key" select="'ListofTables'"/>

            <xsl:with-param name="content">

              <xsl:call-template name="list.of.titles">

                 <xsl:with-param name="titles" select="'table'"/>

                 <xsl:with-param name="nodes" select="//table"/>

              </xsl:call-template>

            </xsl:with-param>

         </xsl:call-template>

         </xsl:if>

 

        <xsl:if test="//example">

         <xsl:call-template name="page.sequence">

            <xsl:with-param name="master-reference"

                               select="$lot-master-reference"/>

            <xsl:with-param name="element" select="'toc'"/>

            <xsl:with-param name="gentext-key" select="'ListofExamples'"/>

            <xsl:with-param name="content">

              <xsl:call-template name="list.of.titles">

                 <xsl:with-param name="titles" select="'example'"/>

                 <xsl:with-param name="nodes" select="//example"/>

              </xsl:call-template>

            </xsl:with-param>

         </xsl:call-template>

         </xsl:if>

        

     </xsl:template>

     ...

 

</xsl:stylesheet>

 

For me it seems as if only the standard creation of Lists of Titles in the document's front were working in DocBook V4.5

 

Kai Alexander Eisele

CENIT AG

 

 

-----Ursprüngliche Nachricht-----

Von: Bob Stayton [mailto:]

Gesendet: Freitag, 17. April 2015 18:15

An: Eisele, Kai Alexander; 

Betreff: Re: AW: [docbook-apps] Listings placeable at the End of Printed Output?

 

Sorry, I assumed you were using DocBook5 and the namespaced version of

the stylesheets, now I see that you are using DocBook 4.   In the

customization I gave you, just remove the "d:" namespace prefix from the element names, then the stylesheet will recognize the elements in your document.

 

Bob Stayton

Sagehill Enterprises



 

On 4/17/2015 2:54 AM, Eisele, Kai Alexander wrote:

> Hi,

> 

> Sorry, but this does not work for me.

> 

> Here some relevant data, that may be necessary for further analysis:

> 

> _Used tools/software_

> 

> __

> 

> XSLT Processor: Saxon Version 9-5-1-8

> 

> FO Processor: Apache FOP 1.1

> 

> XSL Stylesheet Files Distribution: ZIP-Release 1.78.1 downloaded from

> sourceforge.net

> 

> DocBook V4.5 edited with XMLmind XML Editor Professional Edition 6.1.0

> 

> I inserted the following passages into my XSL customization layer:

> 

> <?xml version='1.0'?>

> 

> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

> xmlns:fo="http://www.w3.org/1999/XSL/Format"

> xmlns:d="http://docbook.org/ns/docbook" version="1.0">

> 

>       ...

> 

>       <xsl:import 

> href="">

> 

>       ...

> 

>       <xsl:param name="generate.toc">

> 

>       appendix nop <!-- tried also: toc,title resp.

> toc,title,figure,table,example -->

> 

>       ...

> 

>       book toc,title

> 

>       ...

> 

>       </xsl:param>

> 

>       <!-- Template adjustment to have lists of titles (figures,

> tables,

> examples) attached to the end of printed output -->

> 

>       <!-- Declared d xml namespace on top as you can see, yet not

> sure, whether that is neither correct nor required in DocBook V4.5 -->

> 

>       <xsl:template match="d:appendix[@role = 'lot']">

> 

>          <xsl:variable name="lot-master-reference">

> 

>           <xsl:call-template name="select.pagemaster">

> 

>              <xsl:with-param name="pageclass" select="'lot'"/>

> 

>           </xsl:call-template>

> 

>          </xsl:variable>

> 

>          <xsl:if test="//d:figure">

> 

>           <xsl:call-template name="page.sequence">

> 

>              <xsl:with-param name="master-reference"

> 

>                                 select="$lot-master-reference"/>

> 

>              <xsl:with-param name="element" select="'toc'"/>

> 

>              <xsl:with-param name="gentext-key" 

> select="'ListofFigures'"/>

> 

>              <xsl:with-param name="content">

> 

>                <xsl:call-template name="list.of.titles">

> 

>                   <xsl:with-param name="titles" select="'figure'"/>

> 

>                   <xsl:with-param name="nodes" select="//d:figure"/>

> 

>                </xsl:call-template>

> 

>              </xsl:with-param>

> 

>           </xsl:call-template>

> 

>          <xsl:if test="//d:table">

> 

>           <xsl:call-template name="page.sequence">

> 

>              <xsl:with-param name="master-reference"

> 

>                                 select="$lot-master-reference"/>

> 

>              <xsl:with-param name="element" select="'toc'"/>

> 

>              <xsl:with-param name="gentext-key" 

> select="'ListofTables'"/>

> 

>              <xsl:with-param name="content">

> 

>                <xsl:call-template name="list.of.titles">

> 

>                   <xsl:with-param name="titles" select="'table'"/>

> 

>                   <xsl:with-param name="nodes" select="//d:table"/>

> 

>                </xsl:call-template>

> 

>              </xsl:with-param>

> 

>           </xsl:call-template>

> 

>           </xsl:if>

> 

>          <xsl:if test="//d:example">

> 

>           <xsl:call-template name="page.sequence">

> 

>              <xsl:with-param name="master-reference"

> 

>                                 select="$lot-master-reference"/>

> 

>              <xsl:with-param name="element" select="'toc'"/>

> 

>              <xsl:with-param name="gentext-key" 

> select="'ListofExamples'"/>

> 

>              <xsl:with-param name="content">

> 

>                <xsl:call-template name="list.of.titles">

> 

>                   <xsl:with-param name="titles" select="'example'"/>

> 

>                   <xsl:with-param name="nodes" select="//d:example"/>

> 

>                </xsl:call-template>

> 

>              </xsl:with-param>

> 

>           </xsl:call-template>

> 

>           </xsl:if>

> 

>       </xsl:template>

> 

>       ...

> 

> </xsl:stylesheet>

> 

> As to the appendix' customization's result in printed output, it just

> seems to be ignored by XSLT and FOP.

> 

> The processors run through it without any warnings or error messages,

> everything appears to be alright, yet no appendix is created in the PDF.

> Only the standard book TOC is available in the front of the document.

> 

> Maybe I should try the alternative, you mentioned, which is to let the

> stylesheet create an appendix or appendices automatically?

> 

> Because that is, what should be done as a rule by the XSL

> customization layer we need for our print output documentation purposes.

> 

> Regards

> 

> Kai Alexander Eisele

> 

> -----Ursprüngliche Nachricht-----

> Von: Bob Stayton [mailto:]

> Gesendet: Mittwoch, 15. April 2015 18:02

> An: Eisele, Kai Alexander; 


> Betreff: Re: [docbook-apps] Listings placeable at the End of Printed Output?

> 

> Hi,

> 

> Yes, it is possible to do this.  You could get the stylesheet to do it

> automatically, but you could also use a special appendix file as you

> suggest to trigger it only for certain documents.  That appendix would

> need a role attribute to trigger the special processing.

> 

> In the template matching on the book element in fo/division.xsl, it

> calls the "make.book.tocs" template before the content.  That template

> checks the "generate.toc" stylesheet param to see which lists to

> generate.  You would want to set "generate.toc" to just "book toc,title"

> 

> so it doesn't generate the other lists in the front.

> 

> Then you create a custom template for your special appendix to

> generate the lists of titles, borrowing much of the code from the

> "make.book.tocs" template, something like:

> 

> <xsl:template match="d:appendix[@role = 'lot']">

> 

>     <xsl:variable name="lot-master-reference">

> 

>       <xsl:call-template name="select.pagemaster">

> 

>         <xsl:with-param name="pageclass" select="'lot'"/>

> 

>       </xsl:call-template>

> 

>     </xsl:variable>

> 

>    <xsl:if test="//d:figure">

> 

>       <xsl:call-template name="page.sequence">

> 

>         <xsl:with-param name="master-reference"

> 

>                         select="$lot-master-reference"/>

> 

>         <xsl:with-param name="element" select="'toc'"/>

> 

>         <xsl:with-param name="gentext-key" select="'ListofFigures'"/>

> 

>         <xsl:with-param name="content">

> 

>           <xsl:call-template name="list.of.titles">

> 

>             <xsl:with-param name="titles" select="'figure'"/>

> 

>             <xsl:with-param name="nodes" select="//d:figure"/>

> 

>           </xsl:call-template>

> 

>         </xsl:with-param>

> 

>       </xsl:call-template>

> 

>       <!-- repeat for tables, examples, etc. -->

> 

>     </xsl:if>

> 

> Note you need to change the select attribute for figure from .//figure

> (the context relative to the book element) to //figure so the appendix

> context can find the figure elements.

> 

> This special appendix will also generate an entry in the main TOC,

> unless you further customize to turn that off or change its appearance.

> 

> Bob Stayton

> 

> Sagehill Enterprises

> 

>  <mailto:>

> 

> On 4/15/2015 3:11 AM, Eisele, Kai Alexander wrote:

> 

>  > Hi,

> 

>  >

> 

>  > Is there any chance to have lists of figures, tables and examples

> 

>  > positioned at the end of printed output (PDF documents)?

> 

>  >

> 

>  > By default, the listings appear at the beginning of the documents

> 

>  > right after the actual TOC.

> 

>  >

> 

>  > Is it possible to customize a sort of document appendix, that

> contains

> 

>  > the lists of figures, tables and examples?

> 

>  >

> 

>  > Regards

> 

>  >

> 

>  >

> 

>  > *Kai Alexander Eisele*

> 

>  > SAP CC

> 

>  >

> 

>  > *CENIT AG *

> 

>  > Industriestraße 52-54

> 

>  > D-70565 Stuttgart

> 

>  > Phone:  +49 (0) 711-78 25-3241

> 

>  > Fax:    +49 (0)711 7825 44-4145

> 

>  >

> 

>  >  <mailto:>

> <mailto:>

> 

>  >

> 

>  > www.cenit.com <http://www.cenit.com>

> <http://www.cenit.com/en_EN.html>__

> 

>  >

> 

>  >

> 

>  > CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711

> 

>  > 7825-30, Fax: +49 711 7825-4000, Internet: 
www.cenit.de 

> <http://www.cenit.de>

> 

>  > Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen,

> 

>  > Oelsnitz, Ratingen, Saarbruecken

> 

>  > Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt

> 

>  > Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des

> 

>  > Aufsichtsrats), Hubert Leypoldt, Andreas Karrer

> 

>  > Bankverbindungen:

> 

>  > Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070

> 

>  > 0166

> 

>  > 1040 00 SWIFT-CODE : DEUTDESS,

> 

>  > Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071

> 

>  > 0532

> 

>  > 0155 00 SWIFT-Code : COBADEFF600,

> 

>  > Registergericht: Amtsgericht Stuttgart

> 

>  > Handelsregister: HRB Nr. 19117

> 

>  > Umsatzsteuer: ID-Nr. DE 147 862 777

> 

>  >

> 

> 

> CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711

> 7825-30, Fax: +49 711 7825-4000, Internet: 
www.cenit.de

> Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen,

> Oelsnitz, Ratingen, Saarbruecken

> Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt

> Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des

> Aufsichtsrats), Hubert Leypoldt, Andreas Karrer

> Bankverbindungen:

> Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070

> 0166

> 1040 00 SWIFT-CODE : DEUTDESS,

> Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071

> 0532

> 0155 00 SWIFT-Code : COBADEFF600,

> Registergericht: Amtsgericht Stuttgart

> Handelsregister: HRB Nr. 19117

> Umsatzsteuer: ID-Nr. DE 147 862 777

> 

 

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet:
www.cenit.de

Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken

Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt

Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer

Bankverbindungen:

Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,

Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,

Registergericht: Amtsgericht Stuttgart

Handelsregister: HRB Nr. 19117

Umsatzsteuer: ID-Nr. DE 147 862 777

 

CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet:
www.cenit.de

Geschaeftsstellen: Berlin, Frankfurt, Hamburg, Hannover, Muenchen, Oelsnitz, Ratingen, Saarbruecken

Vorstandsmitglieder: Kurt Bengel, Matthias Schmidt

Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer

Bankverbindungen:

Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,

Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,

Registergericht: Amtsgericht Stuttgart

Handelsregister: HRB Nr. 19117

Umsatzsteuer: ID-Nr. DE 147 862 777