Next / Previous / Contents / NM Tech homepage

7.3.5. The zdp.colophon template

The colophon section contains:

  1. A horizontal rule to separate it from the page-bottom links.

  2. An HTML address element containing lines for each author, and a mailto: link for reader feedback.

  3. A “Last updated” timestamp.

  4. The document's URL.

The template takes one parameter, home, the article node. It needs that to generate the “Contents” link.

<!--zdp.colophon: Colophon at the bottom of the page-->
<xsl:template name="zdp.colophon">
  <xsl:param name="home"/>

First comes the horizontal rule, then the start of a div element with class="colophon" so we can write CSS rules for this section, then the start of the address element.

  <div class="colophon">

To generate all the author names, we call a separate template; see Section 7.3.6, “The author.colophon.mode template”.

      <!--Generate all author names-->
      <xsl:apply-templates select="$home/articleinfo/authorgroup"

The mailto: link forwards mail to, which is the mailing alias for the TCC Documentation Group. This ends the HTML address element.

      <!--mailto: link for reader feedback-->
      <div class="colophon-mailto">
        <xsl:text>Comments welcome: </xsl:text>
        <a href="mailto:${}">
          <xsl:value-of select="$" />

The “Last updated” line is wrapped in a div to put it on a separate line. The datetime.format template is located in common/pi.xsl. It uses the EXSLT extension module; see the online documentation for dates-and-times.

    <!--Revision timestamp-->
    <div class="colophon-date">
      <xsl:text>Last updated: </xsl:text>
      <xsl:call-template name="datetime.format">
        <xsl:with-param name="date" select="date:date-time()"/>
        <xsl:with-param name="format" select="'Y-m-d H:M'"/>

We use Server Side Includes to generate the page's own URL; see Using HTML Server Side Includes (SSI). SSI commands are syntactically represented as comments whose first character is "#". The echo command causes insertion of some variable's value into the web page, and the DOCUMENT_URI variable is always the URL of the web page itself.

    <!--Show current URL using Server Side Includes-->
    <div class="colophon-url">
      <xsl:text>URL: </xsl:text>
      <span class="colophon-uri">
        <xsl:comment>#echo var="HTTP_HOST"</xsl:comment>
        <xsl:comment>#echo var="DOCUMENT_URI"</xsl:comment>