[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] customizing autoidx.xsl
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> > <title><xsl:call-template name="gentext"> > <xsl:with-param name="key" select="'index symbols'"/> > </xsl:call-template> > </title> > <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: > <div class="index"> > <div class="titlepage"> > <div> > <div> > <h2 class="title"><a name="d0e6044"> </a>Index > </h2> > </div> > </div> > </div> > <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: >>> >>> <div class="index"> >>> <div class="titlepage"> >>> <div> >>> <div> >>> <h2 class="title"><a name="d0e6044"> </a>Index >>> </h2> >>> </div> >>> </div> >>> </div> >>> <index> >>> <indexdiv> >>> <title>B</title> >>> <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 >> >> >> > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]