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: Why put a section's anchor in its title?


Fundamentally, I want (and have wanted for some time) to exorcise the
<a name="source_id_val.or.generated"/> gremlins from the (x)html output
in the stylesheets.  (Incidentally, this post is motivated by the recent
thread regarding the redesign of the xhtml output mode.  It is somewhat
tangential, but I would appreciate it if my requests would be considered
by that design committee.)  It is my opinion that any future xhtml
output mode should use (or allow the use of, as an option) id attributes
on the container that most closely maps to the source (DocBook)
container as an xhtml "anchor".

To that end, I've started on some minor DocBook-XSL cosmetic surgery.
First, I replaced the old "anchor" template with the following (as
always, props to Norm and co. for the modular design here):

  <xsl:template name="anchor">
    <xsl:param name="node" select="."/>
    <xsl:param name="conditional" select="1"/>
    <xsl:variable name="id">
      <xsl:call-template name="object.id">
        <xsl:with-param name="object" select="$node"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id">
      <xsl:attribute name="id">
        <xsl:value-of select="$id"/>
      </xsl:attribute>
    </xsl:if>
  </xsl:template>

That's a step, but a bit of testing quickly shows it to be insufficient.
The first speedbump is the fact that the anchors for sections get
attached not to the div container corresponding to that section, but to
the *title* container for that section.  My question at this point is
simple - why?  I simply do not understand the design decision here.
I wanted to know what I might be breaking by ripping this out, and I
wanted to know if there might be any interest in pushing this work back
upstream once completed.

Take care,

    John L. Clark

PGP signature



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