<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/TR/WD-xsl">



<xsl:template match="/">
	<HTML>
		<title>
		<xsl:value-of select="//MPDOKUMENT/FORMULAR" />
		<xsl:value-of select="//MPDOKUMENT/NR" />
		</title>
		
		<body>
		<xsl:apply-templates select="//MPDOKUMENT" />
            	</body>
	</HTML>
</xsl:template>



<xsl:template match="MPDOKUMENT">
	<xsl:apply-templates select="FIRMA" />
	<xsl:apply-templates select="KUNDE" />
	
	
	<p style="line-height:14pt;font-size:16pt;margin-left=280; margin-top=100">
	RECHNUNG
	</p>
		
	
	<table border="2" height="30px" width="700px" rules="none">
	<colgroup>
	 <col width="150"></col>
	 <col width="150"></col>
	 <col width="150"></col>
	 <col width="150"></col>
	 <col width="100"></col>
	</colgroup>
		<tr>
	   	<td><p style="line-height:7pt;font-size:9pt;" nowrap="">NUMMER</p></td> 
	   	<td><p style="line-height:7pt;font-size:9pt;" nowrap="">DATUM</p></td>
	   	<td><p style="line-height:7pt;font-size:9pt;" nowrap="">KUNDENNUMMER</p></td>
	   	<td><p style="line-height:7pt;font-size:9pt;" nowrap="">UID</p></td>
	   	<td><p style="line-height:7pt;font-size:9pt; margin:right">SEITE</p></td>
		</tr>
		<tr>
		<td nowrap="1"><xsl:value-of select="NR" /></td> 
		<td nowrap="1"><xsl:value-of select="DATUM" /></td>
		<td nowrap="1"><xsl:value-of select="//KUNDE/KNR" /></td>
		<td nowrap="1"><xsl:value-of select="//FIRMA/FUID" /></td>
	   	<td nowrap="1">1</td>
		</tr>
	</table>
	
	
	
	<p style="margin-top=25">
	<xsl:apply-templates select="POSITIONEN" />
	<style type="text/css">
	  p.endofsite{ page-break-after:always;}
	</style>
	</p>
</xsl:template>







<!-- _________________________________________KUNDE____________________________________________________ -->
<xsl:template match="KUNDE">
	<p style="line-height:6pt;font-size:12pt;margin-left:80px">

	<xsl:value-of select="ANREDE" />&#160;<xsl:value-of select="TITEL" /><br></br>
	
	<xsl:value-of select="VORNAME" />&#160;
	<xsl:value-of select="NACHNAME" /><br></br>
	<xsl:value-of select="ADRESSE" /><br></br>
	<xsl:value-of select="WOHNORT" /><br></br>
		
	</p>

</xsl:template>



<!-- __________________________________________FIRMA ___________________________________________________-->
<xsl:template match="FIRMA">
	
	<table border="0" height="80px" width="700px">
			     <colgroup>
			        <col width="300" ></col>
			        <col width="300"></col>
			        <col width="150"></col>
			     </colgroup>
			    <tr>
			      <td>
			      <p style="line-height:9pt;font-size:8pt;" nowrap="">
			      	<xsl:value-of select="NAME" /><br/>
				<xsl:value-of select="FADRESSE" /><br/>
				<xsl:value-of select="FN" /><br/>
				<xsl:value-of select="FUID" />
			      
			      </p>
			      
			      </td>
			      <td>
			      <div style="position:center">
			      		<img>
			      		<xsl:attribute name="src"><xsl:value-of select="//MPDOKUMENT/OBJEKT_NR" />.gif
			      		</xsl:attribute>
			      		<xsl:attribute name="width">100
			      		</xsl:attribute>
			      		<xsl:attribute name="height">100	
			      		</xsl:attribute>
			      		</img>
			      	</div>
			      </td>
			      <td></td>
	</tr></table>	
</xsl:template>

<!-- __________________________________________POSITIONEN ___________________________________________________-->
<xsl:template match="POSITIONEN">

<table border="" rules="groups" >

<thead>
<table border="1" height="50px" width="700" >
	<colgroup>
	 <col width="220"></col>
	 <col width="20"></col>
	 <col width="90"></col>
	 <col width="90"></col>
	 <col width="90"></col>
	 <col width="90"></col>
	</colgroup>
		<tr>
	   	<td><p style="line-height:8pt;font-size:11pt;" nowrap="">NAME / LESER &#160;&#160;&#160;BEZUGS-NR.</p>
	   	</td> 
	   	<td><p style="line-height:7pt;font-size:11pt;" nowrap="">EX</p></td>
	   	<td><p style="line-height:7pt;font-size:11pt;" nowrap="">ZEITRAUM</p></td>
	   	<td><p style="line-height:7pt;font-size:11pt;" nowrap="">BETRAG /EUR</p></td>
	   	<td><p style="line-height:7pt;font-size:11pt; margin:right">MWST</p></td>
		
		</tr>
	</table>

</thead>

<tbody>
<!--          POSITIONEN   -->
<table border="1"  height= "440">
<colgroup>
	 <col width="220"></col>
	 <col width="15"></col>
	 <col width="120"></col>
	 <col width="90"></col>
	 <col width="90"></col>
	 <col width="40"></col>
	</colgroup>
<tr>

<td valign="top">
	<p style="line-height:10pt;font-size:11pt;">
	<xsl:for-each select="//POSITION/OBJEKT_TEXT" ><br/>
	<xsl:eval>this.text</xsl:eval>
	</xsl:for-each>
	</p>
</td>
	             
<td  valign="top">
	<p style="line-height:10pt;font-size:11pt;">
 	<xsl:for-each select="//POSITION/ANZAHL" ><br/>
	<xsl:eval>this.text</xsl:eval>
	</xsl:for-each>
	</p>
</td>
	 
<td align="right" valign="top">
	<p style="line-height:10pt;font-size:11pt;">
	<xsl:for-each select="//POSITION/ZEITRAUM" ><br/>
	<xsl:eval>this.text</xsl:eval>
	</xsl:for-each>
	</p>
</td>
	 
<td align="right" valign="top">
	<p style="line-height:10pt;font-size:11pt;">
	<xsl:for-each select="//POSITION/BRUTTO" ><br/>
	<xsl:eval>formatnumber(this.nodetypedvalue,"0.00")</xsl:eval>
	</xsl:for-each>
	</p>
</td>
	 
<td align="right" valign="top">
	<p style="line-height:10pt;font-size:11pt;">
	<xsl:for-each select="//POSITION/MWST" ><br/>
	<xsl:eval>formatnumber(this.nodetypedvalue,"0.00")</xsl:eval>
	</xsl:for-each>
	</p>
</td>
<td align="right" valign="top">
	<p style="line-height:10pt;font-size:11pt;">
	<xsl:for-each select="//POSITION/MWST" ><br/>
	<xsl:eval>formatnumber(this.nodetypedvalue,"0.00")</xsl:eval>
	</xsl:for-each>
	</p>
</td>
</tr>	
</table>
</tbody>
</table>
</xsl:template>



<xsl:template match="POSITION">

<xsl:for-each select="OBJEKT_TEXT" ><br/>
	<p><xsl:eval>this.text</xsl:eval></p>
</xsl:for-each>

<table border="1" width="700">
<tr>

<td align="left" valign="top"><font face="Verdana,Helvetica,Arial,sans-serif" size="2">
   	<xsl:for-each select="OBJEKT_TEXT" ><br/>
     		<p><xsl:eval>this.text</xsl:eval></p>
   	</xsl:for-each>
	</font>
</td>
             
 <td align="right" valign="top">
   <font face="Verdana,Helvetica,Arial,sans-serif" size="1">
   <xsl:for-each select="ANZAHL" >
     &#160;<xsl:eval>this.text</xsl:eval>
   </xsl:for-each>
  </font>
 </td>
 
 <td align="right" valign="top"><font face="Verdana,Helvetica,Arial,sans-serif" size="1">
  <xsl:for-each select="ZEITRAUM" >
  &#160;<xsl:eval>this.text</xsl:eval>
  </xsl:for-each>
  </font>
 </td>
 
 
 <td align="right" valign="top">
		 <font face="Verdana,Helvetica,Arial,sans-serif" size="1">
   <xsl:for-each select="BRUTTO" >
     &#160;<xsl:eval>formatnumber(this.nodetypedvalue,"0.00")</xsl:eval>
    </xsl:for-each>
  </font>
 </td>
 
 <td align="right" valign="top">
	 <font face="Verdana,Helvetica,Arial,sans-serif" size="1">
  <xsl:for-each select="MWST" >
    &#160;<xsl:eval>formatnumber(this.nodetypedvalue,"0.00")</xsl:eval>
   </xsl:for-each>
 </font>
</td>

</tr>

</table>
</xsl:template>




</xsl:stylesheet>

