<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="4.0" encoding="iso-8859-1" media-type="text/html; charset=iso-8859-1" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/html4/transitional.dtd"/>
	<xsl:template match="/">
		<HTML>
			<HEAD>
				<xsl:apply-templates select="//page/META"/>
				<xsl:element name="META">
					<xsl:attribute name="NAME">DC.Generator</xsl:attribute>
					<xsl:attribute name="CONTENT">this content is managed by PANSITE (TM)</xsl:attribute>
				</xsl:element>
				<xsl:element name="META">
					<xsl:attribute name="HTTP-EQUIV">Expires</xsl:attribute>
					<xsl:attribute name="CONTENT">0</xsl:attribute>
				</xsl:element>
				<xsl:element name="META">
					<xsl:attribute name="HTTP-EQUIV">Pragma</xsl:attribute>
					<xsl:attribute name="CONTENT">no-cache</xsl:attribute>
				</xsl:element>
				<xsl:element name="META">
					<xsl:attribute name="HTTP-EQUIV">Cache-control</xsl:attribute>
					<xsl:attribute name="CONTENT">no-cache</xsl:attribute>
				</xsl:element>
				<xsl:element name="META">
					<xsl:attribute name="HTTP-EQUIV">content-language</xsl:attribute>
					<xsl:attribute name="CONTENT">de</xsl:attribute>
				</xsl:element>
				<xsl:for-each select="page">
					<xsl:value-of select="scripts"/>
					<xsl:value-of select="header"/>
					<TITLE>
						<xsl:value-of select="title"/>
					</TITLE>
				</xsl:for-each>
			</HEAD>
			<xsl:apply-templates select="//page"/>
		</HTML>
	</xsl:template>
	<xsl:template match="page">
		<xsl:element name="BODY">
			<xsl:for-each select="./body">
				<xsl:attribute name="TEXT">
					<xsl:value-of select="textcolor"/>
				</xsl:attribute>
				<xsl:attribute name="VLINK">
					<xsl:value-of select="vlinkcolor"/>
				</xsl:attribute>
				<xsl:attribute name="ALINK">
					<xsl:value-of select="alinkcolor"/>
				</xsl:attribute>
				<xsl:attribute name="LINK">
					<xsl:value-of select="linkcolor"/>
				</xsl:attribute>
				<xsl:attribute name="BGCOLOR">
					<xsl:value-of select="bgcolor"/>
				</xsl:attribute>
				<xsl:attribute name="BACKGROUND">
					<xsl:value-of select="background"/>
				</xsl:attribute>
				<xsl:value-of select="extension"/>
				<xsl:for-each select="./element[@x &lt; 182 or @y &lt; 132]">
					<xsl:sort select="@y" data-type="number" order="ascending"/>
					<xsl:element name="DIV">
						<xsl:attribute name="STYLE">position:absolute;left:<xsl:value-of select="@x"/>px;top:<xsl:value-of select="@y"/>px; width:<xsl:value-of select="@width"/>px; height:<xsl:value-of select="@height"/>px; border-top:0; border-right:0; border-bottom:0; border-left:0; padding-top:0; padding-right:0; padding-bottom:0; padding-left:0;</xsl:attribute>
						<xsl:choose>
							<xsl:when test="cdata-content">
								<xsl:value-of disable-output-escaping="yes" select="cdata-content"/>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="content"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:element>
				</xsl:for-each>
				<span id="spalte_1" style="position:absolute;top:132px;left:182px;margin:0px;padding:0px;width:560px;text-align:left;vertical-align:top">
					<xsl:for-each select="./element[@x &gt; 181 and @x &lt; 742 and @y &gt; 131]">
						<xsl:sort select="@y*10000+@x" data-type="number" order="ascending"/>
						<xsl:element name="DIV">
							<xsl:attribute name="STYLE">position:relative;left:<xsl:value-of select="-182+@x"/>px;top:<xsl:value-of select="(-132-(sum(../element[@x &gt; 181 and @x &lt; 742 and @y &gt; 131 and ((@y &lt; current()/@y) or ((@y = current()/@y) and (@x &lt; current()/@x)))]/@height))+@y)"/>px; width:<xsl:value-of select="@width"/>px;  height:auto; min-height:<xsl:value-of select="@height"/>px;  border-top:0; border-right:0; border-bottom:0; border-left:0; margin:0px;padding:0px;</xsl:attribute>
							<xsl:attribute name="ID">el_<xsl:value-of select="@x"/>_<xsl:value-of select="@y"/></xsl:attribute>
							<xsl:choose>
								<xsl:when test="cdata-content">
									<xsl:value-of disable-output-escaping="yes" select="cdata-content"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="content"/>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:element>
						<xsl:comment>[if gte IE 5.0]&gt;
				&lt;style type="text/css"&gt;
					#el_<xsl:value-of select="@x"/>_<xsl:value-of select="@y"/> {height:<xsl:value-of select="@height"/>px!important}
				&lt;/style&gt;
				&lt;![endif]</xsl:comment>
						<xsl:if test="position()=last()">
							<xsl:if test="0 &lt; (-132-(sum(../element[@x &gt; 181 and @x &lt; 742 and @y &gt; 131]/@height))+@y+@height)">
								<xsl:element name="DIV">
									<xsl:attribute name="STYLE">height:auto;min-height:<xsl:value-of select="(-132-(sum(../element[@x &gt; 181 and @x &lt; 742 and @y &gt; 131]/@height))+@y+@height)"/>px;margin:0px;padding:0px;text-align:left;vertical-align:top;</xsl:attribute>
								</xsl:element>
							</xsl:if>
						</xsl:if>
					</xsl:for-each>
				</span>
				<span id="spalte_2" style="position:absolute;top:132px;left:742px;margin:0px;padding:0px;width:221px;text-align:left;vertical-align:top">
					<xsl:for-each select="./element[@x &gt; 741 and @y &gt; 131]">
						<xsl:sort select="@y*10000+@x" data-type="number" order="ascending"/>
						<xsl:element name="DIV">
							<xsl:attribute name="STYLE">position:relative;left:<xsl:value-of select="-742+@x"/>px;top:<xsl:value-of select="(-132-(sum(../element[@x &gt; 741 and @y &gt; 131 and ((@y &lt; current()/@y) or ((@y = current()/@y) and (@x &lt; current()/@x)))]/@height))+@y)"/>px; width:<xsl:value-of select="@width"/>px;  height:auto; min-height:<xsl:value-of select="@height"/>px;  border-top:0; border-right:0; border-bottom:0; border-left:0; margin:0px;padding:0px;</xsl:attribute>
							<xsl:attribute name="ID">el_<xsl:value-of select="@x"/>_<xsl:value-of select="@y"/></xsl:attribute>
							<xsl:choose>
								<xsl:when test="cdata-content">
									<xsl:value-of disable-output-escaping="yes" select="cdata-content"/>
								</xsl:when>
								<xsl:otherwise>
									<xsl:value-of select="content"/>
								</xsl:otherwise>
							</xsl:choose>
						</xsl:element>
						<xsl:comment>[if gte IE 5.0]&gt;
				&lt;style type="text/css"&gt;
					#el_<xsl:value-of select="@x"/>_<xsl:value-of select="@y"/> {height:<xsl:value-of select="@height"/>px!important}
				&lt;/style&gt;
				&lt;![endif]</xsl:comment>
						<xsl:if test="position()=last()">
							<xsl:if test="0 &lt; (-132-(sum(../element[@x &gt; 741 and @y &gt; 131]/@height))+@y+@height)">
								<xsl:element name="DIV">
									<xsl:attribute name="STYLE">height:auto;min-height:<xsl:value-of select="(-132-(sum(../element[@x &gt; 741 and @y &gt; 131]/@height))+@y+@height)"/>px;margin:0px;padding:0px;text-align:left;vertical-align:top;</xsl:attribute>
								</xsl:element>
							</xsl:if>
						</xsl:if>
					</xsl:for-each>
				</span>
				<xsl:value-of select="postextension"/>
			</xsl:for-each>
		</xsl:element>
	</xsl:template>
	<!--
	META tags und nicht leere attirbute kopieren
-->
	<xsl:template match="META">
		<META>
			<xsl:copy-of select="@*[not(.='')]|node()"/>
		</META>
	</xsl:template>
</xsl:stylesheet>

