docbook-apps

  • 1.  Titlepage customizations for DocBook with XSLT2

    Posted 10-25-2016 13:20
    Hello,
    I thought I'd start looking at migrating to XSLT 2 support, to get access to a few xpath features that would help in source code integrated documentation projects.

    My XSLT 1.0 toolchain consists of xsltproc and commandline FOP, for XSLT2 I'm currently trying Saxon from http://cdn.docbook.org/release/2.0.20/docbook-xslt2-2.0.20-jar.zip

    I'm having trouble finding my way around titlepage customizations (print, in this case). In the old toolchain I had titlepage XML spec files that I processed with the titlepage XSL in docbook into titlepage XSL that I imported into my customization layer.

    In the 2.0 stylesheets I haven't found how to do this. I can edit xslt/base/fo/titlepage-templates.xsl and see end results, but overlaying the templates from it in my customization layer doesn't seem to have any effect. Does anyone have any guidance?

    --
    Erik Rask
    Technical communication coordinator

    Procera Networks
    Birger Svenssons väg 28D
    43240 Varberg, Sweden
    t: +46 340 483800
    www.proceranetworks.com

    m: +46 725 562 965
    e: erik.rask@proceranetworks.com
    skype: procerik




  • 2.  Re: [docbook-apps] Titlepage customizations for DocBook with XSLT2

    Posted 11-05-2016 01:35
    Erik,

    I can't speak to the XSL-FO templates exactly, but for the HTML templates
    it was sufficient for me to just put the relevant templates as shown in
    titlepage-templates.xsl into my customization layer. E.g. the following

    ````
    <xsl:template match="db:book" mode="m:get-titlepage-templates"
    as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:recto>
    <db:cover role="front-cover"/>

    <db:title-group />
    <xsl:if test="/db:book/db:info/db:volumenum">
    Book <db:volumenum /> of
    <db:seriesvolnums />

    </xsl:if>
    <db:corpauthor />
    <db:authorgroup />
    <db:author />
    <db:editor />
    <db:othercredit />

    <db:releaseinfo />
    <db:copyright />
    <db:legalnotice />
    <db:pubdate />
    <db:printhistory />
    <db:revision />
    <db:revhistory />

    <db:abstract />



    </tmpl:recto>
    </tmpl:templates>
    </xsl:template>

    <xsl:template match="db:warning" mode="m:get-titlepage-templates"
    as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:titlepage>

    <db:title/>

    </tmpl:titlepage>
    </tmpl:templates>
    </xsl:template>

    <xsl:template match="db:tip" mode="m:get-titlepage-templates"
    as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:titlepage>

    <db:title/>

    </tmpl:titlepage>
    </tmpl:templates>
    </xsl:template>
    ````

    It seems like you said you tried that already, but maybe give it another
    check?

    Winslow

    On Tue, Oct 25, 2016 at 6:19 AM, Erik Rask <erik.rask@proceranetworks.com>
    wrote:

    > Hello,
    > I thought I'd start looking at migrating to XSLT 2 support, to get access
    > to a few xpath features that would help in source code integrated
    > documentation projects.
    >
    > My XSLT 1.0 toolchain consists of xsltproc and commandline FOP, for XSLT2
    > I'm currently trying Saxon from http://cdn.docbook.org/
    > release/2.0.20/docbook-xslt2-2.0.20-jar.zip
    >
    > I'm having trouble finding my way around titlepage customizations (print,
    > in this case). In the old toolchain I had titlepage XML spec files that I
    > processed with the titlepage XSL in docbook into titlepage XSL that I
    > imported into my customization layer.
    >
    > In the 2.0 stylesheets I haven't found how to do this. I can edit
    > xslt/base/fo/titlepage-templates.xsl and see end results, but overlaying
    > the templates from it in my customization layer doesn't seem to have any
    > effect. Does anyone have any guidance?
    >
    > --
    > Erik Rask
    > Technical communication coordinator
    >
    > Procera Networks
    > Birger Svenssons väg 28D
    > 43240 Varberg, Sweden
    > t: +46 340 483800
    > www.proceranetworks.com
    >
    > m: +46 725 562 965
    > e: erik.rask@proceranetworks.com
    > skype: procerik
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >



  • 3.  Re: [docbook-apps] Titlepage customizations for DocBook with XSLT2

    Posted 11-09-2016 08:46
    Robert,
    Thanks for replying. Yes, you're right. It seems I had sloppy habits left from the XSLT 1 stylesheets.

    For those in the same spot, I had e.g. <xsl:template name="book.titlepage.recto"> in the old, and within that, to lay out the title, I had <xsl:apply-templates mode="book.titlepage.recto.mode" select="bookinfo/title"/>

    Now I'm still working the formalities, but in the XSLT 2 work I've changed the former to
    <xsl:template match="db:book" mode="m:get-titlepage-templates" as="element(tmpl:templates)"> with initial namespace declarations for m and tmpl, and the latter is now <xsl:apply-templates mode="m:titlepage-recto-mode" select="db:info/db:title"/> (note how both mode and select statements are namespaced, and the mode name is different).

    BR
    Erik Rask
    ________________________________________
    From: Robert Winslow Dalpe <rwdalpe@gmail.com>
    Sent: Saturday, November 5, 2016 2:35:18 AM
    To: Erik Rask
    Cc: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] Titlepage customizations for DocBook with XSLT2

    Erik,

    I can't speak to the XSL-FO templates exactly, but for the HTML templates it was sufficient for me to just put the relevant templates as shown in titlepage-templates.xsl into my customization layer. E.g. the following

    ````
    <xsl:template match="db:book" mode="m:get-titlepage-templates" as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:recto>
    <db:cover role="front-cover"/>

    <db:title-group />
    <xsl:if test="/db:book/db:info/db:volumenum">
    Book <db:volumenum /> of <db:seriesvolnums />

    </xsl:if>
    <db:corpauthor />
    <db:authorgroup />
    <db:author />
    <db:editor />
    <db:othercredit />

    <db:releaseinfo />
    <db:copyright />
    <db:legalnotice />
    <db:pubdate />
    <db:printhistory />
    <db:revision />
    <db:revhistory />

    <db:abstract />



    </tmpl:recto>
    </tmpl:templates>
    </xsl:template>

    <xsl:template match="db:warning" mode="m:get-titlepage-templates" as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:titlepage>

    <db:title/>

    </tmpl:titlepage>
    </tmpl:templates>
    </xsl:template>

    <xsl:template match="db:tip" mode="m:get-titlepage-templates" as="element(tmpl:templates)">
    <tmpl:templates>
    <tmpl:titlepage>

    <db:title/>

    </tmpl:titlepage>
    </tmpl:templates>
    </xsl:template>
    ````

    It seems like you said you tried that already, but maybe give it another check?

    Winslow

    On Tue, Oct 25, 2016 at 6:19 AM, Erik Rask <erik.rask@proceranetworks.com<mailto:erik.rask@proceranetworks.com>> wrote:
    Hello,
    I thought I'd start looking at migrating to XSLT 2 support, to get access to a few xpath features that would help in source code integrated documentation projects.

    My XSLT 1.0 toolchain consists of xsltproc and commandline FOP, for XSLT2 I'm currently trying Saxon from http://cdn.docbook.org/release/2.0.20/docbook-xslt2-2.0.20-jar.zip

    I'm having trouble finding my way around titlepage customizations (print, in this case). In the old toolchain I had titlepage XML spec files that I processed with the titlepage XSL in docbook into titlepage XSL that I imported into my customization layer.

    In the 2.0 stylesheets I haven't found how to do this. I can edit xslt/base/fo/titlepage-templates.xsl and see end results, but overlaying the templates from it in my customization layer doesn't seem to have any effect. Does anyone have any guidance?

    --
    Erik Rask
    Technical communication coordinator

    Procera Networks
    Birger Svenssons väg 28D
    43240 Varberg, Sweden
    t: +46 340 483800<tel:%2B46%20340%20483800>
    www.proceranetworks.com<http://www.proceranetworks.com>

    m: +46 725 562 965<tel:%2B46%20725%20562%20965>
    e: erik.rask@proceranetworks.com<mailto:erik.rask@proceranetworks.com>
    skype: procerik


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org<mailto:docbook-apps-unsubscribe@lists.oasis-open.org>
    For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org<mailto:docbook-apps-help@lists.oasis-open.org>