docbook-apps

  • 1.  Re: [docbook-apps] TOC position in the document

    Posted 08-18-2010 22:42
    Hi,
    You can try this xpath:

    <xsl:apply-templates select="node()[not(self::sect1[@id = 'first'])]"/>

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Fabien Tillier" <f.tillier@cerep.fr>
    To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org>
    Sent: Tuesday, August 17, 2010 5:11 AM
    Subject: RE: [docbook-apps] TOC position in the document


    Hi (again) Bob.
    Well, after some experiments, I came up with an almost working solution.

    I copied the template for article (d:article in my case), and inserted a selection
    before the call to the TOC template (starting at <xsl:variable name="toc.params">)

    <xsl:apply-templates select="d:sect1[@id='first']"/>

    Which allows me to only call the generation template on the item I whish.
    Then the TOC, and after that, I want to call templates again, but this time without
    calling the first one.
    And here, I am stuck....

    <xsl:apply-templates select="d:sect1[@id!='first']"/>

    Doesn't work because all my nodes are not sect1 nodes... (I believe at least it's the
    reason)
    So, can someone help me with an xpath that will select everything except the node
    sect1 with attribute id='first' and its children ?

    Thanks a lot in advance
    Best regards,
    Fabien



    -----Message d'origine-----
    De : Bob Stayton [mailto:bobs@sagehill.net]
    Envoyé : lundi 16 août 2010 21:04
    À : Fabien Tillier; docbook-apps@lists.oasis-open.org
    Objet : Re: [docbook-apps] TOC position in the document

    Hi,
    To change the order in a book, you would need to customize the template in
    fo/division.xsl in the DocBook stylesheets that starts with:

    <xsl:template match="book">

    This is the line in that template that generates the TOC:

    <xsl:call-template name="make.book.tocs"/>

    So put code to process your special content before that.

    You will also need to modify the definition of the xsl:variable named "content" to
    exclude your special content, otherwise it will be repeated when that variable is
    output after the TOC.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Fabien Tillier" <f.tillier@cerep.fr>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Monday, August 16, 2010 7:18 AM
    Subject: [docbook-apps] TOC position in the document


    Hi List.
    I would like to set the position in the document where the TOC should be
    displayed. I got several sections, and my which would be to set it to
    appear after a certain section. Is there a way I can achieve this using
    Docbook (v5, the output being PDF with FOP, but should not matter) ?

    Thanks a lot in advance
    Regards,
    Fabien



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








  • 2.  RE: [docbook-apps] TOC position in the document

    Posted 08-19-2010 11:37
    Hi bob.
    Just one word:
    Perfect !

    Thanks a million
    Regards,
    Fabien


    -----Message d'origine-----
    De : Bob Stayton [mailto:bobs@sagehill.net]
    Envoyé : jeudi 19 août 2010 00:42
    À : Fabien Tillier; docbook-apps@lists.oasis-open.org
    Objet : Re: [docbook-apps] TOC position in the document

    Hi,
    You can try this xpath:

    <xsl:apply-templates select="node()[not(self::sect1[@id = 'first'])]"/>

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Fabien Tillier" <f.tillier@cerep.fr>
    To: "Bob Stayton" <bobs@sagehill.net>; <docbook-apps@lists.oasis-open.org>
    Sent: Tuesday, August 17, 2010 5:11 AM
    Subject: RE: [docbook-apps] TOC position in the document


    Hi (again) Bob.
    Well, after some experiments, I came up with an almost working solution.

    I copied the template for article (d:article in my case), and inserted a selection
    before the call to the TOC template (starting at <xsl:variable name="toc.params">)

    <xsl:apply-templates select="d:sect1[@id='first']"/>

    Which allows me to only call the generation template on the item I whish.
    Then the TOC, and after that, I want to call templates again, but this time without
    calling the first one.
    And here, I am stuck....

    <xsl:apply-templates select="d:sect1[@id!='first']"/>

    Doesn't work because all my nodes are not sect1 nodes... (I believe at least it's the
    reason)
    So, can someone help me with an xpath that will select everything except the node
    sect1 with attribute id='first' and its children ?

    Thanks a lot in advance
    Best regards,
    Fabien



    -----Message d'origine-----
    De : Bob Stayton [mailto:bobs@sagehill.net]
    Envoyé : lundi 16 août 2010 21:04
    À : Fabien Tillier; docbook-apps@lists.oasis-open.org
    Objet : Re: [docbook-apps] TOC position in the document

    Hi,
    To change the order in a book, you would need to customize the template in
    fo/division.xsl in the DocBook stylesheets that starts with:

    <xsl:template match="book">

    This is the line in that template that generates the TOC:

    <xsl:call-template name="make.book.tocs"/>

    So put code to process your special content before that.

    You will also need to modify the definition of the xsl:variable named "content" to
    exclude your special content, otherwise it will be repeated when that variable is
    output after the TOC.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Fabien Tillier" <f.tillier@cerep.fr>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Monday, August 16, 2010 7:18 AM
    Subject: [docbook-apps] TOC position in the document


    Hi List.
    I would like to set the position in the document where the TOC should be
    displayed. I got several sections, and my which would be to set it to
    appear after a certain section. Is there a way I can achieve this using
    Docbook (v5, the output being PDF with FOP, but should not matter) ?

    Thanks a lot in advance
    Regards,
    Fabien



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