<?xml version='1.0' encoding='utf-8'?> <!-- -*- nxml -*- -->

<!-- This file should be changed EVERY TIME a new draft is published! -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fm="http://freshmeat.net/projects/freshmeat-submit/"
		xmlns:sf="http://sourceforge.net/"
		exclude-result-prefixes="fm sf"
                version='1.0'>

<xsl:param name="freshmeat" select="0"/>

<xsl:param name="VERSION" select="string(document('')//fm:Version[1])"/>
<xsl:strip-space elements="fm:*"/>

<fm:project>
  <fm:Project>DocBook</fm:Project>
  <fm:Branch>The Definitive Guide</fm:Branch>
  <fm:Version>2.0.9</fm:Version>
  <fm:Release-Focus>
  <!-- Initial freshmeat announcement -->
  Documentation
  <!-- Code cleanup -->
  <!-- Minor feature enhancements -->
  <!-- Major feature enhancements -->
  <!-- Minor bugfixes -->
  <!-- Major bugfixes -->
  <!-- Minor security fixes -->
  <!-- Major security fixes -->
  </fm:Release-Focus>
  <fm:Home-Page-URL>http://docbook.org/tdg/en/</fm:Home-Page-URL>
  <fm:Zipped-Tar-URL>http://docbook.org/tdg/en/tdg-en-html-{VERSION}.zip</fm:Zipped-Tar-URL>
  <fm:Changelog-URL>http://docbook.org/tdg/en/html/appi.html</fm:Changelog-URL>
  <fm:CVS-URL>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/docbook/defguide/</fm:CVS-URL>
  <fm:Mailing-List-URL>http://lists.oasis-open.org/archives/docbook/</fm:Mailing-List-URL>
  <fm:Changes>Update for DocBook V4.3CR2. See ChangeLog for details.</fm:Changes>
</fm:project>

<xsl:template name="bookinfo">
  <bookinfo>
    <mediaobject role="online">
      <imageobject>
	<imagedata fileref="figures/cover.png" align="left"/>
      </imageobject>
    </mediaobject>
    <title>DocBook</title>
    <subtitle>The Definitive Guide</subtitle>
    <authorgroup>
      <author><firstname>Norman</firstname><surname>Walsh</surname></author>
      <author><firstname>Leonard</firstname><surname>Muellner</surname></author>
      <othercredit><firstname>Bob</firstname><surname>Stayton</surname></othercredit>
    </authorgroup>
    <editor><firstname>Frank</firstname><surname>Willison</surname></editor>
    <editor role="production"><firstname>David</firstname><surname>Futato</surname></editor>
    <publisher>
      <publishername>O'Reilly &amp; Associates, Inc.</publishername>
      <address><city>Beijing</city></address>
      <address><city>Cambridge</city></address>
      <address><city>Farnham</city></address>
      <address><city>Köln</city></address>
      <address><city>Paris</city></address>
      <address><city>Sebastopol</city></address>
      <address><city>Taipei</city></address>
      <address><city>Tokyo</city></address>
    </publisher>
    <printhistory>
      <para>October 1999: First Edition.</para>
    </printhistory>
    <isbn>156592-580-7</isbn>
    <releaseinfo>
      <xsl:value-of select="$VERSION"/>
    </releaseinfo>
    <pubdate>$Date$</pubdate>

    <legalnotice>
      <para condition="online">
	<citetitle>DocBook: The Definitive Guide</citetitle> Copyright
© 1999, 2000, 2001, 2002, 2003 O'Reilly &amp; Associates, Inc.</para>

<para>Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation.
A copy of the license is included in <xref linkend="gfdl"/>.</para>

<para>Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly
logo are registered trademarks of O'Reilly &amp; Associates, Inc. The
association between the image of a duck and the topic of DocBook is a
trademark of O'Reilly &amp; Associates, Inc. Java and all Java-based
trademarks and logos are trademarks or registered trademarks of Sun
Microsystems, Inc., in the United States and other countries. O'Reilly
&amp; Associates, Inc. is independent of Sun Microsystems.
</para>

<para>Many of the designations used by manufacturers and sellers to
distinguish their products are claimed as trademarks. Where those
designations appear in this book, and O'Reilly &amp; Associates, Inc.
was aware of a trademark claim, the designations have been printed in
caps or initial caps. While every precaution has been taken in the
preparation of this book, the publisher assumes no responsibility for
errors or omissions, or for damages resulting from the use of the
information contained herein.
</para>

</legalnotice>

<copyright>
<year>1999</year>
<year>2000</year>
<year>2001</year>
<year>2002</year>
<year>2003</year>
<holder>O'Reilly &amp; Associates, Inc. All rights reserved.</holder>
</copyright>
</bookinfo>
</xsl:template>

<xsl:template match="/">
  <xsl:choose>
    <xsl:when test="$freshmeat != 0">
      <xsl:apply-templates select="//fm:project"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="bookinfo"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

<xsl:template match="fm:project">
  <xsl:text>&#10;</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>&#10;</xsl:text>
  <xsl:apply-templates select="fm:Changes" mode="text"/>
  <xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template match="fm:Changes"/>

<xsl:template match="fm:*">
  <xsl:value-of select="local-name(.)"/>
  <xsl:text>: </xsl:text>

  <xsl:call-template name="value">
    <xsl:with-param name="text" select="normalize-space(.)"/>
  </xsl:call-template>
  <xsl:text>&#10;</xsl:text>
</xsl:template>

<xsl:template name="value">
  <xsl:param name="text"/>

  <xsl:call-template name="string.subst">
    <xsl:with-param name="string" select="$text"/>
    <xsl:with-param name="target" select="'{VERSION}'"/>
    <xsl:with-param name="replacement" select="$VERSION"/>
  </xsl:call-template>
</xsl:template>

<xsl:template name="string.subst">
  <xsl:param name="string"/>
  <xsl:param name="target"/>
  <xsl:param name="replacement"/>

  <xsl:choose>
    <xsl:when test="contains($string, $target)">
      <xsl:variable name="rest">
        <xsl:call-template name="string.subst">
          <xsl:with-param name="string" select="substring-after($string, $target)"/>
          <xsl:with-param name="target" select="$target"/>
          <xsl:with-param name="replacement" select="$replacement"/>
        </xsl:call-template>
      </xsl:variable>
      <xsl:value-of select="concat(substring-before($string, $target),
                                   $replacement,
                                   $rest)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$string"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>
