docbook-apps

Expand all | Collapse all

Re: [docbook-apps] chunking customization interfering with toc generation

  • 1.  Re: [docbook-apps] chunking customization interfering with toc generation

    Posted 06-03-2010 17:20
    Hi,
    It is hard to tell where it is going wrong without seeing more details of your
    customization of filename assignment. I can tell you how links are formed, though.
    Take a look at the template named 'href.target.uri' in html/chunk-common.xsl. It
    first determines if the element being targeted is a chunk. Then it applies the
    mode="chunk-filename" template to generate the filename reference for the element.
    Then if it is not a chunk, it adds "#" and the id of the element.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Tim Arnold" <Tim.Arnold@sas.com>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Wednesday, June 02, 2010 12:18 PM
    Subject: [docbook-apps] chunking customization interfering with toc generation


    hi,
    I'm using xsltproc, DocBook 5, and the XSL-NS1.75.1 stylesheets.
    I have customized chunking to give a filename matching this pattern:
    booklabel_chapterlabel_sect00nn.htm
    where the 'sect00nn' represents the section number.

    My problem is that even though the generated filenames are correct, the auto-generated
    tocs are wrong. Well, not all wrong, just the tocs that reference a section that does
    *not* have its own file.

    For example, in my 2nd-level section (book_chapter_sect002.htm) there is a toc that
    lists the 3rd level sections contained in the current file. the toc contains links
    that point to:
    book_chapter_sect003.htm
    book_chapter_sect004.htm

    The problem is that those files don't exist since the content is inside the 2nd level
    section.

    My relevant parameter settings:
    <xsl:param name="chunk.first.sections" select="1"></xsl:param>
    <xsl:param name="chunk.section.depth" select="2"></xsl:param>
    <xsl:param name="toc.section.depth">2</xsl:param>
    <xsl:param name="generate.section.toc.level" select="2"></xsl:param>
    <xsl:param name="toc.max.depth">1</xsl:param>

    I've read and re-read the DocBook XSL guide on chunking, googled, etc. My guess is
    that the part of chunking.xsl that returns the filename is getting called when it
    should not.

    Has anyone seen something like this and can point me to the places I need to
    investigate?
    thanks,
    --Tim


    ---------------------------------------------------------------------
    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] chunking customization interfering with toc generation

    Posted 06-04-2010 20:22
    Hi Bob,
    Thanks for the pointers--it helped. It turned out that I had put my file-naming code (matching on d:section) *before* the test for $ischunk='0'. Looking back on it, that's a pretty dumb mistake.

    thanks for helping me locate what was going wrong.

    --Tim Arnold


    > -----Original Message-----
    > From: Bob Stayton [mailto:bobs@sagehill.net]
    > Sent: Thursday, June 03, 2010 1:20 PM
    > To: Tim Arnold; docbook-apps@lists.oasis-open.org
    > Subject: Re: [docbook-apps] chunking customization interfering with toc
    > generation
    >
    > Hi,
    > It is hard to tell where it is going wrong without seeing more details of
    > your
    > customization of filename assignment. I can tell you how links are formed,
    > though.
    > Take a look at the template named 'href.target.uri' in html/chunk-
    > common.xsl. It
    > first determines if the element being targeted is a chunk. Then it applies
    > the
    > mode="chunk-filename" template to generate the filename reference for the
    > element.
    > Then if it is not a chunk, it adds "#" and the id of the element.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net
    >
    >
    > ----- Original Message -----
    > From: "Tim Arnold" <Tim.Arnold@sas.com>
    > To: <docbook-apps@lists.oasis-open.org>
    > Sent: Wednesday, June 02, 2010 12:18 PM
    > Subject: [docbook-apps] chunking customization interfering with toc
    > generation
    >
    >
    > hi,
    > I'm using xsltproc, DocBook 5, and the XSL-NS1.75.1 stylesheets.
    > I have customized chunking to give a filename matching this pattern:
    > booklabel_chapterlabel_sect00nn.htm
    > where the 'sect00nn' represents the section number.
    >
    > My problem is that even though the generated filenames are correct, the
    > auto-generated
    > tocs are wrong. Well, not all wrong, just the tocs that reference a section
    > that does
    > *not* have its own file.
    >
    > For example, in my 2nd-level section (book_chapter_sect002.htm) there is a
    > toc that
    > lists the 3rd level sections contained in the current file. the toc contains
    > links
    > that point to:
    > book_chapter_sect003.htm
    > book_chapter_sect004.htm
    >
    > The problem is that those files don't exist since the content is inside the
    > 2nd level
    > section.
    >
    > My relevant parameter settings:
    > <xsl:param name="chunk.first.sections" select="1"></xsl:param>
    > <xsl:param name="chunk.section.depth" select="2"></xsl:param>
    > <xsl:param name="toc.section.depth">2</xsl:param>
    > <xsl:param name="generate.section.toc.level" select="2"></xsl:param>
    > <xsl:param name="toc.max.depth">1</xsl:param>
    >
    > I've read and re-read the DocBook XSL guide on chunking, googled, etc. My
    > guess is
    > that the part of chunking.xsl that returns the filename is getting called
    > when it
    > should not.
    >
    > Has anyone seen something like this and can point me to the places I need to
    > investigate?
    > thanks,
    > --Tim
    >
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >