docbook-apps

  • 1.  Re: [docbook-apps] customizing autoidx.xsl

    Posted 01-24-2007 18:52
    Hi Scott,
    Sorry, I misread the templates. You need to also customize the
    match="index" template in index.xsl. That's where the extra divs are
    coming from.

    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net


    ----- Original Message -----
    From: "Scott Hudson" <scottys.log@gmail.com>
    To: "Bob Stayton" <bobs@sagehill.net>
    Cc: "Scott Hudson" <scott.hudson@flatironssolutions.com>; "Docbook-Apps"
    <docbook-apps@lists.oasis-open.org>
    Sent: Wednesday, January 24, 2007 9:39 AM
    Subject: Re: [docbook-apps] customizing autoidx.xsl


    > Yes, I'm using 1.71.1 and using the basic (default) method. I've
    > customized the template for generate-basic-index, but still getting the
    > wrapper divs. Here's my customization:
    >
    > <xsl:template name="generate-basic-index">
    > <xsl:param name="scope" select="NOTANODE"/>
    >
    > <xsl:variable name="role">
    > <xsl:if test="$index.on.role != 0">
    > <xsl:value-of select="@role"/>
    > </xsl:if>
    > </xsl:variable>
    >
    > <xsl:variable name="type">
    > <xsl:if test="$index.on.type != 0">
    > <xsl:value-of select="@type"/>
    > </xsl:if>
    > </xsl:variable>
    >
    > <xsl:variable name="terms"
    > select="//indexterm
    > [count(.|key('letter',
    > translate(substring(&primary;, 1, 1),
    > &lowercase;,
    > &uppercase;))
    > [&scope;][1]) = 1
    > and not(@class = 'endofrange')]"/>
    >
    > <xsl:variable name="alphabetical"
    > select="$terms[contains(concat(&lowercase;, &uppercase;),
    > substring(&primary;, 1, 1))]"/>
    >
    > <xsl:variable name="others"
    > select="$terms[not(contains(concat(&lowercase;,
    > &uppercase;),
    > substring(&primary;, 1,
    > 1)))]"/>
    > <index>
    > <xsl:if test="$others">
    > <indexdiv>
    >
    > <indexentry>
    > <xsl:apply-templates select="$others[count(.|key('primary',
    > &primary;)[&scope;][1]) = 1]"
    > mode="index-symbol-div">
    > <xsl:with-param name="position" select="position()"/>
    >
    > <xsl:with-param name="scope" select="$scope"/>
    > <xsl:with-param name="role" select="$role"/>
    > <xsl:with-param name="type" select="$type"/>
    > <xsl:sort select="translate(&primary;, &lowercase;,
    > &uppercase;)"/>
    > </xsl:apply-templates>
    > </indexentry>
    > </indexdiv>
    > </xsl:if>
    >
    > <xsl:apply-templates select="$alphabetical[count(.|key('letter',
    > translate(substring(&primary;, 1, 1),
    >
    > &lowercase;,&uppercase;))[&scope;][1]) = 1]"
    > mode="index-div-basic">
    > <xsl:with-param name="position" select="position()"/>
    > <xsl:with-param name="scope" select="$scope"/>
    > <xsl:with-param name="role" select="$role"/>
    > <xsl:with-param name="type" select="$type"/>
    > <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
    > </xsl:apply-templates>
    > </index>
    > </xsl:template>
    >
    > On output, I still get:
    >

    >

    >

    >

    >

     Index
    >


    >

    >

    >

    > <index>
    > ...
    >
    > Best regards,
    >
    > --Scott
    >
    > Bob Stayton wrote:
    >> Hi Scott,
    >> If you are using 1.71.1 or later, it depends on which $index.method you
    >> are using:
    >>
    >> $index.method = 'basic', customize 'generate-basic-index' in
    >> autoidx.xsl.
    >>
    >> $index.method = 'kosek', customize 'generate-kosek-index' in
    >> autoidx-kosek.xsl
    >>
    >> $index.method = 'kimber', customize 'generate-kimber-index' in
    >> autoidx-kimber.xsl
    >>
    >>
    >> Bob Stayton
    >> Sagehill Enterprises
    >> DocBook Consulting
    >> bobs@sagehill.net
    >>
    >>
    >> ----- Original Message ----- From: "Scott Hudson"
    >> <scott.hudson@flatironssolutions.com>
    >> To: "Docbook-Apps" <docbook-apps@lists.oasis-open.org>
    >> Sent: Wednesday, January 24, 2007 8:29 AM
    >> Subject: [docbook-apps] customizing autoidx.xsl
    >>
    >>
    >>> Hi,
    >>>
    >>> I've needed to generate an index with docbook markup, and have so
    >>> modified autoidx.xsl to generate docbook elements, rather than the HTML
    >>> output. I'm also chunking this out as a separate file.
    >>>
    >>> For some reason, it is still getting wrapped with some type of
    >>> titlepage
    >>> div:
    >>>
    >>>

    >>>

    >>>

    >>>

    >>>

     Index
    >>>


    >>>

    >>>

    >>>

    >>> <index>
    >>> <indexdiv>
    >>>
    >>> <indexentry>
    >>> <primary>
    >>> ...
    >>>
    >>> Is there a parameter to turn this off, or what template do I need to
    >>> override to eliminate these div outer wrappers?
    >>>
    >>> Thanks,
    >>>
    >>> --Scott
    >>>
    >>
    >>
    >> --------------------------------------------------------------------------------
    >>
    >>
    >>
    >>> ---------------------------------------------------------------------
    >>> 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] customizing autoidx.xsl

    Posted 01-24-2007 19:13
      |   view attached
    I tried that as well, but when I override it, I lose the chunking.

    --Scott

    Bob Stayton wrote:
    > Hi Scott,
    > Sorry, I misread the templates. You need to also customize the
    > match="index" template in index.xsl. That's where the extra divs are
    > coming from.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > DocBook Consulting
    > bobs@sagehill.net
    >
    >
    > ----- Original Message ----- From: "Scott Hudson" <scottys.log@gmail.com>
    > To: "Bob Stayton" <bobs@sagehill.net>
    > Cc: "Scott Hudson" <scott.hudson@flatironssolutions.com>; "Docbook-Apps"
    > <docbook-apps@lists.oasis-open.org>
    > Sent: Wednesday, January 24, 2007 9:39 AM
    > Subject: Re: [docbook-apps] customizing autoidx.xsl
    >
    >
    >> Yes, I'm using 1.71.1 and using the basic (default) method. I've
    >> customized the template for generate-basic-index, but still getting the
    >> wrapper divs. Here's my customization:
    >>
    >> <xsl:template name="generate-basic-index">
    >> <xsl:param name="scope" select="NOTANODE"></xsl:param>
    >>
    >> <xsl:variable name="role">
    >> <xsl:if test="$index.on.role != 0">
    >> <xsl:value-of select="@role"></xsl:value-of>
    >> </xsl:if>
    >> </xsl:variable>
    >>
    >> <xsl:variable name="type">
    >> <xsl:if test="$index.on.type != 0">
    >> <xsl:value-of select="@type"></xsl:value-of>
    >> </xsl:if>
    >> </xsl:variable>
    >>
    >> <xsl:variable name="terms"></xsl:variable>
    >> select="//indexterm
    >> [count(.|key('letter',
    >> translate(substring(&primary;, 1, 1),
    >> &lowercase;,
    >> &uppercase;))
    >> [&scope;][1]) = 1
    >> and not(@class = 'endofrange')]"/>
    >>
    >> <xsl:variable name="alphabetical"></xsl:variable>
    >> select="$terms[contains(concat(&lowercase;, &uppercase;),
    >> substring(&primary;, 1, 1))]"/>
    >>
    >> <xsl:variable name="others"></xsl:variable>
    >> select="$terms[not(contains(concat(&lowercase;,
    >> &uppercase;),
    >> substring(&primary;, 1,
    >> 1)))]"/>
    >> <index>
    >> <xsl:if test="$others">
    >> <indexdiv>
    >>
    >> <indexentry>
    >> <xsl:apply-templates select="$others[count(.|key('primary',
    >> &primary;)[&scope;][1]) = 1]"></xsl:apply-templates>
    >> mode="index-symbol-div">
    >> <xsl:with-param name="position" select="position()"></xsl:with-param>
    >>
    >> <xsl:with-param name="scope" select="$scope"></xsl:with-param>
    >> <xsl:with-param name="role" select="$role"></xsl:with-param>
    >> <xsl:with-param name="type" select="$type"></xsl:with-param>
    >> <xsl:sort select="translate(&primary;, &lowercase;,
    >> &uppercase;)"></xsl:sort>
    >>
    >> </indexentry>
    >> </indexdiv>
    >> </xsl:if>
    >>
    >> <xsl:apply-templates select="$alphabetical[count(.|key('letter',
    >> translate(substring(&primary;, 1, 1),
    >>
    >> &lowercase;,&uppercase;))[&scope;][1]) = 1]"></xsl:apply-templates>
    >> mode="index-div-basic">
    >> <xsl:with-param name="position" select="position()"></xsl:with-param>
    >> <xsl:with-param name="scope" select="$scope"></xsl:with-param>
    >> <xsl:with-param name="role" select="$role"></xsl:with-param>
    >> <xsl:with-param name="type" select="$type"></xsl:with-param>
    >> <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"></xsl:sort>
    >>
    >> </index>
    >> </xsl:template>
    >>
    >> On output, I still get:
    >>

    >>

    >>

    >>

    >>

     Index
    >>


    >>

    >>

    >>

    >> <index>
    >> ...
    >>
    >> Best regards,
    >>
    >> --Scott
    >>
    >> Bob Stayton wrote:
    >>> Hi Scott,
    >>> If you are using 1.71.1 or later, it depends on which $index.method you
    >>> are using:
    >>>
    >>> $index.method = 'basic', customize 'generate-basic-index' in
    >>> autoidx.xsl.
    >>>
    >>> $index.method = 'kosek', customize 'generate-kosek-index' in
    >>> autoidx-kosek.xsl
    >>>
    >>> $index.method = 'kimber', customize 'generate-kimber-index' in
    >>> autoidx-kimber.xsl
    >>>
    >>>
    >>> Bob Stayton
    >>> Sagehill Enterprises
    >>> DocBook Consulting
    >>> bobs@sagehill.net
    >>>
    >>>
    >>> ----- Original Message ----- From: "Scott Hudson"
    >>> <scott.hudson@flatironssolutions.com>
    >>> To: "Docbook-Apps" <docbook-apps@lists.oasis-open.org>
    >>> Sent: Wednesday, January 24, 2007 8:29 AM
    >>> Subject: [docbook-apps] customizing autoidx.xsl
    >>>
    >>>
    >>>> Hi,
    >>>>
    >>>> I've needed to generate an index with docbook markup, and have so
    >>>> modified autoidx.xsl to generate docbook elements, rather than the HTML
    >>>> output. I'm also chunking this out as a separate file.
    >>>>
    >>>> For some reason, it is still getting wrapped with some type of
    >>>> titlepage
    >>>> div:
    >>>>
    >>>>

    >>>>

    >>>>

    >>>>

    >>>>

     Index
    >>>>


    >>>>

    >>>>

    >>>>

    >>>> <index>
    >>>> <indexdiv>
    >>>>
    >>>> <indexentry>
    >>>> <primary>
    >>>> ...
    >>>>
    >>>> Is there a parameter to turn this off, or what template do I need to
    >>>> override to eliminate these div outer wrappers?
    >>>>
    >>>> Thanks,
    >>>>
    >>>> --Scott
    >>>>
    >>>
    >>>
    >>> --------------------------------------------------------------------------------
    >>>
    >>>
    >>>
    >>>
    >>>> ---------------------------------------------------------------------
    >>>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    >>>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >>>
    >>>
    >>>
    >>
    >>
    >
    >
    >


    </primary></indexentry></indexdiv></index>
    </docbook-apps@lists.oasis-open.org></scott.hudson@flatironssolutions.com></index>
    </docbook-apps@lists.oasis-open.org></scott.hudson@flatironssolutions.com></bobs@sagehill.net></scottys.log@gmail.com>

    Attachment(s)

    vcf
    scott.hudson.vcf   320 B 1 version