<?xml version="1.0"?>
<!-- $Id: egbokdoc2fop.xsl,v 1.3 2002/04/23 00:51:16 hbo Exp $ -->
<xsl:stylesheet 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fo="http://www.w3.org/1999/XSL/Format"
        version="1.0">

<xsl:output indent="yes"/>
<xsl:template match="egbokdoc">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
  <fo:simple-page-master master-name="only" >
			page-height="auto"
			page-width="auto"
			margin-left="200pt"
			margin-right="200pt"
			margin-top="200pt"
			margin-bottom="200pt">
			<fo:region-body margin-top="60pt" margin-left="60pt" margin-right="60pt" margin-bottom="60pt"/>
			<fo:region-before extent="1.5cm"/>
			<fo:region-after extent="1.5cm"/>
  </fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="only">
  <fo:static-content flow-name="xsl-region-before">
   <fo:block text-align="end" 
	font-size="8pt" 
	font-family="serif" 
	line-height="12pt" >
    <xsl:apply-templates select="title" />- p. <fo:page-number/>
   </fo:block>
  </fo:static-content> 

    <fo:flow flow-name="xsl-region-body">
       <fo:block font-size="22pt" 
                font-family="sans-serif" 
                line-height="28pt"
                space-after.optimum="4pt"
                text-align="left">
		<xsl:apply-templates select="title" />: 
         </fo:block>
       <fo:block font-size="18pt" 
                font-family="sans-serif" 
                line-height="24pt"
                space-after.optimum="15pt"
                text-align="left">
		<xsl:apply-templates select="subtitle" />
       </fo:block>
       <xsl:apply-templates select="maintainer" />
       <xsl:apply-templates select="copyright" />

    <xsl:apply-templates select="content" />
   </fo:flow>
  </fo:page-sequence>
</fo:root>
</xsl:template>

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

<xsl:template match="section">
  <xsl:text disable-output-escaping="yes">&lt;fo:block </xsl:text>
  <xsl:choose>
    <xsl:when test="@break">
       <xsl:text disable-output-escaping="yes">break-before=&quot;</xsl:text>
       <xsl:value-of select="@break"/>
       <xsl:text disable-output-escaping="yes">&quot;</xsl:text>
   </xsl:when>
  </xsl:choose>

  <xsl:text disable-output-escaping="yes">
	font-size=&quot;18pt&quot; 
	font-weight=&quot;bold&quot; 
	space-before=&quot;4pt&quot;&gt;
  </xsl:text>
  <xsl:value-of select="@title"/>
  <xsl:apply-templates/>
  <xsl:text disable-output-escaping="yes">&lt;/fo:block&gt;</xsl:text>
</xsl:template>

<xsl:template match="subsection">
  <xsl:text disable-output-escaping="yes">&lt;fo:block </xsl:text>
  <xsl:choose>
    <xsl:when test="@break">
       <xsl:text disable-output-escaping="yes">break-before=&quot;</xsl:text>
       <xsl:value-of select="@break"/>
       <xsl:text disable-output-escaping="yes">&quot;</xsl:text>
   </xsl:when>
  </xsl:choose>

  <xsl:text disable-output-escaping="yes">
	font-size=&quot;14pt&quot; 
	font-weight=&quot;bold&quot; 
	space-before=&quot;4pt&quot;&gt;
  </xsl:text>
  <xsl:value-of select="@title"/>
  <xsl:apply-templates/>
  <xsl:text disable-output-escaping="yes">&lt;/fo:block&gt;</xsl:text>
</xsl:template>


<xsl:template match="subsubsection">

  <xsl:text disable-output-escaping="yes">&lt;fo:block </xsl:text>
  <xsl:choose>
    <xsl:when test="@break">
       <xsl:text disable-output-escaping="yes">break-before=&quot;</xsl:text>
       <xsl:value-of select="@break"/>
       <xsl:text disable-output-escaping="yes">&quot;</xsl:text>
   </xsl:when>
  </xsl:choose>

  <xsl:text disable-output-escaping="yes">
	font-size=&quot;12pt&quot; 
	font-weight=&quot;bold&quot; 
	space-before=&quot;4pt&quot;&gt;
  </xsl:text>
  <xsl:value-of select="@title"/>
  <xsl:apply-templates/>
  <xsl:text disable-output-escaping="yes">&lt;/fo:block&gt;</xsl:text>
</xsl:template>


<xsl:template match="para">
	<fo:block 
	font-family="Helvetica" 
	font-size="10pt"
	font-weight="normal" 
	text-indent="1em"
	space-before="6pt">
	<xsl:apply-templates/>
	</fo:block>
</xsl:template>


<xsl:template match="pre">
	<fo:block white-space-collapse="false" font-family="Courier" font-size="10pt"
		font-weight="bold" text-indent="1em"
		space-before="2pt" space-after="10pt" >

	  <xsl:apply-templates/>
        </fo:block>
</xsl:template>

<xsl:template match="strong">
	<fo:inline font-weight="bold" font-style="italic" color="blue"><xsl:apply-templates/></fo:inline>
</xsl:template>

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

<xsl:template match="link">
   <xsl:variable name="target">
      <xsl:choose>
        <xsl:when test="@text='here'" >
           at <xsl:value-of select="@href" />
        </xsl:when>
        <xsl:otherwise>
	   <xsl:value-of select="@text"/>
        </xsl:otherwise>
     </xsl:choose>
  </xsl:variable>
  <fo:inline><xsl:value-of select="$target"/></fo:inline>
</xsl:template>

<xsl:template match="footnote">
  <fo:footnote>
     <fo:inline font-weight="bold" 
	font-size="6pt" 
	color="blue"
	vertical-align="super">
	  <xsl:value-of select="@ref"/>
     </fo:inline>
     <fo:footnote-body font-size="6pt">
  	<fo:block font-size="6pt" space-before="4pt">
		<fo:inline vertical-align="super" color="blue">
	  		<xsl:value-of select="@ref"/>
		</fo:inline>
		<fo:inline font-weight="normal">
			<xsl:apply-templates/>
	       </fo:inline>
       </fo:block>
     </fo:footnote-body>
  </fo:footnote>
</xsl:template>
<xsl:template match="maintainer">
  <fo:block font-size="10pt" space-before="4pt">
   by <xsl:value-of select="name"/>, <xsl:value-of select="affiliation"/>, <fo:inline color="blue">
	<xsl:value-of select="email"/></fo:inline>
  </fo:block>
</xsl:template>

<xsl:template match="copyright">
  <fo:block font-size="8pt" font-style="italic" space-before="4pt">
   <xsl:apply-templates/>
  </fo:block>
</xsl:template>

</xsl:stylesheet>
