<isol>

!!! Listing 1

<?xml version="1.0" encoding="iso-8859-1" ?>

<map:sitemap  xmlns:map="http://apache.org/cocoon/sitemap/1.0">

<!-- ======= Components ======= -->
  <map:components>
    <map:generators default="file"/>
    <map:transformers default="xslt"/>
    <map:readers default="resource"/>
    <map:serializers default="html"/>
    <map:matchers default="wildcard"/>
    <map:selectors default="browser"/>
  </map:components>

  <map:pipelines>
    <map:pipeline>  
      <map:match pattern="*.html">
        <map:generate src="xml/{1}.xml"/>
        <map:transform src="style/ix-html.xsl"/>
        <map:serialize type="html"/>
      </map:match>

      <map:match pattern="*.pdf">
        <map:generate src="xml/{1}.xml"/>
        <map:transform src="style/ix-pdf.xsl"/>
        <map:serialize type="fo2pdf"/>
      </map:match>
    </map:pipeline>
  </map:pipelines>
</map:sitemap>

!!! Listing 2

<?xml version="1.0" encoding="iso-8859-1"?>

<ix>
  <meta>
    <autoren>
      <autor>Alexander Schatten</autor>
      <autor>Reinhard Pötz</autor>
    </autoren>
    <titel>Cocoon Einführung</titel>
  </meta>

  <inhalt>
    <h>Cocoon</h>
    <p>Eine Einführung in Cocoon...</p>
    <p>Zweiter Absatz</p>
  </inhalt>
</ix>

!!! Listing 3

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

  <xsl:template match="/">
    <html>
      <head>
        <title>
          <xsl:value-of select="/ix/meta/titel"/>
        </title>
      </head>
      <body>
        <xsl:apply-templates select="ix/meta"/>
        <xsl:apply-templates select="ix/inhalt"/>
        <p>zum <a href="ix.pdf">PDF</a></p>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="meta">
    <h1 align="center"><xsl:value-of select="titel"/></h1>
    <p align="center">
      <xsl:for-each select="autoren/autor">
        <xsl:value-of select="."/> <br/>
      </xsl:for-each>
    </p>
  </xsl:template>
  
  <xsl:template match="h">
    <h2><xsl:value-of select="."/></h2>
  </xsl:template>
  
  <xsl:template match="p">
    <p><xsl:value-of select="."/></p>
  </xsl:template>

</xsl:stylesheet>

!!! Listing 4

<?xml version="1.0"?>

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

  <xsl:template match="/">
   <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   
    <fo:layout-master-set>

      <fo:simple-page-master master-name="page"
         page-height="29.7cm" 
         page-width="21cm"
         margin-top="1cm" 
         margin-bottom="2cm" 
         margin-left="2.5cm" 
         margin-right="2.5cm">
         <fo:region-before extent="3cm"/>
         <fo:region-body margin-top="3cm"/>
         <fo:region-after extent="1.5cm"/>
       </fo:simple-page-master>

       <fo:page-sequence-master master-name="all">
         <fo:repeatable-page-master-alternatives>
           <fo:conditional-page-master-reference 
              master-reference="page" page-position="first"/>
         </fo:repeatable-page-master-alternatives>
       </fo:page-sequence-master>

    </fo:layout-master-set>

    <fo:page-sequence master-reference="all">
      <fo:static-content flow-name="xsl-region-after">
        <fo:block text-align="center" 
            font-size="10pt" 
            font-family="serif" 
            line-height="14pt">page 
           <fo:page-number/>
        </fo:block>
      </fo:static-content> 

      <fo:flow flow-name="xsl-region-body">
        <xsl:apply-templates/>
      </fo:flow>
    </fo:page-sequence>
   </fo:root>
  </xsl:template>

  <xsl:template match="ix">
    <xsl:apply-templates select="meta"/>
  <xsl:apply-templates select="inhalt"/>
  </xsl:template>
 
  <xsl:template match="meta">
    <fo:block font-size="32pt" 
        space-before.optimum="24pt" text-align="center">
      <xsl:value-of select="titel"/>
    </fo:block>
    <xsl:for-each select="autoren/autor">
      <fo:block font-size="16pt" 
         space-before.optimum="12pt" text-align="center">
        <xsl:value-of select="."/> <br/>
      </fo:block>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="h">
    <fo:block font-size="16pt" 
        space-before.optimum="12pt" 
        text-align="left">
      <xsl:value-of select="."/>
    </fo:block>
  </xsl:template>
  
  <xsl:template match="p">
    <fo:block font-size="12pt" 
       space-before.optimum="10pt" text-align="left">
      <xsl:value-of select="."/>
    </fo:block>
  </xsl:template>

</xsl:stylesheet>
