<?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:output indent="yes"/>


<xsl:template match="/">                               
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>

<fo:simple-page-master master-name="A4"
    page-width="210mm" page-height="297mm"
    margin-top="15mm" margin-bottom="5mm"
    margin-left="15mm" margin-right="15mm">
<fo:region-body region-name="xsl-region-body" margin="35mm 5mm 15mm 5mm" padding="6pt" column-count="2" column-gap="8.3mm"/>
<fo:region-before region-name="xsl-region-before" extent="35mm" display-align="after" />
<fo:region-after region-name="xsl-region-after" extent="16mm" />
</fo:simple-page-master>

<fo:page-sequence-master>
<fo:repeatable-page-master-reference master-name="A4" />
</fo:page-sequence-master>

</fo:layout-master-set>

 <fo:page-sequence initial-page-number="1">



<fo:static-content flow-name="xsl-region-before">
<xsl:apply-templates select="html/body/div [@class='meta']/ h1 [@class='title']"/>  
<xsl:apply-templates select="html/body/div [@class='meta']/ div [@class='authors'] / div [@class='author'] / h2 [@class='author']"/>    
</fo:static-content>



<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="12pt" font-weight="bold" color="green"
 space-before="4pt" space-after="2pt" text-align="center">Page <fo:page-number /></fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="html/body/div [@class='meta']/ div [@class='abstract']"/> 
<xsl:apply-templates select="html/body/div [@class='meta']/ div [@class='keywords']"/> 
<xsl:apply-templates select="html/body/div [@class='paperbody']"/>     
<xsl:apply-templates select="html/body/div [@class='references']"/>    
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template> 



<xsl:template match="div [@class='meta'] /div [@class='abstract']"> 
<fo:block   id="{generate-id()}" keep-together="always" >          
<xsl:apply-templates/>
 </fo:block>
</xsl:template>

<xsl:template match="div [@class='meta'] /div [@class='keywords']"> 
<fo:block   id="{generate-id()}" keep-together="always" >          
<xsl:apply-templates/>
 </fo:block>
</xsl:template>

<xsl:template match="div  [@class='paperbody']">  
            
<fo:block  id="{generate-id()}"  >          
<xsl:apply-templates/>
 </fo:block>

</xsl:template>

<xsl:template match="div  [@class='references']">  
            
<fo:block  id="{generate-id()}" keep-together="always" >          
<xsl:apply-templates/>
 </fo:block>

</xsl:template>

<xsl:template match="h1 [@class = 'title']">                    
<fo:block font-family="Helvetica" font-size="18pt" font-weight="bold" color="red"
  space-before="6pt" space-after="0pt" text-align="center">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h2 [@class = 'author']">                    
<fo:block font-family="Helvetica" font-size="12pt" font-weight="bold" color="green"
  space-before="6pt" space-after="0pt" text-align="center">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h3 [@class = 'affiliation']">                    
<fo:block font-family="Helvetica" font-size="10pt" font-weight="bold" color="green"
  space-before="6pt" space-after="0pt" text-align="center">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h2 [@class = 'email']">                    
<fo:block font-family="Helvetica" font-size="12pt" font-weight="bold" color="green"
  space-before="6pt" space-after="0pt" text-align="center">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h1 [@class = 'abstract']">                    
<fo:block font-family="Helvetica" font-size="12pt" font-weight="bold" color="black"
  space-before="6pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="p [@class = 'abstract']">                    
<fo:block font-family="Helvetica" font-size="9pt" font-weight="normal" color="black"
  space-before="2pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h2 [@class = 'keywords']">                    
<fo:block font-family="Helvetica" font-size="12pt" font-weight="bold" color="black"
  space-before="6pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="p [@class = 'keywords']">                    
<fo:block font-family="Helvetica" font-size="9pt" font-weight="normal" color="black"
  space-before="2pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h1">                    
<fo:block font-family="Times" font-size="12pt" font-weight="bold" color="blue"
 space-before="2pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h2">                    
<fo:block font-family="Times" font-size="12pt" font-weight="bold" color="green"
 space-before="2pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="h3">                    
<fo:block font-family="Times" font-size="12pt" font-weight="normal" font-style="italic" color="green"
 space-before="2pt" space-after="0pt" text-align="left">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="p">                     
<fo:block font-family="Times" font-size="9pt"
 space-before="2pt" space-after="2pt" text-align="justify">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="p [@class = 'ref']">                     
<fo:block font-family="Times" font-size="9pt"
 space-before="2pt" space-after="2pt" text-align="adjust" start-indent="6pt" text-indent="-6pt" margin-left="6pt" color="red">
<xsl:apply-templates/>
</fo:block>
</xsl:template>

<xsl:template match="html/head/title" />    



</xsl:stylesheet>















