W3C home > Mailing lists > Public > spec-prod@w3.org > April to June 2003

Graphic captions, numbering, linking

From: Philippe Le Hegaret <plh@w3.org>
Date: 19 Jun 2003 14:51:19 -0400
To: spec-prod@w3.org
Message-Id: <1056048678.5851.79.camel@jfouffa.w3.org>

The WSD WG is using a modified (*sic*) version of the xmlspec.xsl, so I
cannot do an easy synchronization. Anyway, 2 things that editors like to
have are, I think, worth the consideration for xmlspec.xsl:
- Graphic captions
- numbering of tables, graphics, and examples.
- Links to tables, graphics, and examples.

1- Graphic captions:
 2 solutions are possible:
 - Add a child element caption to the graphic element (but it is
unnecessary imho).
 - WSD is now using the alt attribute for the caption:
      <p style='text-align:left'>
        <i><span><xsl:text>Figure </xsl:text>
        <xsl:apply-templates select="." mode="divnum"/>
        <xsl:text>. </xsl:text></span>
        <xsl:value-of select="@alt"/></i>

For an example, see

2- numbering of tables, graphics, and examples.
 I adopted the O'Reilly style to have numbers on the graphics, examples,
and tables:
  <xsl:template mode="divnum" match="graphic">
    <xsl:number level="multiple" count="div1" format="1"/>
    <xsl:number level="any" from='div1' count="graphic" format="1"/>
  <xsl:template mode="divnum" match="back//graphic">
    <xsl:number level="multiple" count="div1 | inform-div1" format="A"/>
    <xsl:number level="any" from='div1 | inform-div1' count="graphic"

  (ditto for table and example)

3. Links to tables, graphics, and examples use the same approach:

      <xsl:when test="local-name($target) = 'graphic'">
          <xsl:attribute name="href">
            <xsl:call-template name="href.target">
              <xsl:with-param name="target" select="id(@ref)"/>
          <xsl:text>Figure </xsl:text>
          <xsl:apply-templates select="id(@ref)" mode="divnum"/>

At the same time, I also changed the captions handling for examples and
tables to match O'Reilly style: the caption appears before, in italic,
in a normal font-size, and aligned to the left. For graphic, the caption
appears after the image.

Received on Thursday, 19 June 2003 14:51:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:42:17 UTC