<!-- XSL Stylesheet for HTML designed specifically for FOP -->
<!-- James Tauber / jtauber@jtauber.com / www.jtauber.com  -->
<!-- This version: 1999-09-12                              -->

<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
    xmlns:fo="http://www.w3.org/XSL/Formatting/1.0"
>

  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/XSL/Format/1.0">
      <fo:layout-master-set>
        <fo:simple-page-master page-master-name="general">
          <fo:region-body
              margin-top="50pt"
              margin-bottom="50pt"
              margin-left="50pt"
              margin-right="50pt"/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence>
        <fo:sequence-specification>
          <fo:sequence-specifier-repeating
              page-master-first="general"
              page-master-repeating="general"/>
        </fo:sequence-specification>
        <fo:flow>
          <xsl:apply-templates/>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>

  <xsl:template match="address">
    <fo:block font-style="italic">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="b">
    <fo:inline-sequence font-weight="bold"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="big">
    <fo:inline-sequence font-size="1.17em"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="blockquote">
    <fo:block space-before.optimum="12pt" space-after.optimum="12pt" start-indent="40px" end-indent="40px">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="body">
    <fo:block start-indent="8px" end-indent="8px" space-before.optimum="8px" space-after.optimum="8px" line-height="1.33">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="br">
    <fo:block/>
  </xsl:template>

  <xsl:template match="caption">
    <fo:table-caption>
      <xsl:apply-templates/>
    </fo:table-caption>
  </xsl:template>

  <xsl:template match="cite">
    <fo:inline-sequence font-style="italic"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="code">
    <fo:inline-sequence font-family="monospace"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="col">
    <fo:table-column>
      <xsl:apply-templates/>
    </fo:table-column>
  </xsl:template>

  <xsl:template match="colgroup">
    <fo:table-column-group>
      <xsl:apply-templates/>
    </fo:table-column-group>
  </xsl:template>

  <xsl:template match="dd">
    <fo:block start-indent="40pt" space-before.optimum="0pt" space-after.optimum="0pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="del">
    <!-- strike-through -->
    <xsl:apply-templates/>
  </xsl:template>


  <xsl:template match="div">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="dl">
    <fo:block space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="dt">
    <fo:block space-before.optimum="0pt" space-after.optimum="0pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="em">
    <fo:inline-sequence font-style="italic"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="fieldset">
    <fo:block space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="form">
    <fo:block space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="frame">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="frameset">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h1">
    <fo:block font-size="24pt" font-weight="bold" space-before.optimum="16pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h2">
    <fo:block font-size="18pt" font-weight="bold" space-before.optimum="16pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h3">
    <fo:block font-size="14pt" font-weight="bold" space-before.optimum="14pt" space-after.optimum="14pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h4">
    <fo:block font-weight="bold" space-before.optimum="16pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h5">
    <fo:block font-size="10pt" font-weight="bold" line-height="14pt" space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="h6">
    <fo:block font-size="8pt" font-weight="bold" space-before.optimum="16pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="head"/>

  <xsl:template match="i">
    <fo:inline-sequence font-style="italic"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="hr">
    <fo:display-rule/>
  </xsl:template>

  <xsl:template match="iframe">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="ins">
    <!-- underline -->
    <fo:inline-sequence><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="kbd">
    <fo:inline-sequence font-family="monospace"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="ul/li">
    <fo:list-item>
      <fo:list-item-label>
        <fo:block>&#x2022;</fo:block>
      </fo:list-item-label>
      <fo:list-item-body>
        <fo:block>
          <xsl:apply-templates/>
        </fo:block>
      </fo:list-item-body>
    </fo:list-item>
  </xsl:template>

  <xsl:template match="ol/li">
    <fo:list-item>
      <fo:list-item-label>
        <fo:block><xsl:number/>.</fo:block>
      </fo:list-item-label>
      <fo:list-item-body>
        <fo:block>
          <xsl:apply-templates/>
        </fo:block>
      </fo:list-item-body>
    </fo:list-item>
  </xsl:template>

  <xsl:template match="noframes">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="object">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="ol">
    <fo:list-block start-indent="40pt" space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:list-block>
  </xsl:template>

  <xsl:template match="p">
    <fo:block space-before.optimum="8pt" space-after.optimum="8pt">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="pre">
    <fo:block font-family="monospace" white-space-treatment="preserve" wrap-option="no-wrap">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="s">
    <!-- strike-through -->
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="samp">
    <fo:inline-sequence font-family="monospace"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="small">
    <fo:inline-sequence font-size="0.83em"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="strike">
    <!-- strike-through -->
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="strong">
    <fo:inline-sequence font-weight="bold"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="sub">
    <!-- vertical adjustment -->
    <fo:inline-sequence font-size="0.83em"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="sup">
    <!-- vertical adjustment -->
    <fo:inline-sequence font-size="0.83em"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="table">
    <fo:table>
      <xsl:apply-templates/>
    </fo:table>
  </xsl:template>

  <xsl:template match="tbody">
    <fo:table-row-group>
      <xsl:apply-templates/>
    </fo:table-row-group>
  </xsl:template>

  <xsl:template match="td">
    <fo:table-cell>
      <xsl:apply-templates/>
    </fo:table-cell>
  </xsl:template>

  <xsl:template match="tfoot">
    <fo:table-footer-group>
      <xsl:apply-templates/>
    </fo:table-footer-group>
  </xsl:template>

  <xsl:template match="th">
    <fo:table-cell>
      <xsl:apply-templates/>
    </fo:table-cell>
  </xsl:template>

  <xsl:template match="thead">
    <fo:table-header-group>
      <xsl:apply-templates/>
    </fo:table-header-group>
  </xsl:template>

  <xsl:template match="tr">
<!--    <fo:table-row> -->
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
<!--    </fo:table-row> -->
  </xsl:template>

  <xsl:template match="tt">
    <fo:inline-sequence font-family="monospace"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="u">
    <!-- underline -->
    <fo:inline-sequence><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="ul">
    <fo:list-block start-indent="40pt" space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:list-block>
  </xsl:template>

  <xsl:template match="var">
    <fo:inline-sequence font-style="italic"><xsl:apply-templates/></fo:inline-sequence>
  </xsl:template>

  <xsl:template match="applet">
    <fo:block>
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="center">
    <fo:block text-align="center">
      <xsl:apply-templates/>
    </fo:block>
  </xsl:template>

  <xsl:template match="dir">
    <fo:list-block start-indent="40pt" space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:list-block>
  </xsl:template>

  <xsl:template match="menu">
    <fo:list-block start-indent="40pt" space-before.optimum="12pt" space-after.optimum="12pt">
      <xsl:apply-templates/>
    </fo:list-block>
  </xsl:template>

</xsl:stylesheet>
