<?xml version="1.0" encoding="utf-8"?>

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

<!-- © 2005 Stefan Mintert 
	 This is copyrighted material. Please read
	 http://www.linkwerk.com/pub/xml/invitation/licence.txt
	 
	 The purpose of this XSLT style sheet is described online
	 at http://www.linkwerk.com/pub/xml/invitation/.
-->




<!-- ====================================================== -->
<!-- Template for root element type 'invitation' -->

<xsl:template match="invitation">

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master 
        master-name="one" 
        page-height="15cm"
        page-width="21cm"
        margin-left="2cm" 
        margin-right="2cm">
   <fo:region-body margin-top="1cm" margin-bottom="1cm"/>
  </fo:simple-page-master>
 </fo:layout-master-set>
 
 <fo:page-sequence master-reference="one" >  
  <fo:flow flow-name="xsl-region-body" font-size="14pt" line-height="18pt">
	   <xsl:apply-templates select="event"/>
	
	<fo:block 	text-align="justify" 
				padding="2em" 
				margin-left="0cm"
				margin-right="0cm"
				border-left="solid red 2em"
				border-right="solid red 2em"
				>I'd like to invite you to
		come to <xslt:apply-templates select="location"/>.
		The event takes place on 
		<xslt:apply-templates select="date"/>
		at
		<xslt:apply-templates select="time"/>.
	</fo:block>
	<xslt:apply-templates select="description|dresscode"/>
	
		
	   <fo:block text-align="justify" 
	             background-color="#cccccc"
     	         color="#000000"
          	     padding="10pt"
          	     font-size="8pt"
	             space-before.optimum="30pt">
 	Generated from XML with invitation2html.xslt.
	Copyright &#169; Stefan Mintert, Linkwerk.com.
	    <fo:inline font-style="italic">http://www.linkwerk.com/pub/xml/invitation/</fo:inline>
	   </fo:block>
  </fo:flow>
 </fo:page-sequence> 
</fo:root>
</xsl:template>




<!-- ====================================================== -->
<!-- Template for element type 'event' -->

<xsl:template match="event">
  <fo:block text-align="center" 
            font-size="24pt"  
            font-weight="bold"
            background-color="#66AA66"
            color="white"
            padding="10pt"
            line-height="28pt"><xsl:apply-templates/>
  </fo:block>
</xsl:template>
<!-- ====================================================== -->

<!-- ====================================================== -->
<xslt:template match="location | date | time">
   <fo:inline font-weight="bold"><xslt:apply-templates/></fo:inline>
</xslt:template>
<!-- ====================================================== -->


<!-- ====================================================== -->
<!-- Template for element type 'emph' -->

<xslt:template match="emph">
 <fo:inline font-style="italic"><xslt:apply-templates/></fo:inline>
</xslt:template>
<!-- ====================================================== -->





<!-- ====================================================== -->
<!-- Template for element type 'description' -->

<xslt:template match="description">
  <fo:block 	text-align="left"
				padding-left="2em" 
				padding-right="2em" 
				padding-top="1em"
				margin-left="0cm"
				margin-right="0cm"
				border-left="solid white 2em"
				border-right="solid white 2em"
  >
	<fo:inline font-weight="bold">What's up? </fo:inline>
 	<xslt:apply-templates/>
  </fo:block>
</xslt:template>

<xslt:template match="dresscode">
 <fo:block	text-align="left"
				padding-left="2em" 
				padding-right="2em" 
				padding-top="1em"
				margin-left="0cm"
				margin-right="0cm"
				border-left="solid white 2em"
				border-right="solid white 2em"
  ><fo:inline font-weight="bold">What to wear? </fo:inline> <xslt:apply-templates/></fo:block>
</xslt:template>




<!-- ====================================================== -->
<!-- Template fuer Elementtyp 'para' -->

<xslt:template match="para">
	<fo:block text-align="left">
		<xslt:apply-templates/>
	</fo:block>
</xslt:template>
<!-- ====================================================== -->


</xsl:stylesheet>
