docbook-apps

  • 1.  Re: [docbook-apps] xmpp.xsl file?

    Posted 10-09-2013 09:43
    On 9.10.2013 11:29, Jen wrote:
    > I can guess what the file is trying to do, but I was hoping there's some
    > known distribution of stylesheets than contains this file and the name
    > might ring a bell to someone... :)
    >
    > Either way, good point, I'm attaching it, maybe it helps.

    From this:


    <xsl:import href="docbook.xsl"/>
    <xsl:include href="inline.xsl" />
    <xsl:include href="component.xsl" />
    <xsl:include href="titlepage.xsl"/>

    it seems that file uses quite unusual approach to customization. Usually
    just docbook.xsl is imported as it itself imports
    inline.xsl/component.xsl/titlepage.xsl stylesheets that are part of
    standard stylesheets.

    You can try to comment out these three includes and see if customization
    still works.

    Then I suggest move xmpp.xsl into separate folder from standard XSL
    stylesheets distribition and modify path to fo/docbook.xsl accordingly.
    Otherwise you risk you will overwrite this file when upgrading to recent
    version of stylesheets.

    Depending on whether you are using DocBook V4.5 or V5.0. You might
    consider switching to namespace version of stylesheets (for V5.0).

    If this is the case then you will be able to rely solely on stylesheets
    distributed as a part of oXygen, just use the following import:

    <xsl:import
    href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl"/>

    oXygen will redirect this to a local copy of stylesheets. You will have
    to tweak few things in xmpp.xsl then, for example change


    <xsl:when test="self::chapter | self::preface |
    self::appendix">bold</xsl:when>

    to

    <xsl:when test="self::d:chapter | self::d:preface |
    self::d:appendix">bold</xsl:when>

    and add xmlns:d="http://docbook.org/ns/docbook" to xsl:stylesheet element.

    Regarding customization I suggest read the following:

    http://www.sagehill.net/docbookxsl/CustomMethods.html

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------




  • 2.  Re: [docbook-apps] xmpp.xsl file?

    Posted 10-09-2013 10:46
    (Oops, just realized that I hadn't replied to all!)

    Thanks for the clarifications and the quick replies.

    The inline.xsl,component.xsl and titlepage.xsl that are being imported are
    (very) different versions of the standard files. I *am* planning use
    DocBook 5 and the namespace version of the stylesheets, so your tips are
    very useful. I'll try to adapt all the custom stylesheets we have right now
    and see if the transformation still works... fingers crossed.


    On Wed, Oct 9, 2013 at 12:43 PM, Jirka Kosek <jirka@kosek.cz> wrote:

    > On 9.10.2013 11:29, Jen wrote:
    > > I can guess what the file is trying to do, but I was hoping there's some
    > > known distribution of stylesheets than contains this file and the name
    > > might ring a bell to someone... :)
    > >
    > > Either way, good point, I'm attaching it, maybe it helps.
    >
    > From this:
    >
    >
    > <xsl:import href="docbook.xsl"/>
    > <xsl:include href="inline.xsl" />
    > <xsl:include href="component.xsl" />
    > <xsl:include href="titlepage.xsl"/>
    >
    > it seems that file uses quite unusual approach to customization. Usually
    > just docbook.xsl is imported as it itself imports
    > inline.xsl/component.xsl/titlepage.xsl stylesheets that are part of
    > standard stylesheets.
    >
    > You can try to comment out these three includes and see if customization
    > still works.
    >
    > Then I suggest move xmpp.xsl into separate folder from standard XSL
    > stylesheets distribition and modify path to fo/docbook.xsl accordingly.
    > Otherwise you risk you will overwrite this file when upgrading to recent
    > version of stylesheets.
    >
    > Depending on whether you are using DocBook V4.5 or V5.0. You might
    > consider switching to namespace version of stylesheets (for V5.0).
    >
    > If this is the case then you will be able to rely solely on stylesheets
    > distributed as a part of oXygen, just use the following import:
    >
    > <xsl:import
    > href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl
    > "/>
    >
    > oXygen will redirect this to a local copy of stylesheets. You will have
    > to tweak few things in xmpp.xsl then, for example change
    >
    >
    > <xsl:when test="self::chapter | self::preface |
    > self::appendix">bold</xsl:when>
    >
    > to
    >
    > <xsl:when test="self::d:chapter | self::d:preface |
    > self::d:appendix">bold</xsl:when>
    >
    > and add xmlns:d="http://docbook.org/ns/docbook" to xsl:stylesheet element.
    >
    > Regarding customization I suggest read the following:
    >
    > http://www.sagehill.net/docbookxsl/CustomMethods.html
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    > ------------------------------------------------------------------
    > Bringing you XML Prague conference http://xmlprague.cz
    > ------------------------------------------------------------------
    >
    >



  • 3.  Re: [docbook-apps] xmpp.xsl file?

    Posted 10-09-2013 11:11
    Hi Jen,

    On Wed, 9 Oct 2013 13:45:55 +0300
    Jen <jennee@gmail.com> wrote:
    >
    > Thanks for the clarifications and the quick replies.
    >
    > The inline.xsl,component.xsl and titlepage.xsl that are being
    > imported are (very) different versions of the standard files. I *am*
    > planning use DocBook 5 and the namespace version of the stylesheets,
    > so your tips are very useful. I'll try to adapt all the custom
    > stylesheets we have right now and see if the transformation still
    > works... fingers crossed.

    If you need some inspirations or ideas about how to write customization
    layers, you may find this information probably helpful:

    http://doccookbook.sf.net/html/en/dbc.common.dbcustomize.html
    http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer

    Good luck!


    --
    Gruß/Regards,
    Thomas Schraitle