OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: indexterm and generated ids



Hello,

I'm trying to get rid of generated ids in XHTML output.  The
primary reason was Gnome bug

  http://bugzilla.gnome.org/show_bug.cgi?id=365913

and the fact that ids generated by xsltproc are not stable
(they are based on memory addresses or something like that).

But things got weird with <indexterm>s.  Originally
non-zoned <indexterm>s were used:

    ...
    <section id="never">
      <indexterm><primary>Never</primary></indexterm>
      <title>Never</title>
      <para id="never-1">Never, forget it.</para>
    </section>
    ...

then in index generated with <index> I got

    <dt>Never, <a class="indexterm" href="#never">Never</a></dt>

which links to #never as I would like.  However, the XHTML
also contains a stray, never referenced anchor with a
generated id:

    <div class="section" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="never"></a>Never</h2>
          </div>
        </div>
      </div>
      <a id="id298057" class="indexterm"></a>
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What's this?
      <p><a id="never-1"></a>Never, forget it.</p>
    </div>

I thought it was some artefact of <indexterm>s based on
physical location.  So I changed them to zoned:

    <indexterm zone="never"><primary>Never</primary></indexterm>

This did not change anything.  While I can place the zoned
indexterm anywhere I wish in the source, something like

   <a id="id298057" class="indexterm"></a>

still gets generated to the primary flow in the place
corresponding to their physical location.

This seems to be caused by the following template

    <xsl:template match="indexterm">
      <!-- this one must have a name, even if it doesn't have an ID -->
      <xsl:variable name="id">
        <xsl:call-template name="object.id"/>
      </xsl:variable>

      <a id="{$id}" class="indexterm"/>
    </xsl:template>

I can override it, making singular zoned indexterms to
really disappear from the primary flow, but the question is
*why* they output anything by defaut, i.e. what can break if
I do this?

Yeti

--
http://gwyddion.net/


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]