<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:transform [
   <!ENTITY mcj "Mario Jeckle">
   <!ENTITY mcjurl "jeckle.de">
   <!ENTITY TransformationAbort "Aborting transformation process!">
   <!ENTITY msg "MESSAGE:">
   <!ENTITY wng "WARNING:">
   <!ENTITY err "ERROR:">
   <!ENTITY dbg "DEBUG:">
]>

<!--
For further information visit: http://www.jeckle.de/about.html
-->

<xsl:transform version="2.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xhtml="http://www.w3.org/1999/xhtml"
	xmlns:mcj="mcjExtension"
   exclude-result-prefixes="xhtml mcj">

   <xsl:strip-space elements="*"/>
   <xsl:preserve-space elements="listing"/>

<xsl:param name="pagetitle"><xsl:value-of select="document/head/pagetitle"/></xsl:param>
<xsl:param name="cssStyle"/>
<xsl:param name="mode">web</xsl:param>
<xsl:variable name="saxonVer">7.9.1</xsl:variable>
<xsl:variable name="javaVer">J2SE v1.5.0-beta2-b51</xsl:variable>
<xsl:variable name="stylesheet-version">111/2004-06-08T12:20:00+02:00</xsl:variable>

<xsl:output method="xhtml"
            encoding="ISO-8859-1"
            omit-xml-declaration="no"
            doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
            doctype-system="http://www.jeckle.de/DTD/xhtml1-transitional.dtd"
            indent="no"
            media-type="text/html"/>

<xsl:output name="rdf-output" method="xml" indent="no"/>

<xsl:variable name="replacement">&#180;</xsl:variable>
<xsl:variable name="search">&apos;</xsl:variable>
<xsl:variable name="RDFResultFileName"><xsl:value-of xmlns:string="java:java.lang.String" select="string:hashCode(//metatags/@url)"/>.rdf.xml</xsl:variable>

<!-- ************************************************************************************************* -->
<xsl:template match="current[@value='year']"><xsl:value-of select="mcj:current('year')"/></xsl:template>
<xsl:template match="current[@value='month']"><xsl:value-of select="mcj:current('month')"/></xsl:template>
<xsl:template match="current[@value='day']"><xsl:value-of select="mcj:current('day')"/></xsl:template>
<xsl:template match="current[@value='hour']"><xsl:value-of select="mcj:current('hour')"/></xsl:template>
<xsl:template match="current[@value='minute']"><xsl:value-of select="mcj:current('minute')"/></xsl:template>
<xsl:template match="current[@value='second']"><xsl:value-of select="mcj:current('second')"/></xsl:template>


<xsl:template match="saxonVer"><xsl:value-of select="$saxonVer"/></xsl:template>
<xsl:template match="javaVer"><xsl:value-of select="$javaVer"/></xsl:template>

<xsl:template name="copyAttribIfExist">
   <xsl:param name="attName"></xsl:param>
   <xsl:for-each select="./@*">
      <xsl:variable name="elementContent"><xsl:value-of select="."/></xsl:variable>
      <xsl:if test="name(.) = $attName and $elementContent != ''">
         <xsl:attribute name="{$attName}"><xsl:value-of select="$elementContent"/></xsl:attribute>
      </xsl:if>
   </xsl:for-each>
</xsl:template>

<xsl:template name="xhtml_coreattrs">
   <xsl:param name="omit"></xsl:param>
   <!-- XHTML v1.0 Rev. 1.14 coreattrs -->
   <xsl:if test="$omit != 'id'">
      <xsl:if test="@id != ''">
         <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'class'">
      <xsl:if test="@class != ''">
         <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'style'">
      <xsl:if test="@style != ''">
         <xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'title'">
      <xsl:if test="@title != ''">
         <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <!-- end XHTML coreattrs -->
</xsl:template>

<xsl:template name="xhtml_i18n">
   <xsl:param name="omit"></xsl:param>
   <xsl:if test="$omit != 'lang'">
      <xsl:if test="@lang != ''">
         <xsl:attribute name="lang"><xsl:value-of select="@lang"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'xml:lang'">
      <xsl:if test="@xml:lang != ''">
         <xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'dir'">
      <xsl:if test="@dir != ''">
         <xsl:attribute name="dir"><xsl:value-of select="@dir"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
</xsl:template>

<xsl:template name="xhtml_events">
   <xsl:param name="omit"></xsl:param>
   <xsl:if test="$omit != 'onkeyup'">
      <xsl:if test="@onkeyup != ''">
         <xsl:attribute name="onkeyup"><xsl:value-of select="@onkeyup"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onkeydown'">
      <xsl:if test="@onkeydown != ''">
         <xsl:attribute name="onkeydown"><xsl:value-of select="@onkeydown"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onkeypress'">
      <xsl:if test="@onkeypress != ''">
         <xsl:attribute name="onkeypress"><xsl:value-of select="@onkeypress"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onmouseout'">
      <xsl:if test="@onmouseout != ''">
         <xsl:attribute name="onmouseout"><xsl:value-of select="@onmouseout"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onmousemove'">
      <xsl:if test="@onmousemove != ''">
         <xsl:attribute name="onmousemove"><xsl:value-of select="@onmousemove"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onmouseup'">
      <xsl:if test="@onmouseup != ''">
         <xsl:attribute name="onmouseup"><xsl:value-of select="@onmouseup"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onmousedown'">
      <xsl:if test="@onmousedown != ''">
         <xsl:attribute name="onmousedown"><xsl:value-of select="@onmousedown"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'ondblclick'">
      <xsl:if test="@ondblclick != ''">
         <xsl:attribute name="ondblclick"><xsl:value-of select="@ondblclick"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
   <xsl:if test="$omit != 'onclick'">
      <xsl:if test="@onclick != ''">
         <xsl:attribute name="onclick"><xsl:value-of select="@onclick"/></xsl:attribute>
      </xsl:if>
   </xsl:if>
</xsl:template>

<xsl:template name="xhtml_attrs">
   <xsl:call-template name="xhtml_coreattrs"/>
   <xsl:call-template name="xhtml_i18n"/>
   <xsl:call-template name="xhtml_events"/>
</xsl:template>

<xsl:template match="*|@*">
   <xsl:message terminate="yes">
&err; unknown tag "<xsl:value-of select="name(.)"/>" detected
content was: <xsl:value-of select="."/>
parent was: <xsl:value-of select="name(parent::*)"/>
&TransformationAbort;
   </xsl:message>
</xsl:template>

<xsl:template match="/">
<xsl:message>RDF metadata ...</xsl:message>
	<xsl:result-document
		href="file:///l:/rdf/{$RDFResultFileName}"
		format="rdf-output">
			<rdf:RDF
				xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
				xmlns:dc="http://purl.org/dc/elements/1.1/"
				xmlns:con="http://www.w3.org/2000/10/swap/pim/contact#">
    			<rdf:Description rdf:about="{//metatags/@url}">
	        		<!--todo
	        		<xsl:if test="">
	        			<rdfs:seeAlso xmlns:rdfs=""
	        			rdf:resource="http://www.w3.org/2000/08/w3c-synd/home.rss"/>
	        		</xsl:if>
	        		-->
	        		<dc:title><xsl:value-of select="//pagetitle"/></dc:title>
	        		<dc:date><xsl:value-of xmlns:date="./ISODate" select="date:readFormattedDate()"/></dc:date>
	        		<dc:description><xsl:value-of select="//metatags/@description"/></dc:description>
	        		<dc:creator rdf:resource="http://www.jeckle.de/mario.html" />
	        		<dc:publisher rdf:resource="http://www.jeckle.de/mario.html" />
	        		<dc:subject><xsl:value-of select="//metatags/@keywords"/></dc:subject>
	        		<dc:type>
	            	<rdf:Bag>
	               	<rdf:li rdf:resource="http://purl.org/dc/dcmitype/Text"/>
	                	<rdf:li rdf:resource="http://purl.org/dc/dcmitype/Service"/>
	            	</rdf:Bag>
	        		</dc:type>
	        		<dc:format>text/html</dc:format>
	        		<dc:language>de</dc:language>
    			</rdf:Description>
    			<con:Person rdf:about="http://www.jeckle.de/mario.html">
        			<con:fullName>Mario Jeckle</con:fullName>
        			<con:mailbox rdf:resource="mailto:mario@jeckle.de"/>
        			<con:homePage rdf:resource="http://www.jeckle.de"/>
    			</con:Person>
		</rdf:RDF>
	</xsl:result-document>
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="document">
   <xsl:message terminate="no">
   Creating page...
&msg; pagetitle: <xsl:value-of select="$pagetitle"/>
&msg; with creation date: <xsl:value-of xmlns:date="./ISODate" select="date:readDate()"/>
&msg; using path prefix: http://www.jeckle.de/
   </xsl:message>

   <html>
   <xsl:apply-templates/>
   </html>
   <xsl:message terminate="no">
&msg; Page created sucessfully!
   </xsl:message>
</xsl:template>

<xsl:template match="ol[@type='upper-alpha']">
    <div style="margin-left:170px;">
        <ol type="A">
            <xsl:apply-templates/>
        </ol>
    </div>
</xsl:template>

<xsl:template match="ol">
   <xsl:element name="ol">
      <xsl:if test="@type = 'decimal'">
         <xsl:attribute name="style">list-style-type:decimal</xsl:attribute>
      </xsl:if>
      <xsl:if test="@type = 'lower-alpha'">
         <xsl:attribute name="style">list-style-type:lower-alpha</xsl:attribute>
      </xsl:if>
      <xsl:if test="@type = 'upper-roman'">
         <xsl:attribute name="style">list-style-type:upper-roman</xsl:attribute>
      </xsl:if>
      <xsl:if test="@type = 'lower-roman'">
         <xsl:attribute name="style">list-style-type:lower-roman</xsl:attribute>
      </xsl:if>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="ul">
   <xsl:element name="ul">
      <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="map">
   <xsl:element name="map">
      <xsl:if test="@id != ''">
         <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@class != ''">
         <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@style != ''">
         <xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@title != ''">
         <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@name != ''">
         <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
      </xsl:if>
      <xsl:call-template name="xhtml_i18n"/>
      <xsl:call-template name="xhtml_events"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="area">
   <xsl:element name="area">
      <xsl:call-template name="xhtml_attrs"/>
      <xsl:if test="@shape != ''">
         <xsl:attribute name="shape"><xsl:value-of select="@shape"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@coords != ''">
         <xsl:attribute name="coords"><xsl:value-of select="@coords"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@href != ''">
         <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@alt != ''">
         <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@tabindex != ''">
         <xsl:attribute name="tabindex"><xsl:value-of select="@tabindex"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@accesskey != ''">
         <xsl:attribute name="accesskey"><xsl:value-of select="@accesskey"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@alt != ''">
         <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@onfocus != ''">
         <xsl:attribute name="onfocus"><xsl:value-of select="@onfocus"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@onblur != ''">
         <xsl:attribute name="onblur"><xsl:value-of select="@onblur"/></xsl:attribute>
      </xsl:if>
      <xsl:apply-templates/>
   </xsl:element>

</xsl:template>

<xsl:template match="a[@fixedType='IETFRFC']">
   <xsl:element name="a"><xsl:attribute name="href">http://www.ietf.org/rfc/rfc<xsl:value-of select="@offset"/>.txt</xsl:attribute>IETF RFC <xsl:value-of select="@offset"/></xsl:element>
</xsl:template>

<xsl:template match="a">
   <xsl:element name="a">
      <xsl:if test="@statusbartext != ''">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(@statusbartext, $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
      </xsl:if>
      <xsl:if test="@target != ''">
         <xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
      </xsl:if>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">name</xsl:with-param>
      </xsl:call-template>
      <xsl:choose>
            <xsl:when test="@fixedType = 'DOM2'">
                <xsl:attribute name="href">http://www.w3.org/TR/DOM-Level-2-Core/core.html<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
            <xsl:when test="@fixedType = 'JDK15'">
                <xsl:attribute name="href">http://java.sun.com/j2se/1.5.0/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
            <xsl:when test="@fixedType = 'JDK14'">
                <xsl:attribute name="href">http://java.sun.com/j2se/1.4.2/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
           <xsl:when test="@fixedType = 'JDKcurrent'">
                <xsl:attribute name="href">http://java.sun.com/j2se/1.5.0/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
            <xsl:when test="@fixedType = 'J2EE13'">
            	<xsl:attribute name="href">http://java.sun.com/j2ee/sdk_1.3/techdocs/api/<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
            <xsl:when test="@fixedType = 'J2EE14'">
            	<xsl:attribute name="href">http://java.sun.com/j2ee/1.4/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>
            </xsl:when>
         <xsl:when test="@fixedType = 'XMLSpec'">
            <xsl:attribute name="href">http://www.w3.org/TR/REC-xml<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'JavaAPI'">
            <xsl:attribute name="href">http://java.sun.com/j2se/1.4.2/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'JavaJVM'">
            <xsl:attribute name="href">http://java.sun.com/docs/books/vmspec/2nd-edition/html/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'JavaLangSpec'">
            <xsl:attribute name="href">http://java.sun.com/docs/books/jls/second_edition/html/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'XSD0'">
            <xsl:attribute name="href">http://www.w3.org/TR/xmlschema-0/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'XSD1'">
            <xsl:attribute name="href">http://www.w3.org/TR/xmlschema-1/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'XSD2'">
            <xsl:attribute name="href">http://www.w3.org/TR/xmlschema-2/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'XSL'">
            <xsl:attribute name="href">http://www.w3.org/TR/xsl/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'XSLT'">
            <xsl:attribute name="href">http://www.w3.org/TR/1999/REC-xslt-19991116/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
            <xsl:when test="@fixedType = 'XPath'">
            <xsl:attribute name="href">http://www.w3.org/TR/1999/REC-xpath-19991116/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:when test="@fixedType = 'Wikipedia.de'">
            <xsl:attribute name="href">http://de.wikipedia.org/wiki/<xsl:value-of select="@offset"/></xsl:attribute>
         </xsl:when>
         <xsl:otherwise>
            <xsl:if test="@href != ''">
               <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
            </xsl:if>
            <xsl:call-template name="xhtml_events">
               <xsl:with-param name="omit">onmouseover</xsl:with-param>
            </xsl:call-template>
            <xsl:if test="@onmouseover != ''">
               <xsl:attribute name="onmouseover"><xsl:value-of select="@onmouseover"/></xsl:attribute>
            </xsl:if>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:if test="@type = 'external'">
         <xsl:message>&wng; type attribute is no longer supported for XHTML hyperlinks</xsl:message>
      </xsl:if>
      <xsl:if test="@external = 'yes'">
        <xsl:attribute name="target">_blank</xsl:attribute>
      </xsl:if>
      <xsl:choose>
         <xsl:when test="@keyword='yes'">
            <code><xsl:apply-templates/></code>
         </xsl:when>
         <xsl:otherwise>
            <xsl:apply-templates/>
         </xsl:otherwise>
      </xsl:choose>
   </xsl:element>
</xsl:template>

<xsl:template match="text()">
   <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="abbr">
   <xsl:element name="abbr">
      <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
      <xsl:apply-templates/>
   </xsl:element> <!-- abbr -->
</xsl:template>

<xsl:template match="hr">
   <xsl:element name="hr">
      <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:call-template name="xhtml_i18n"/>
      <xsl:call-template name="xhtml_events"/>
   </xsl:element>  <!-- hr -->
</xsl:template>

<xsl:template match="dl">
   <xsl:element name="dl">
      <xsl:call-template name="xhtml_i18n"/>
      <xsl:call-template name="xhtml_events"/>
      <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:apply-templates/>
   </xsl:element>  <!-- dl -->
</xsl:template>

<xsl:template match="dt">
   <xsl:element name="dt">
      <xsl:call-template name="xhtml_i18n"/>
      <xsl:call-template name="xhtml_events"/>
      <xsl:apply-templates/>
   </xsl:element>  <!-- dt -->
</xsl:template>

<xsl:template match="dd">
   <xsl:element name="dd">
   <!-- begin xhtml1-strict attrs -->
      <xsl:call-template name="xhtml_i18n"/>
      <xsl:call-template name="xhtml_events"/>
      <xsl:apply-templates/>
   </xsl:element>  <!-- dd -->
</xsl:template>


<xsl:template match="p">
   <xsl:element name="p">
   <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="scriptElement//p">
	<p style="margin-left:0px">
      <xsl:apply-templates/>
   </p>
</xsl:template>

<xsl:template match="scriptElement//ol">
   <ol style="margin-left:0px">
	<xsl:apply-templates/>
   </ol>
</xsl:template>

<xsl:template match="hint[@type]">
	<div style="border-left:solid thin #003366;border-top:solid thin #003366;max-width:300px;margin-left:150px; background: #96db7f; border-right: solid thick #003366; border-bottom: solid thick #003366;">
	<p style="font-variant:small-caps;margin-left:10px;font-weight:bold;color:#003366;"><xsl:value-of select="@type"/>:</p>
		<xsl:apply-templates/>
	</div>
</xsl:template>

<xsl:template match="hint[@type='TODO']" priority="1">
	<div style="border-left:solid thin #003366;border-top:solid thin #003366;max-width:500px;margin-left:150px; background: #96db7f; border-right: solid thick #003366; border-bottom: solid thick #003366;">
	<p style="font-variant:small-caps;margin-left:10px;font-weight:bold;color:#003366;"><a href="http://www.jeckle.de/todo/index.html">TODO ... Hier fehlt noch etwas ...</a>:</p><xsl:apply-templates/>
	</div>
</xsl:template>

<xsl:template match="hint[@type='inline']" priority="1">
	<em><a href="http://www.jeckle.de/todo/index.html">TODO<xsl:if test="@text!=''"> <small>(<xsl:value-of select="@text"/>)</small></xsl:if></a></em>
</xsl:template>


<xsl:template match="hint//p">
	<p style="margin-left:20px;">
		<xsl:apply-templates/>
	</p>
</xsl:template>


<xsl:template match="br">
   <xsl:element name="br">
      <xsl:if test="@style != ''">
         <xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@clear = 'all'">
         <xsl:message terminate="no">
&err; clear attribute on br tags is deprecated use CSS definition instead
         </xsl:message>
         <xsl:call-template name="xhtml_coreattrs"/>
      </xsl:if>
   </xsl:element>
</xsl:template>

<xsl:template match="img">
   <xsl:element name="img">
      <!-- required attributes -->
      <xsl:choose>
         <xsl:when test="@noPrefix = 'yes'">
            <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
         </xsl:when>
         <xsl:otherwise>
            <xsl:attribute name="src">http://www.jeckle.de/images/<xsl:value-of select="@src"/></xsl:attribute>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
      <!-- optional attributes -->
      <xsl:if test="@height != ''">
         <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@width != ''">
         <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@border != ''">
         <xsl:attribute name="border"><xsl:value-of select="@border"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@usemap != ''">
         <xsl:attribute name="usemap"><xsl:value-of select="@usemap"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@longdesc != ''">
         <xsl:attribute name="longdesc"><xsl:value-of select="@longdesc"/></xsl:attribute>
      </xsl:if>
      <xsl:call-template name="xhtml_coreattrs"/>
   </xsl:element>
</xsl:template>

<xsl:template match="debug">
   <xsl:message><xsl:value-of select="."/></xsl:message>
</xsl:template>

<xsl:template match="b">
   <xsl:element name="b">
      <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="strong">
   <strong><xsl:apply-templates/></strong>
</xsl:template>

<xsl:template match="i">
   <i><xsl:apply-templates/></i>
</xsl:template>

<xsl:template match="em">
   <em><xsl:apply-templates/></em>
</xsl:template>

<xsl:template match="code">
   <code><xsl:apply-templates/></code>
</xsl:template>

<xsl:template match="pre">
   <pre>
   <xsl:apply-templates/>
   </pre>
</xsl:template>

<xsl:template match="sup">
   <sup>
   <xsl:apply-templates />
   </sup>
</xsl:template>

<xsl:template match="sub">
   <sub>
   <xsl:apply-templates/>
   </sub>
</xsl:template>

<xsl:template match="blink">
   <xsl:message terminate="no">
&wng; "blink" tag is not standard, it will be ignored
   </xsl:message>
   <xsl:apply-templates/>
</xsl:template>

<xsl:template match="marquee">
   <xsl:message terminate="no">
&wng; marquee tag is not standard, it will be irgnored
   </xsl:message>
   <xsl:apply-templates/>
</xsl:template>

<xsl:template match="navpage|navdown|navup" mode="prefixLinks">
    <xsl:if test="not(contains(@destinationuri,'#'))">
        <link rel="prefetch" href="{@destinationuri}"/>
    </xsl:if>
</xsl:template>

<xsl:template match="document/head">
   <head>
      <xsl:comment>Generated using stylesheet version: <xsl:value-of select="$stylesheet-version"/>
      Transformed with Saxon v<xsl:value-of select="$saxonVer"/> using Java <xsl:value-of select="$javaVer"/></xsl:comment>
      <link rel="shortcut icon" href="http://www.jeckle.de/favicon.ico" type="image/x-icon"/>
      <link rel="icon" href="http://www.jeckle.de/favicon.ico" type="image/x-icon"/>

      <xsl:apply-templates select="//navpage|//navdown|//navup" mode="prefixLinks"/>
      <xsl:apply-templates/>
      <title>
         <xsl:value-of select="$pagetitle"/>
      </title>
   </head>
</xsl:template>

<xsl:template match="metatags/link" priority="2">
	<link
		rel="{@rel}"
		type="{@type}"
		title="{@title}"
		href="{@href}"/>
</xsl:template>

<xsl:template match="head/metatags">
   <!-- enable JavaScript -->
   <meta http-equiv="content-script-type" content="text/javascript" />
   <xsl:element name="script">
      <xsl:attribute name="type">text/javascript</xsl:attribute>
      <xsl:attribute name="language">JavaScript</xsl:attribute>
      <xsl:attribute name="src">http://www.jeckle.de/style/jeckle.js</xsl:attribute>
   </xsl:element>

   <!-- prevent usage of smart tags -->
   <meta name="MSSMartTagsPreventParsing" content="TRUE"/>

   <!-- Dublin Core elements -->
   <meta name="DC.Title" content="{$pagetitle}"/>
   <meta name="DC.Subject" content="{$pagetitle}"/>
   <meta name="DC.Keywords" content="{@keywords}"/>
   <meta name="DC.Description" content="{@description}"/>
   <meta name="DC.Identifier" content="{@url}"/>
   <meta name="DC.Creator" content="&mcj;"/>
   <meta name="DC.Publisher" content="&mcj;"/>
   <xsl:element name="meta">
    <xsl:attribute name="DC.Type">
        <xsl:choose>
            <xsl:when test="@type">
                <xsl:value-of select="@type"/>
            </xsl:when>
            <xsl:otherwise>text</xsl:otherwise>
        </xsl:choose>
    </xsl:attribute>
   </xsl:element>
   <meta name="DC.Format" content="text/xml"/>
   <meta name="DC.Source" content="&mcjurl;"/>
   <meta name="DC.Language" content="de"/>
   <meta name="DC.Rights" content="copyright by &mcj;"/>

   <xsl:element name="meta">
      <xsl:attribute name="name">DC.Date</xsl:attribute>
      <xsl:attribute name="content"><xsl:value-of xmlns:date="./ISODate" select="date:readDate()"/></xsl:attribute>
   </xsl:element>
   <xsl:element name="meta">
      <xsl:attribute name="name">Date-Creation-yyyymmdd</xsl:attribute>
      <xsl:attribute name="content"><xsl:value-of xmlns:date="./ISODate" select="date:readDate()"/></xsl:attribute>
   </xsl:element>
   <xsl:element name="meta">
      <xsl:attribute name="name">DateModified</xsl:attribute>
      <xsl:attribute name="content"><xsl:value-of xmlns:date="./ISODate" select="date:readDate()"/></xsl:attribute>
   </xsl:element>
   <xsl:element name="meta">
      <xsl:attribute name="name">date</xsl:attribute>
      <xsl:attribute name="content"><xsl:value-of xmlns:date="./ISODate" select="date:readDate()"/></xsl:attribute>
   </xsl:element>

   <!-- end of DC elements -->

   <meta name="page-topic" content="{@description}"/>
   <meta name="description" content="{@description}"/>
   <meta name="abstract" content="{@description}"/>
   <meta name="keywords" content="{@keywords}"/>
   <meta name="author" content="&mcj;" />
   <meta name="generator" content="generated using XSLT transformations by &mcj;"/>

   <!-- mozilla site navigation -->
   <link rel="home" href="http://www.&mcjurl;" />
   <link rel="author" href="http://www.jeckle.de/mario.html" />
   <link rel="top" href="http://www.jeckle.de" />
   <link rel="help" href="http://www.jeckle.de/about.html#navigation"/>
   <link rel="contents" href="http://www.jeckle.de/sitemap.html"/>
   <link rel="search" href="http://www.jeckle.de/search/index.html" />
   <link rel="jeckle.de" href="http://www.jeckle.de/news.html" title="Neues auf jeckle.de"/>
   <link rel="jeckle.de" href="http://www.jeckle.de/sitemap.html" title="Sitemap"/>
   <link rel="jeckle.de" href="http://www.jeckle.de/feedback.html" title="Feedback"/>
   <link rel="jeckle.de" href="http://www.jeckle.de/dialog.html" title="Mail an Mario"/>
   <link rel="jeckle.de" href="http://www.jeckle.de/impressum.html" title="Impressum"/>
	<link rel="jeckle.de" href="http://www.jeckle.de/rdf/{$RDFResultFileName}" title="RDF-Beschreibung dieser Seite"/>
   <link id="meta" rel="rel:meta" href="http://www.w3.org/2000/08/w3c-synd/#meta" />
  	<link rel="meta" href="http://www.jeckle.de/rdf/{$RDFResultFileName}" />
   <xsl:apply-templates select="//topic[@name]" mode="siteNavigation"/>
   <xsl:apply-templates select="//subtopic[@name]" mode="siteNavigation"/>
   <xsl:apply-templates select="//subsubtopic[@name]" mode="siteNavigation"/>
   <xsl:apply-templates select="//navup[1]" mode="siteNavigation"/>
   <xsl:apply-templates select="//navdown" mode="siteNavigation"/>
   <!-- mozilla site navigation ends -->

   <meta name="IDENTIFIER-URL" content="http://www.&mcjurl;" />
   <meta name="CreatorHomepage" content="http://www.&mcjurl;" />
   <meta name="PUBLISHER-EMAIL" content="mario@jeckle.de" />

    <meta name="DC.Language" content="de"/>
   <meta http-equiv="content-language" content="de" />
   <meta http-equiv="content-type" content="text/html; charset='ISO-8859-1'" />
   <meta http-equiv="Bulletin-Text" content="{$pagetitle}"/>

   <xsl:apply-templates />
</xsl:template>

<xsl:template match="topic[@name]" mode="siteNavigation">
	<link rel="chapter" href="#{@name}" title="{.}"/>
</xsl:template>
<xsl:template match="subtopic[@name]" mode="siteNavigation">
	<link rel="section" href="#{@name}" title="{.}"/>
</xsl:template>
<xsl:template match="subsubtopic[@name]" mode="siteNavigation">
	<link rel="subsection" href="#{@name}" title="{.}"/>
</xsl:template>
<xsl:template match="navup[@reference]" mode="siteNavigation">
	<link rel="parent" href="{@destinationuri}" />
</xsl:template>
<xsl:template match="navdown[@reference]" mode="siteNavigation">
	<link rel="bookmark" href="{@destinationuri}" title="{@reference}"/>
</xsl:template>




<xsl:template match="document/head/metatags/meta[@http-equiv='refresh']">
   <meta http-equiv="refresh" content="{@content}"/>
</xsl:template>

<xsl:template match="css">
   <meta http-equiv="content-style-type" content="text/css"/>
   <xsl:element name="link">
      <xsl:attribute name="rel">stylesheet</xsl:attribute>
      <xsl:attribute name="media">screen</xsl:attribute>
      <xsl:attribute name="type">text/css</xsl:attribute>
      <xsl:attribute name="href">http://www.jeckle.de/style/jeckle.css</xsl:attribute>
   </xsl:element>
   <meta http-equiv="content-style-type" content="text/css"/>
   <xsl:element name="link">
      <xsl:attribute name="rel">stylesheet</xsl:attribute>
      <xsl:attribute name="media">projection</xsl:attribute>
      <xsl:attribute name="type">text/css</xsl:attribute>
      <xsl:attribute name="href">http://www.jeckle.de/style/jeckle.css</xsl:attribute>
   </xsl:element>

</xsl:template>

<xsl:template match="javascript">
   <xsl:message terminate="no">
&msg; explicit javascript declaration is obsolete since version  0.8.4.0
   </xsl:message>
</xsl:template>

<xsl:template match="head/metatags/nocache">
   <meta http-equiv="expires" content="60" />
   <meta http-equiv="expires" content="Sat, 14 Dez 1998 12:00 GMT" />
   <meta http-equiv="pragma" content="nocache" />
   <meta http-equiv="pragma" content="no-cache" />
   <meta http-equiv="cache-control" content="private"/>
</xsl:template>

<xsl:template match="head/metatags/robots">
   <xsl:processing-instruction name="robots">index="yes" follow="yes"</xsl:processing-instruction>
   <meta name="robots" content="index"/>
   <meta name="robots" content="follow"/>
   <meta name="revisit-after" content="{@revisit-after}"/>
</xsl:template>

<xsl:template match="head/metatags/robots[@ignore='true']" priority="2">
    <meta name="robots" content="noindex"/>
    <meta name="robots" content="none"/>
    <meta name="robots" content="nofollow"/>
</xsl:template>

<xsl:template match="document/body">
   <xsl:element name="body">
      <xsl:attribute name="style">background-image:url(http://www.jeckle.de/images/headings/<xsl:value-of select="navigation/@titleimage"/>);
 background-repeat:repeat-y;
 background-attachment:fixed;
 background-position:0px 00px;
 background-color:#f0f0f0;</xsl:attribute>
      <xsl:if test="@onload != ''">
         <xsl:attribute name="onload"><xsl:value-of select="@onload"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@onunload != ''">
         <xsl:attribute name="onunload"><xsl:value-of select="@onunload"/></xsl:attribute>
      </xsl:if>
      <a name="pagetop">&#160;</a>
      <xsl:apply-templates/>
        <!-- end of body content -->

         <br /><br /><br />
         <p><xsl:call-template name="writeSeparatorLine"/><br/>
            <small>
                <xsl:if test="not(parent::*/@smallFooter)">Service provided by <a href="MailTo:Mario@jeckle.de">&mcj;</a><br /></xsl:if>
            Generated: <xsl:value-of select="mcj:current('year')"/>-<xsl:value-of select="mcj:current('month')"/>-<xsl:value-of select="mcj:current('day')"/>T<xsl:value-of select="mcj:current('hour')"/>:<xsl:value-of select="mcj:current('minute')"/>:<xsl:value-of select="mcj:current('second')"/>+01:00<br/>
            <xsl:if test="not(parent::*/@smallFooter)"><a onmouseout="status=''; return true;"
                onmouseover="status='Feedback'; return true;"
                href="http://www.jeckle.de/feedback.html">
               <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif"
                  width="12"
                  height="12"
                  border="0"
                  alt="Feedback"/>
            </a>
   <xsl:text disable-output-escaping="no">&#160;</xsl:text>
   <a onmouseout="status=''; return true;"
    onmouseover="status='Feedback'; return true;"
    href="http://www.jeckle.de/feedback.html">Feedback</a>
      <xsl:text disable-output-escaping="no">&#160;&#160;&#160;&#160;&#160;&#160;&#160;</xsl:text>
      <a onmouseout="status=''; return true;"
        onmouseover="status='SiteMap'; return true;"
        href="http://www.jeckle.de/sitemap.html">
         <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif"
              width="12"
              height="12"
              border="0"
              alt="SiteMap"/>
      </a>
      <xsl:text disable-output-escaping="no">&#160;</xsl:text>
      <a onmouseout="status=''; return true;"
        onmouseover="status='SiteMap'; return true;"
        href="http://www.jeckle.de/sitemap.html">SiteMap</a>
     <br/></xsl:if>
     <a href="{//metatags/@url}">
     <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif"
                  width="12"
                  height="12"
                  border="0"
                  alt="This page's original location"/></a>
          <xsl:text disable-output-escaping="no">&#160;</xsl:text>
        <a href="{//metatags/@url}">This page's original location: <xsl:value-of select="//metatags/@url"/></a>
		<br/>
     <a href="http://www.jeckle.de/rdf/{$RDFResultFileName}">
     <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif"
                  width="12"
                  height="12"
                  border="0"
                  alt="RDF metadata describing this page"/></a>
          <xsl:text disable-output-escaping="no">&#160;</xsl:text>
        <a href="http://www.jeckle.de/rdf/{$RDFResultFileName}">RDF description for this page</a>
     </small></p>

   <br /><br />
   </xsl:element>
</xsl:template>

<xsl:template match="content">
   <xsl:message terminate="no">
&msg; content-tag is deprectated and out of order
   </xsl:message>

   <xsl:apply-templates/>
</xsl:template>

<xsl:template match="document/body/navigation">
   <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
      <xsl:attribute name="width">1</xsl:attribute>
      <xsl:attribute name="height">30</xsl:attribute>
      <xsl:attribute name="alt"/>
   </xsl:element>
   <table border="0">
      <tr>
         <td><xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
      <xsl:attribute name="width">250</xsl:attribute>
      <xsl:attribute name="height">1</xsl:attribute>
      <xsl:attribute name="alt"/>
   </xsl:element></td>
         <td align="left">
            <xsl:apply-templates/>
            <xsl:element name="img">
               <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
               <xsl:attribute name="width">1</xsl:attribute>
               <xsl:attribute name="height">30</xsl:attribute>
               <xsl:attribute name="alt"/>
            </xsl:element>
         </td>
      </tr>
   </table>
</xsl:template>

<xsl:template match="document/body/navigation/navup">
      <div class="navi">
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(@reference, $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
         <xsl:attribute name="href"><xsl:value-of select="@destinationuri"/></xsl:attribute>
         <xsl:element name="img">
            <xsl:attribute name="src">http://www.jeckle.de/images/navigation/pf_ob_gr.gif</xsl:attribute>
            <xsl:attribute name="alt"><xsl:value-of select="@reference"/></xsl:attribute>
            <xsl:attribute name="width">12</xsl:attribute>
            <xsl:attribute name="height">12</xsl:attribute>
            <xsl:attribute name="border">0</xsl:attribute>
         </xsl:element>
            <xsl:text disable-output-escaping="no">&#160;</xsl:text>
            <xsl:value-of select="@reference"/>
      </xsl:element>
            <xsl:apply-templates/>
      </div>
</xsl:template>

<xsl:template match="document/body/navigation/navdown">
   <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
      <xsl:attribute name="width">1</xsl:attribute>
      <xsl:attribute name="height">10</xsl:attribute>
      <xsl:attribute name="alt"/>
   </xsl:element>

      <div class="navi">
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(@reference, $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
         <xsl:attribute name="href"><xsl:value-of select="@destinationuri"/></xsl:attribute>
         <xsl:element name="img">
            <xsl:attribute name="src">http://www.jeckle.de/images/navigation/pf_re_gr.gif</xsl:attribute>
            <xsl:attribute name="alt"><xsl:value-of select="@reference"/></xsl:attribute>
            <xsl:attribute name="width">12</xsl:attribute>
            <xsl:attribute name="height">12</xsl:attribute>
            <xsl:attribute name="border">0</xsl:attribute>
         </xsl:element>
         <xsl:text disable-output-escaping="no">&#160;</xsl:text>
            <xsl:value-of select="@reference"/>
      </xsl:element>
      <xsl:apply-templates/>
      </div>
</xsl:template>

<xsl:template match="document/body/navigation/navpage">
   <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
      <xsl:attribute name="width">1</xsl:attribute>
      <xsl:attribute name="height">10</xsl:attribute>
      <xsl:attribute name="alt"/>
   </xsl:element>
     <div class="navi">
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(@reference, $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
         <xsl:attribute name="href"><xsl:value-of select="@destinationuri"/></xsl:attribute>
         <xsl:element name="img">
            <xsl:attribute name="src">http://www.jeckle.de/images/navigation/pf_un_gr.gif</xsl:attribute>
            <xsl:attribute name="alt"><xsl:value-of select="@reference"/></xsl:attribute>
            <xsl:attribute name="width">12</xsl:attribute>
            <xsl:attribute name="height">12</xsl:attribute>
            <xsl:attribute name="border">0</xsl:attribute>
         </xsl:element>
         <xsl:text disable-output-escaping="no">&#160;</xsl:text>
            <xsl:value-of select="@reference"/>
      </xsl:element>
            <xsl:apply-templates/>
      </div>
</xsl:template>

<xsl:template match="document/body/navigation/navseparator">
   <br />
      <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/line.gif</xsl:attribute>
      <xsl:attribute name="width">500</xsl:attribute>
      <xsl:attribute name="height">1</xsl:attribute>
      <xsl:attribute name="alt"/>
   </xsl:element>
   <br />
</xsl:template>

<xsl:template match="separator">
   <xsl:call-template name="makeSeparator"/>
</xsl:template>

<xsl:template name="makeSeparator">
   <br />
   <p style="text-align: center; ">
      <xsl:element name="img">
         <xsl:attribute name="src">http://www.jeckle.de/images/line.gif</xsl:attribute>
         <xsl:attribute name="width">600</xsl:attribute>
         <xsl:attribute name="height">1</xsl:attribute>
         <xsl:attribute name="alt"/>
      </xsl:element>
   </p>
   <br />
</xsl:template>

<xsl:template match="topic">
   <xsl:element name="h1">
   	<xsl:if test="name(preceding-sibling::*[1])!='topic' and $mode='presentation'">
   		<xsl:attribute name="style">page-break-before:always</xsl:attribute>
      </xsl:if>
      <xsl:call-template name="back2top"/>
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(., $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
         <xsl:call-template name="copyAttribIfExist">
            <xsl:with-param name="attName">name</xsl:with-param>
         </xsl:call-template>
         <xsl:attribute name="href">#pagetop</xsl:attribute>
         <xsl:text disable-output-escaping="no">&#160;&#160;&#160;</xsl:text>
         <xsl:if test="parent::region[@numbered = 'yes'] and not(@unnumbered)">
            <xsl:number count="region[@numbered='yes']" format="1.1"/>&#160;
         </xsl:if>
         <xsl:if test="@singleLevelNumber='yes'"><xsl:number count="topic" level="single" format="1"/>&#160;</xsl:if>
         <xsl:apply-templates/>
      </xsl:element> <!-- a -->
   </xsl:element> <!-- h1 -->

   <table class="head" width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
	<tr><td>&#160;</td></tr>
   <tr>
   <td width="40%"/>
   <td width="60%" bgcolor="#96db7f"><img src="http://www.jeckle.de/images/dummy.gif" width="0" height="1" border="0"/></td>
   </tr>
   </table>
<br clear="all"/>
</xsl:template>

<xsl:template match="region">
   <xsl:apply-templates/>
</xsl:template>

<xsl:template match="@presentationBreak[.='true' and $mode='presentation']">
	<xsl:attribute name="style">page-break-before:always</xsl:attribute>
</xsl:template>

<xsl:template match="subtopic">
   <xsl:element name="h2">
      <xsl:if test="count(preceding-sibling::subtopic)!=0 and $mode='presentation'">
      	<xsl:attribute name="style">page-break-before:always</xsl:attribute>
      </xsl:if>
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="normalize-space(replace(., $search, $replacement))"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
            <xsl:if test="@name != ''">
               <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
            </xsl:if>

            <xsl:if test="parent::region[@numbered = 'yes'] and not(@unnumbered)">
               <xsl:number count="region[@numbered='yes']" format="1"/>.<xsl:number level="multiple" count="region[@numbered='yes']/subtopic[not(@unnumbered)]" format="1"/> &#160;
            </xsl:if>

            <xsl:if test="@singleLevelNumber='yes'"><xsl:number count="subtopic" level="single" format="1"/>.&#160;</xsl:if>
            <xsl:if test="@multiLevelNumber='yes'"><xsl:value-of select="count(preceding::topic)"/>.<xsl:value-of select="count(preceding-sibling::topic[1]/following-sibling::subtopic)-count(following-sibling::subtopic)"/> &#160;</xsl:if>
         <xsl:apply-templates/>
      </xsl:element> <!-- a -->
   </xsl:element>
</xsl:template>

<xsl:template match="subsubtopic">
   <xsl:element name="h3">
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="."/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
            <xsl:if test="@name != ''">
               <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
            </xsl:if>
            <xsl:if test="@singleLevelNumber='yes' and @type='roman' and preceding::subtopic"><xsl:number count="subsubtopic" level="single" format="I"/>)&#160;</xsl:if>
         <xsl:apply-templates/>
      </xsl:element> <!-- a -->
   </xsl:element>
</xsl:template>

<xsl:template match="subsubsubtopic">
   <xsl:element name="h4">
      <xsl:element name="a">
         <xsl:attribute name="onmouseover">status='<xsl:value-of select="replace(., $search, $replacement)"/>'; return true;</xsl:attribute>
         <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
         <xsl:call-template name="copyAttribIfExist">
            <xsl:with-param name="attName">name</xsl:with-param>
         </xsl:call-template>
         <xsl:apply-templates/>
      </xsl:element> <!-- a -->
   </xsl:element>
</xsl:template>


<xsl:template match="scriptElement//tabular">
   <xsl:element name="table">
      <xsl:attribute name="border">0</xsl:attribute>
      <xsl:attribute name="cellspacing">0</xsl:attribute>

      <xsl:attribute name="width">
      <xsl:choose>
            <xsl:when test="@width != ''"><xsl:value-of select="@width"/></xsl:when>
            <xsl:otherwise>100%</xsl:otherwise>
         </xsl:choose>
      </xsl:attribute>

   <tr>
      <td>
      <!-- separator column in order to realize CSS's margin-left like behaviour -->
      <xsl:element name="img">
           <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
           <xsl:attribute name="width">10</xsl:attribute>
           <xsl:attribute name="height">0</xsl:attribute>
           <xsl:attribute name="border">0</xsl:attribute>
           <xsl:attribute name="alt"/>
         </xsl:element>
    </td>
   <td>
      <xsl:element name="table">
      <xsl:attribute name="border">0</xsl:attribute>
      <xsl:attribute name="width">600</xsl:attribute>
      <xsl:attribute name="cellspacing">0</xsl:attribute>
      <xsl:attribute name="summary"><xsl:value-of select="@summary"/></xsl:attribute>
   <xsl:apply-templates/>
   </xsl:element>
   </td></tr></xsl:element>


</xsl:template>

<xsl:template match="tabular">
   <xsl:element name="table">
      <xsl:attribute name="border">0</xsl:attribute>
      <xsl:attribute name="cellspacing">0</xsl:attribute>

      <xsl:attribute name="width">
      <xsl:choose>
            <xsl:when test="@width != ''"><xsl:value-of select="@width"/></xsl:when>
            <xsl:otherwise>100%</xsl:otherwise>
         </xsl:choose>
      </xsl:attribute>

   <tr>
      <td>
      <!-- separator column in order to realize CSS's margin-left like behaviour -->
      <xsl:element name="img">
           <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
           <xsl:attribute name="width">150</xsl:attribute>
           <xsl:attribute name="height">0</xsl:attribute>
           <xsl:attribute name="border">0</xsl:attribute>
           <xsl:attribute name="alt"/>
         </xsl:element>
    </td>
   <td>
      <xsl:element name="table">
      <xsl:attribute name="border">0</xsl:attribute>
      <xsl:attribute name="width">100%</xsl:attribute>
      <xsl:attribute name="cellspacing">0</xsl:attribute>
      <xsl:attribute name="summary"><xsl:value-of select="@summary"/></xsl:attribute>
   <xsl:apply-templates/>
   </xsl:element>
   </td></tr></xsl:element>
</xsl:template>

<xsl:template match="thead">
   <thead>
      <xsl:apply-templates/>
   </thead>
</xsl:template>

<xsl:template match="div">
   <xsl:element name="div">
      <xsl:if test="@class != ''">
         <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@style != ''">
         <xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@align != ''">
         <xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute>
      </xsl:if>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="tabular/head">
   <thead>
      <tr>
      <xsl:apply-templates/>
      </tr>
      <tr>
      <xsl:element name="td">
         <xsl:attribute name="colspan"><xsl:value-of select="@length"/></xsl:attribute>
         <xsl:attribute name="height">0</xsl:attribute>
         <xsl:attribute name="bgcolor">#96db7f</xsl:attribute>
         <xsl:element name="img">
            <xsl:attribute name="height">0</xsl:attribute>
            <xsl:attribute name="width">0</xsl:attribute>
             <xsl:attribute name="border">0</xsl:attribute>
            <xsl:attribute name="src">http://www.jeckle.de/images/dummy.gif</xsl:attribute>
         </xsl:element>
      </xsl:element>
   </tr>
   </thead>
</xsl:template>

<xsl:template match="tabular/head/column">
   <xsl:element name="th">
	   <xsl:call-template name="copyAttribIfExist">
	      <xsl:with-param name="attName">width</xsl:with-param>
	   </xsl:call-template>
      <xsl:attribute name="height">50</xsl:attribute>
	   <xsl:call-template name="copyAttribIfExist">
	      <xsl:with-param name="attName">colspan</xsl:with-param>
	   </xsl:call-template>
	   <xsl:call-template name="copyAttribIfExist">
	      <xsl:with-param name="attName">width</xsl:with-param>
	   </xsl:call-template>
    <xsl:element name="div">
    	<xsl:attribute name="class">tabhead</xsl:attribute>
	   <xsl:call-template name="copyAttribIfExist">
	      <xsl:with-param name="attName">style</xsl:with-param>
	   </xsl:call-template>
      <xsl:value-of select="@title"/>
    </xsl:element>
   </xsl:element>
</xsl:template>

<xsl:template match="tabular/body">
   <tbody>
	   <xsl:apply-templates/>
   </tbody>
</xsl:template>

<xsl:template match="tabular/body[//sortcell[@sortCrit]]" priority="3">
   <tbody>
   <xsl:apply-templates>
      <xsl:sort data-type="text" order="ascending" select="sortcell/@sortCrit"/>
   </xsl:apply-templates>
   </tbody>
</xsl:template>

<xsl:template match="tabular/body[//sortcell]" priority="2">
   <tbody>
   <xsl:apply-templates>
      <xsl:sort data-type="text" order="ascending" select="sortcell"/>
   </xsl:apply-templates>
   </tbody>
</xsl:template>

<xsl:template match="tabular/body[@sort='desc']">
   <tbody>
    <xsl:apply-templates>
       <xsl:sort data-type="text" order="descending" select="sortcell"/>
    </xsl:apply-templates>
   </tbody>
</xsl:template>


<xsl:template match="scriptElement[@type='table']//row | tabular/body/row">
   <tr>
      <xsl:apply-templates/>
   </tr>
</xsl:template>

<xsl:template match="tabular/body/row/cell">
   <xsl:element name="td">
	   <xsl:call-template name="copyAttribIfExist">
	      <xsl:with-param name="attName">rowspan</xsl:with-param>
	   </xsl:call-template>
      <xsl:element name="div">
      	<xsl:attribute name="class">tab</xsl:attribute>
 		   <xsl:call-template name="copyAttribIfExist">
		      <xsl:with-param name="attName">style</xsl:with-param>
		   </xsl:call-template>
         <xsl:apply-templates/>
      </xsl:element>
   </xsl:element>
</xsl:template>

<xsl:template match="tabular/body/row/sortcell">
   <td>
      <div class="tab">
         <xsl:apply-templates/>
      </div>
   </td>
</xsl:template>


<!-- sorted list -->
<xsl:template match="sl[@sort='desc']">
   <ul>
      <xsl:apply-templates select="li">
         <xsl:sort data-type="text" order="descending" select="."/>
      </xsl:apply-templates>
   </ul>
</xsl:template>

<xsl:template match="sl">
   <ul>
      <xsl:apply-templates select="li">
         <xsl:sort data-type="text" order="ascending" select="."/>
      </xsl:apply-templates>
   </ul>
</xsl:template>

<xsl:template match="sl[@data-type='number']">
   <ul>
      <xsl:apply-templates select="li">
         <xsl:sort data-type="number" order="ascending" select="."/>
      </xsl:apply-templates>
   </ul>
</xsl:template>


<xsl:template match="sl[li[@sortCrit]]" priority="2">
   <ul>
      <xsl:apply-templates select="li[@sortCrit]">
         <xsl:sort data-type="text" order="ascending" select="@sortCrit"/>
      </xsl:apply-templates>
   </ul>
</xsl:template>


<!-- end sorted list -->

<xsl:template match="li">
  <li>
    <xsl:apply-templates/>
  </li>
</xsl:template>

<xsl:template match="acronym">
   <xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="span">
   <xsl:element name="span">
      <xsl:call-template name="xhtml_coreattrs"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="small">
   <small>
   <xsl:apply-templates/>
   </small>
</xsl:template>

<xsl:template match="select">
    <xsl:element name="select">
        <xsl:apply-templates select="@name" />
        <xsl:apply-templates select="@size" />
        <xsl:apply-templates />
    </xsl:element>
</xsl:template>

<xsl:template match="*/@name">
    <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@rows">
    <xsl:attribute name="rows"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@cols">
    <xsl:attribute name="cols"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@style">
    <xsl:attribute name="style"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>


<xsl:template match="option">
    <option><xsl:apply-templates/></option>
</xsl:template>

<xsl:template match="form">
   <xsl:element name="form">
	     <xsl:call-template name="xhtml_coreattrs"/>
        <xsl:apply-templates select="@method"/>
        <xsl:apply-templates select="@action"/>
      <xsl:apply-templates select="@enctype"/>
      <xsl:apply-templates />
   </xsl:element>
</xsl:template>

<xsl:template match="*/@method">
    <xsl:attribute name="method"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@action">
    <xsl:attribute name="action"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>


<xsl:template match="*/@enctype">
    <xsl:attribute name="enctype"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@src">
    <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@size">
    <xsl:attribute name="size"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@border">
    <xsl:attribute name="border"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@width">
    <xsl:attribute name="width"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@height">
    <xsl:attribute name="height"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>


<xsl:template match="*/@checked">
    <xsl:attribute name="checked">checked</xsl:attribute>
</xsl:template>

<xsl:template match="*/@type">
    <xsl:attribute name="type"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@value">
    <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>

<xsl:template match="*/@onclick">
    <xsl:attribute name="{name(.)}"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>


<xsl:template match="input">
   <xsl:element name="input">
      <xsl:apply-templates select="@onclick"/>
      <xsl:apply-templates select="@type"/>
      <xsl:apply-templates select="@name"/>
      <xsl:apply-templates select="@value"/>
      <xsl:apply-templates select="@checked"/>
      <xsl:apply-templates select="@src"/>
      <xsl:apply-templates select="@size"/>
      <xsl:apply-templates select="@border"/>
      <xsl:apply-templates select="@width"/>
      <xsl:apply-templates select="@height"/>
      <xsl:apply-templates select="@style"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="script">
   <script type="text/javascript">
      <xsl:apply-templates/>
   </script>
</xsl:template>

<xsl:template match="object">
   <xsl:element name="object">
      <xsl:attribute name="classid"><xsl:value-of select="@classid"/></xsl:attribute>
      <xsl:attribute name="codetype"><xsl:value-of select="@codetype"/></xsl:attribute>
   </xsl:element>
</xsl:template>


<!-- *********************************************** -->
<!-- warnings when deprecated HTML elements are used -->
<xsl:template match="basefont">
   <xsl:message terminate="no">
&wng; "basefont" element is deprecated and will be ignored
   </xsl:message>
</xsl:template>

<xsl:template match="center">
   <xsl:message terminate="no">
&wng; "center" element is deprecated and will be substituted by CSS definition
   </xsl:message>
   <p style="text-align: center; ">
   <!-- to replace p tag with style attribute in the future
   <span style="text-align: center; ">
   -->
      <xsl:apply-templates/>
   <!--
   </span>
   -->
   </p>

</xsl:template>

<xsl:template match="font">
   <xsl:message terminate="no">
&wng; "font" element is deprecated and will be ignored
   </xsl:message>
</xsl:template>

<xsl:template match="s">
   <xsl:message terminate="no">
&wng; "s" element is deprecated and will be ignored
   </xsl:message>
</xsl:template>

<xsl:template match="strike">
   <span style="text-decoration:line-through;"><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match="u">
   <xsl:message terminate="no">
&wng; "u" element is deprecated and will be substituted by CSS definition
   </xsl:message>
   <span style="text-decoration:underline">
      <xsl:apply-templates/>
   </span>
</xsl:template>

<xsl:template match="font[@color]">
   <xsl:message terminate="no">
&wng; font tag using color attribute is deprecated and will be substituted by CSS definition
   </xsl:message>
   <xsl:element name="span">
      <xsl:attribute name="style">color: <xsl:value-of select="@color"/></xsl:attribute>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="applet">
   <xsl:message terminate="no">
&wng; "applet" element is deprecated in favour of "object"
   </xsl:message>
<xsl:element name="applet">
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">code</xsl:with-param>
   </xsl:call-template>
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">archive</xsl:with-param>
   </xsl:call-template>
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">width</xsl:with-param>
   </xsl:call-template>
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">height</xsl:with-param>
   </xsl:call-template>
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">codebase</xsl:with-param>
   </xsl:call-template>
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">align</xsl:with-param>
   </xsl:call-template>
   <xsl:apply-templates/>
</xsl:element>
</xsl:template>

<xsl:template match="applet/param">
   <xsl:element name="param">
   <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">name</xsl:with-param>
   </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
      <xsl:with-param name="attName">value</xsl:with-param>
   </xsl:call-template>
   </xsl:element>
</xsl:template>

<xsl:template match="dir">
   <xsl:message terminate="yes">
&err; "dir" element is deprecated in favour of "ul"
   &TransformationAbort;
   </xsl:message>
</xsl:template>

<xsl:template match="isindex">
   <xsl:message terminate="yes">
&err; "isindex" element is deprecated in favour of "input"
   &TransformationAbort;
   </xsl:message>
</xsl:template>

<xsl:template match="menu">
   <xsl:message terminate="yes">
&err; "menu" element is deprecated in favour of "ul"
   &TransformationAbort;
   </xsl:message>
</xsl:template>

<xsl:template match="picture[@href]" priority="1">
    <div style="text-align:center;">
        <a href="{@href}">
            <img src="http://www.jeckle.de/images/{@src}"/>
        </a>
    </div>
</xsl:template>

<xsl:template match="picture[@src]">
    <div style="text-align:center;">
        <img src="http://www.jeckle.de/images/{@src}"/>
    </div>
</xsl:template>


<xsl:template match="iframe">
   <xsl:message terminate="no">
&wng; "iframe" is deprecated
   </xsl:message>
   <xsl:element name="iframe">
      <xsl:if test="@longdesc != ''">
         <xsl:attribute name="longdesc"><xsl:value-of select="@longdesc"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@name != ''">
         <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@title != ''">
         <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@src != ''">
         <xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@frameborder != ''">
         <xsl:attribute name="frameborder"><xsl:value-of select="@frameborder"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@title != ''">
         <xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@marginwidth != ''">
         <xsl:attribute name="marginwidth"><xsl:value-of select="@marginwidth"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@marginheight != ''">
         <xsl:attribute name="marginheight"><xsl:value-of select="@marginheight"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@scrolling != ''">
         <xsl:attribute name="scrolling"><xsl:value-of select="@scrolling"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@align != ''">
         <xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@height != ''">
         <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
      </xsl:if>
      <xsl:if test="@width != ''">
         <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
      </xsl:if>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="back2top">
   <xsl:call-template name="back2top"/>
</xsl:template>

<xsl:template name="back2top">
   <a href="#pagetop">
      <xsl:attribute name="onmouseover">status='back to top'; return true;</xsl:attribute>
      <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
      <xsl:element name="img">
            <xsl:attribute name="src">http://www.jeckle.de/images/navigation/pf_ob_gr.gif</xsl:attribute>
            <xsl:attribute name="alt">back to top</xsl:attribute>
            <xsl:attribute name="border">0</xsl:attribute>
      </xsl:element>
   </a>
   <!-- border attribute is deprecated in HTML v4 and later but needed since Netscape v4 ignores CSS setting -->
</xsl:template>

<xsl:template match="big">
   <big><xsl:apply-templates/></big>
</xsl:template>

<xsl:template match="textarea">
   <xsl:element name="textarea">
      <xsl:apply-templates select="@name"/>
      <xsl:apply-templates select="@rows"/>
      <xsl:apply-templates select="@cols"/>
      <xsl:apply-templates select="@style"/>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="verbatim">
   <code><pre><xsl:apply-templates/></pre></code>
</xsl:template>

<xsl:template match="listing[child::b]" priority="1">
   <code><pre><xsl:apply-templates/></pre></code>
</xsl:template>

<xsl:template match="listing[not(@name)]">
   <xsl:message terminate="yes">&err; Listing element must have a name</xsl:message>
</xsl:template>

<xsl:template match="listing[@name != '']">
   <a name="{@name}"><code><pre><xsl:apply-templates/></pre></code></a>

   <xsl:if test="@caption != ''">
      <p style="text-align: center;">Listing <xsl:number level="any" count="listing[not(@noCaption = 'true')]" format="1" />: <xsl:value-of select="@caption"/></p>
   </xsl:if>
</xsl:template>

<xsl:template match="listRef">
    <xsl:variable name="name" select="@name"/>
    <xsl:value-of select="count(//listing[not(@noCaption = 'true') and following::listing[@name = $name]])+1"/>
</xsl:template>

<xsl:template match="text()[parent::listing and not(preceding-sibling::b or following-sibling::b)]">
   <xsl:call-template name="printLine">
      <xsl:with-param name="line2Print" select="concat(normalize-space(substring(.,1,2)), substring(.,3,string-length(.)), '&#xA;')"/>
   </xsl:call-template>
</xsl:template>

<xsl:template name="printLine">
   <xsl:param name="line2Print"/>
   <xsl:param name="lineNumber">1</xsl:param>

   <xsl:element name="a"><xsl:attribute name="name"><xsl:value-of select="concat(parent::listing/@name,parent::example/@id)"/>line<xsl:value-of select="$lineNumber"/></xsl:attribute>(<xsl:value-of select="$lineNumber"/>)</xsl:element> <xsl:value-of select="substring-before($line2Print, '&#xA;')"/>

    <xsl:choose>
    <xsl:when test="contains($line2Print, '&#xA;')">
        <xsl:text>&#xA;</xsl:text>
        <xsl:call-template name="printLine">
            <xsl:with-param name="line2Print" select="substring-after($line2Print, '&#xA;')"/>
            <xsl:with-param name="lineNumber" select="$lineNumber+1"/>
        </xsl:call-template>
    </xsl:when>
    <xsl:otherwise><xsl:value-of select="$line2Print"/></xsl:otherwise>
    </xsl:choose>
</xsl:template>


<xsl:template name="writeLimit">
<xsl:param name="endDate"/>
&#160;&#160;&#160;<script type="text/javascript">
      now = new Date();
      year = now.getYear();
      if (year <xsl:text disable-output-escaping="yes">&lt;</xsl:text> 1000)
         year += 1900;
      today=year*10000+(now.getMonth()+1)*100+now.getDate();
      if (<xsl:value-of select="$endDate"/> <xsl:text disable-output-escaping="yes">&gt;=</xsl:text> today)
        document.write('<xsl:element name="img">
            <xsl:attribute name="border">0</xsl:attribute>
            <xsl:attribute name="width">30</xsl:attribute>
            <xsl:attribute name="height">17</xsl:attribute>
            <xsl:attribute name="src">http://www.jeckle.de/images/new.gif</xsl:attribute>
            <xsl:attribute name="alt">added: <xsl:value-of select='@added'/></xsl:attribute>
            </xsl:element>
            <xsl:text disable-output-escaping="yes">');</xsl:text></script>
</xsl:template>

<xsl:template match="new[@added!='']">
   <xsl:call-template name="newElementWriter"/>
</xsl:template>

<xsl:template name="newElementWriter">
<xsl:if xmlns:date="./ISODate" test="number(date:readDate()) - number(concat(substring(@added,1,4),substring(@added,6,2),substring(@added,9,2))) &lt;= 300">

<xsl:choose>
   <xsl:when test="number(substring(@added,6,2))+3 &gt; 12">
      <xsl:variable name="endMonth" select="number((number(substring(@added,6,2)))+3) mod 12"/>
      <xsl:variable name="endYear" select="number(substring(@added,1,4))+1"/>

      <xsl:call-template name="writeLimit">
         <xsl:with-param name="endDate"><xsl:value-of select="$endYear"/>
            <xsl:choose>
               <xsl:when test="$endMonth &lt; 10">0<xsl:value-of select="$endMonth"/></xsl:when>
               <xsl:otherwise><xsl:value-of select="$endMonth"/></xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="substring(@added,9,2)"/>
         </xsl:with-param>
      </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
      <xsl:variable name="endMonth" select="number(substring(@added,6,2))+3"/>
      <xsl:variable name="endYear" select="number(substring(@added,1,4))"/>

      <xsl:call-template name="writeLimit">
         <xsl:with-param name="endDate"><xsl:value-of select="$endYear"/>
            <xsl:choose>
               <xsl:when test="$endMonth &lt; 10">0<xsl:value-of select="$endMonth"/></xsl:when>
               <xsl:otherwise><xsl:value-of select="$endMonth"/></xsl:otherwise>
            </xsl:choose>
            <xsl:value-of select="substring(@added,9,2)"/>
         </xsl:with-param>
      </xsl:call-template>
   </xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>



<xsl:template match="structStart">
<!-- copy of CSS definition for element p -->
   <div style="color:#000000;
        font-family:Verdana,Arial,sans-serif;
        text-align:justify;
        line-height:13pt;
        letter-spacing:0.1mm;
        word-spacing:0.8mm;
        font-size:10pt;
        margin-bottom:5px;
        margin-right:15%;
        margin-left:150px;">
      <xsl:apply-templates/>
   </div>
</xsl:template>

<xsl:template match="structure">
   <div style="margin-left:+20px;"><xsl:number level="multiple" format="1.1 "/>
   <xsl:apply-templates/></div>
</xsl:template>

<xsl:template match="structure/ul">
    <div style="margin-left:+20px;"><xsl:apply-templates/></div>
</xsl:template>

<!-- ignored elements -->
<xsl:template match="pagetitle"/>

<xsl:template match="pathprefix">
    <xsl:message>&msg; remove legacy element pathprefix</xsl:message>
</xsl:template>

<xsl:template match="comment()"/>

<!-- elements without attributs which are just copied -->
<xsl:template match="table">
    <xsl:element name="table">
      <xsl:for-each select="./@*">
          <xsl:variable name="attributeName"><xsl:value-of select="name(.)"/></xsl:variable>
              <xsl:attribute name="{$attributeName}">
               <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

<xsl:template match="tr">
    <xsl:element name="tr">
      <xsl:for-each select="./@*">
          <xsl:variable name="attributeName"><xsl:value-of select="name(.)"/></xsl:variable>
              <xsl:attribute name="{$attributeName}">
               <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

<xsl:template match="th">
    <xsl:element name="th">
      <xsl:for-each select="./@*">
          <xsl:variable name="attributeName"><xsl:value-of select="name(.)"/></xsl:variable>
              <xsl:attribute name="{$attributeName}">
               <xsl:value-of select="."/>
            </xsl:attribute>
        </xsl:for-each>
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

<xsl:template match="tbody">
   <xsl:element name="tbody">
      <xsl:call-template name="xhtml_attrs"/>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">left</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">center</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">right</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">justify</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">char</xsl:with-param>
      </xsl:call-template>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template match="td[.='' and count(child::*)=0]">
<!-- only needed due to Netscape v4.7x inability to render empty td elements correctly -->
<td>&#160;<xsl:apply-templates/></td>
</xsl:template>

<xsl:template match="td">
   <xsl:element name="td">
      <xsl:call-template name="xhtml_attrs"/>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">width</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">height</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">rowspan</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">valign</xsl:with-param>
      </xsl:call-template>
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">colspan</xsl:with-param>
      </xsl:call-template>
      <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

<xsl:template name="graphicContent">
   <xsl:element name="a">
		<xsl:attribute name="style">margin-left:150px;</xsl:attribute>
      <xsl:attribute name="onmouseover">status='click image to enlarge!'; return true;</xsl:attribute>
      <xsl:attribute name="onmouseout">status=''; return true;</xsl:attribute>
      <xsl:choose>
         <xsl:when test="@externalReference != ''">
            <xsl:attribute name="href"><xsl:value-of select="@externalReference"/></xsl:attribute>
         </xsl:when>
         <xsl:otherwise>
            <xsl:attribute name="href">http://www.jeckle.de/images/<xsl:value-of select="@src"/></xsl:attribute>
         </xsl:otherwise>
      </xsl:choose>
      <xsl:element name="img">
         <xsl:attribute name="border">0</xsl:attribute>
         <xsl:if test="@usemap != ''">
            <xsl:attribute name="usemap"><xsl:value-of select="@usemap"/></xsl:attribute>
         </xsl:if>
         <xsl:choose>
            <xsl:when test="@externalReference != ''">
               <xsl:attribute name="src"><xsl:value-of select="@externalReference"/></xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
               <xsl:attribute name="src">http://www.jeckle.de/images/<xsl:value-of select="@src"/></xsl:attribute>
            </xsl:otherwise>
         </xsl:choose>
         <xsl:if test="@width != ''">
            <xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute>
         </xsl:if>
         <xsl:if test="@height != ''">
            <xsl:attribute name="width"><xsl:value-of select="@height"/></xsl:attribute>
         </xsl:if>

         <xsl:attribute name="alt"><xsl:value-of select="@caption"/></xsl:attribute>
         <xsl:attribute name="title"><xsl:value-of select="@caption"/></xsl:attribute>
         <xsl:call-template name="copyAttribIfExist">
            <xsl:with-param name="attName">width</xsl:with-param>
         </xsl:call-template>
      </xsl:element>
   </xsl:element>
</xsl:template>

<!--
<xsl:template match="graphic">
      <xsl:if test="$mode='presentation'">
      	<div style="page-break-before:always"/>
      </xsl:if>
      <xsl:choose>
         <xsl:when test="@name">
            <xsl:element name="a">
               <xsl:attribute name="style">margin-left:150px</xsl:attribute>
               <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
               <xsl:call-template name="graphicContent"/>
            </xsl:element>
         </xsl:when>
         <xsl:otherwise>
            <xsl:call-template name="graphicContent"/>
         </xsl:otherwise>
      </xsl:choose>
   <xsl:choose>
      <xsl:when test="@captionWithoutNumber = 'true'">
          <p style="text-align: center;"><xsl:value-of select="@caption"/> &#160;<small>(<em>click on image to enlarge!</em>)</small></p>
      </xsl:when>
      <xsl:when test="not(@noCaption = 'true')">
       <p style="text-align: center;">
          <xsl:choose>
          <xsl:when test="@name != ''">
             <xsl:element name="a">
                <xsl:attribute name="name">
                   <xsl:value-of select="@name"/>
                </xsl:attribute>
                Abbildung <xsl:number level="any" count="graphic[not(@noCaption = 'true')]" format="1" />: <xsl:value-of select="@caption"/> &#160;<small>(<em>click on image to enlarge!</em>)</small>
             </xsl:element>
          </xsl:when>
          <xsl:otherwise>
             Abbildung <xsl:number level="any" count="graphic[not(@noCaption = 'true')]" format="1" />: <xsl:value-of select="@caption"/> &#160;<small>(<em>click on image to enlarge!</em>)</small>
          </xsl:otherwise>
       </xsl:choose>
       </p>
    </xsl:when>
   </xsl:choose>
</xsl:template>
-->

<xsl:template match="graphic">
      <xsl:if test="$mode='presentation'">
      	<div style="page-break-before:always"/>
      </xsl:if>
    <div style="margin-left:150px;font-size:10pt;font-family:Verdana,Arial,Geneva,sans-serif;{@style}">
        <xsl:if test="@noCapption != true">
        	  <b style="color:#003366;">Abbildung&#160;<xsl:number count="illustration|graphic" level="any" format="1"/></b>:&#160;<em><xsl:value-of select="@caption"/></em><br/>
        </xsl:if>
        <xsl:if test="@src != ''">
        <a name="{@name}" href="http://www.jeckle.de/images/{@src}">
            <img src="http://www.jeckle.de/images/{@src}" width="{@width}" alt="{@caption}" title="{@caption}" border="0"/>
        </a>
        </xsl:if>
        <xsl:if test="@ext != ''">
        <a name="{@name}" href="{@ext}">
            <xsl:element name="img">
            	<xsl:attribute name="src"><xsl:value-of select="@ext"/></xsl:attribute>
        	      <xsl:call-template name="copyAttribIfExist">
         			<xsl:with-param name="attName">width</xsl:with-param>
      			</xsl:call-template>
        	      <xsl:call-template name="copyAttribIfExist">
         			<xsl:with-param name="attName">style</xsl:with-param>
      			</xsl:call-template>
            	<xsl:attribute name="alt"><xsl:value-of select="@caption"/></xsl:attribute>
            	<xsl:attribute name="border">0</xsl:attribute>
            </xsl:element>
		  </a>
		  </xsl:if>
        <br/>
        <xsl:if test="@noCapption != true">
           <div style="font-size:8pt;">(click on image to enlarge!)</div><br/>
    	  </xsl:if>
    </div>
</xsl:template>

<xsl:template match="codeSequence[@name and @src and @caption]">
	<xsl:variable name="src"><xsl:value-of select="@src"/></xsl:variable>
      <xsl:if test="$mode='presentation'">
      	<div style="page-break-before:always"/>
      </xsl:if>
        <a name="{@name}">
		  <table>
		  	<tr style="font-size:10pt;font-family:Verdana,Arial,Geneva,sans-serif;{@style}">
		  		<td><span style="margin-left:150px;font-weight:bold;color:#003366;">Listing&#160;<xsl:number count="codeSequence" level="any" format="1"/></span>:&#160;<em><xsl:value-of select="@caption"/></em></td>
		  	</tr>
		  	<tr>
		  		<td><code><pre>
    	   		<xsl:value-of disable-output-escaping="yes" select="mcj:unparsedText($src)"/>
		  		</pre></code></td>
		  	</tr>
		  </table>
		  </a>
</xsl:template>


<xsl:template match="scriptElement[@type='definition']">
<div style="margin-left:150px;text-align:left;margin-right:15%;">
   <table border="0">
      <tr>
         <td rowspan="2">
               <xsl:element name="img">
                  <xsl:attribute name="src">http://www.jeckle.de/images/xml/icondef.gif</xsl:attribute>
                  <xsl:attribute name="alt">Definition&#160;<xsl:number level="any" count="scriptElement[@type='definition']" format="1"/>: <xsl:value-of select="@title"/></xsl:attribute>
                  <xsl:attribute name="width">50</xsl:attribute>
               </xsl:element>
            </td>
         <td><div class="tabhead"><a name="{@name}">Definition</a>&#160;<xsl:number level="any" count="scriptElement[@type='definition']" format="1"/>: <xsl:value-of select="@title"/></div></td></tr>
         <tr>
         <td>
         <div class="tabelement"><xsl:apply-templates/></div></td>
      </tr>
   </table>
</div>
   <xsl:call-template name="makeSeparator"/>
</xsl:template>


<xsl:template match="scriptElement[@type='table']/body">
<tbody>
   <tr>
   	<xsl:apply-templates select="row"/>
   </tr>
</tbody>
</xsl:template>

<xsl:template match="scriptElement[@type='table']/head">
<thead>
   <xsl:apply-templates select="row"/>
</thead>
</xsl:template>

<xsl:template match="scriptElement[@type='table']/head/row/cell">
   <xsl:element name="td">
      <xsl:call-template name="copyAttribIfExist">
         <xsl:with-param name="attName">width</xsl:with-param>
      </xsl:call-template>
      <div class="tabhead"><xsl:apply-templates/></div>
   </xsl:element>
</xsl:template>

<xsl:template match="scriptElement[@type='table']/body/row/cell" priority="2">
   <xsl:element name="td">
   	<div class="tabelement"><xsl:apply-templates/></div>
   </xsl:element>
</xsl:template>

<xsl:template match="scriptElement[@type='table']">
<xsl:element name="div">
   <xsl:attribute name="style">
      <xsl:choose>
         <xsl:when test="../../li">
            margin-left:0px;;text-align:left;margin-right:15%;
         </xsl:when>
         <xsl:otherwise>
            margin-left:150px;text-align:left;margin-right:15%;
         </xsl:otherwise>
      </xsl:choose>
   </xsl:attribute>

   <table border="0">
      <tr>
         <td rowspan="2">
            <xsl:element name="img">
                  <xsl:attribute name="src">http://www.jeckle.de/images/xml/icontab.gif</xsl:attribute>
                  <xsl:attribute name="alt">Tabelle&#160; <xsl:number level="any" count="scriptElement[@type='table']" format="1"/>: <xsl:value-of select="@title"/></xsl:attribute>
                  <xsl:attribute name="width">50</xsl:attribute>
               </xsl:element>
            </td>
         <td><div class="tabhead"><a name="{@name}">Tabelle</a>&#160;<xsl:number level="any" count="scriptElement[@type='table']" format="1"/>: <xsl:value-of select="@title"/></div></td></tr>
         <tr>
         <td>
            <table border="1">
               <xsl:apply-templates/>
            </table>
         </td>
      </tr>
   </table>
</xsl:element> <!-- div -->

   <xsl:call-template name="makeSeparator"/>
</xsl:template>

<xsl:template match="spec">
(<a href="http://www.w3.org/TR/REC-xml#{@ref}">In XML-Spezifikation nachschlagen</a>)
</xsl:template>

<xsl:template match="scriptElement[@type='example']">
<xsl:if test="$mode='presentation'">
  	<div style="page-break-before : always"/>
</xsl:if>

<div style="margin-left:150px;text-align:left;">
   <table border="0">
      <tr>
         <td rowspan="2">
            <a name="{@name}">
               <xsl:element name="img">
                  <xsl:attribute name="src">http://www.jeckle.de/images/xml/iconbei.gif</xsl:attribute>
                  <xsl:attribute name="alt">Beispiel <xsl:number count="scriptElement[@type='example']" format="1"/>: <xsl:value-of select="@title"/></xsl:attribute>
                  <xsl:attribute name="width">50</xsl:attribute>
               </xsl:element>
            </a></td>
         <td><div class="tabhead">Beispiel <xsl:number level="any" count="scriptElement[@type='example']" format="1"/>: <xsl:value-of select="@title"/></div></td></tr>
         <tr>
         <td>
            <xsl:choose>
                <xsl:when test="not(@noCode='true')">
                        <code><pre style="margin-left:0px;"><xsl:apply-templates/></pre></code>
                </xsl:when>
                    <xsl:otherwise>
                        <xsl:apply-templates/>
                    </xsl:otherwise>
                </xsl:choose>

            <xsl:if test="@filename != ''">
               <a href="examples/{@filename}"><div class="tabhead">Download des Beispiels</div></a>
            </xsl:if>
            <xsl:if test="@resultfile != ''">
                <a href="examples/{@resultfile}"><div class="tabhead">Download der Ergebnisdatei</div></a>
            </xsl:if>
         </td>
      </tr>
   </table>
</div>
   <xsl:call-template name="makeSeparator"/>
</xsl:template>

<xsl:template match="scriptElement[@type='exercise']">
<div style="margin-left:150px;text-align:left;margin-right:15%;">
   <table border="0">
      <tr>
         <td rowspan="2">
            <a name="{@name}">
               <xsl:element name="img">
                  <xsl:attribute name="src">http://www.jeckle.de/images/xml/iconauf.gif</xsl:attribute>
                  <xsl:attribute name="alt">Übung <xsl:number level='any' count="scriptElement[@type='exercise']" format="1"/>: <xsl:value-of select="@title"/></xsl:attribute>
                  <xsl:attribute name="width">50</xsl:attribute>
               </xsl:element>
            </a></td>
         <td><div class="tabhead">Übung <xsl:number level='any' count="scriptElement[@type='exercise']" format="1"/>: <xsl:value-of select="@title"/></div></td></tr>
         <tr>
         <td>
         <div class="tabelement"><xsl:apply-templates/></div></td>
      </tr>
   </table>
</div>
   <xsl:call-template name="makeSeparator"/>
</xsl:template>

<xsl:template match="bullet">•</xsl:template>

<xsl:template match="link">•<xsl:apply-templates/><br/></xsl:template>

<xsl:template match="scriptElement[@type='links']">
<div style="margin-left:150px;text-align:left;">
   <table border="0">
      <tr>
         <td rowspan="2">
            <a name="{@name}">
               <xsl:element name="img">
                  <xsl:attribute name="src">http://www.jeckle.de/images/xml/iconwww.gif</xsl:attribute>
                  <xsl:attribute name="alt">Web-Referenzen <xsl:number count="scriptElement[@type='links']" format="1"/>: <xsl:value-of select="@title"/></xsl:attribute>
                  <xsl:attribute name="width">50</xsl:attribute>
               </xsl:element>
            </a></td>
         <td><div class="tabhead">Web-Referenzen <xsl:number level="any" count="scriptElement[@type='links']" format="1"/>: <xsl:value-of select="@title"/></div></td></tr>
         <tr>
         <td>
         <div class="tabelement"><xsl:apply-templates/></div></td>
      </tr>
   </table>
</div>
   <xsl:call-template name="makeSeparator"/>
</xsl:template>

<!-- begin example handling -->
<xsl:template match="exampleLink">
	<xsl:variable name="ref" select="@ref"/>
	<a href="#{@ref}">Beispiel <xsl:value-of select="count(//example[following::example[@name = $ref]])+1"/></a>
</xsl:template>

<xsl:template match="example">
   <xsl:if test="mode='presentation'">
   	<div style="page-break-before:always"/>
   </xsl:if>
      <table style="margin-left:150px" border="1" bordercolor="#96db7f">
         <tr>
            <td>
               <xsl:apply-templates/>
            </td>
         </tr>
      </table>
   <p style="text-align: left;">

   <xsl:choose>
      <xsl:when test="@name != ''">
         <xsl:element name="a">
            <xsl:attribute name="name">
               <xsl:value-of select="@name"/>
            </xsl:attribute>
            <b style="color:#003366;">Beispiel&#160;<xsl:number count="example" level="any" format="1"/></b>: <xsl:value-of select="@caption"/>
         </xsl:element>
      </xsl:when>
      <xsl:otherwise>
         Beispiel <xsl:number count="example" format="1" />: <xsl:value-of select="@caption"/>
      </xsl:otherwise>
   </xsl:choose>
   <xsl:if test="@exampleuri != ''">
            <xsl:text disable-output-escaping="no">&#160;&#160;&#160;</xsl:text>
      <xsl:if test="@linktext = ''">
         <xsl:message terminate="yes">&err; exampleuri used but no linktext attribute found &TransformationAbort;</xsl:message>
      </xsl:if>
      <xsl:element name="a">
         <xsl:attribute name="href"><xsl:value-of select="@exampleuri"/></xsl:attribute>
         <xsl:value-of select="@linktext"/>
      </xsl:element>
   </xsl:if>
   </p>
</xsl:template>

<xsl:template match="gerquot">&#8222;<xsl:apply-templates/>&#8220;</xsl:template>

<xsl:template match="sortedLinkList">
   <ul>
      <xsl:apply-templates select="item">
         <xsl:sort data-type="text" order="ascending" select="./@text"/>
      </xsl:apply-templates>
   </ul>
</xsl:template>

<xsl:template match="sortedLinkList//item">
   <li><a href="{@uri}"><xsl:value-of select="@text"/></a>
      <xsl:if test="@added">
         <xsl:call-template name="newElementWriter"/>
      </xsl:if>
   <xsl:apply-templates/>
   </li>
</xsl:template>

<xsl:template match="sortedLinkList//item[@uri='' or not(@uri)]" priority="1">
   <li><xsl:value-of select="@text"/>
     <xsl:if test="@added">
         <xsl:call-template name="newElementWriter"/>
      </xsl:if>
   <xsl:apply-templates/>
   </li>
</xsl:template>


<!-- elements which content (could be non-XML text) is simply copied -->
<xsl:template match="style">
   <xsl:copy-of select="."/>
</xsl:template>

<xsl:template match="no">
   <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/no.gif</xsl:attribute>
      <xsl:attribute name="alt">nicht unterstützt</xsl:attribute>
   </xsl:element>
</xsl:template>

<xsl:template match="yes">
   <xsl:element name="img">
      <xsl:attribute name="src">http://www.jeckle.de/images/ok.gif</xsl:attribute>
      <xsl:attribute name="alt">unterstützt</xsl:attribute>
   </xsl:element>
</xsl:template>

<xsl:template match="toolList">
   <tbody>
      <xsl:apply-templates select="tool">
         <xsl:sort data-type="text" order="ascending" select="./toolName"/>
      </xsl:apply-templates>
   </tbody>
</xsl:template>

<xsl:template match="tool">
   <tr>
      <xsl:apply-templates/>
   </tr>
</xsl:template>

<xsl:template match="toolName">
   <td>
      <xsl:apply-templates/>
   </td>
</xsl:template>

<!-- templates needed only to encode lecture script -->
<xsl:template match="seelangspec">
   <xsl:element name="a"><xsl:attribute name="href">http://java.sun.com/docs/books/jls/second_edition/html/<xsl:value-of select="@offset"/></xsl:attribute>siehe Java Language Specification</xsl:element>
</xsl:template>

<xsl:template match="seeJavaTutorial">
   <xsl:element name="a"><xsl:attribute name="href">http://web2.java.sun.com/docs/books/tutorial/<xsl:value-of select="@offset"/></xsl:attribute>siehe Java Tutorial</xsl:element>
</xsl:template>


<xsl:template match="seeapi">
   <xsl:element name="a"><xsl:attribute name="href">http://java.sun.com/j2se/1.4.2/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>siehe Java API Specification</xsl:element>
</xsl:template>

<xsl:template match="seeapi[@ver='1.4' and @offset]">
   <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif" height="12" width="12" alt="jump to ..."/> <xsl:element name="a"><xsl:attribute name="href">http://java.sun.com/j2se/1.4/docs/api/<xsl:value-of select="@offset"/></xsl:attribute>siehe Java API Specification</xsl:element>
</xsl:template>

<xsl:template match="seejvmspec">
   <xsl:element name="a"><xsl:attribute name="href">http://java.sun.com/docs/books/vmspec/2nd-edition/html/<xsl:value-of select="@offset"/></xsl:attribute>siehe Java API Specification</xsl:element>
</xsl:template>

<xsl:template match="scriptRef[@name and @type]">
    <xsl:variable name="name" select="@name"/>
    <xsl:variable name="type" select="@type"/>
    <xsl:value-of select="count(//scriptElement[@type=$type][following::scriptElement[@name=$name]])+1"/>
</xsl:template>

<xsl:template match="gfxRef[@name]">
    <xsl:variable name="name" select="@name"/>
    <xsl:value-of select="count(//graphic[not(@noCaption = 'true') and following::graphic[@name = $name]])+1"/>
</xsl:template>

<xsl:template name="writeSeparatorLine">
    <img src="http://www.jeckle.de/images/line.gif" width="200" height="1" alt="separator line"/>
</xsl:template>

<!-- definiton handling -->
<xsl:template match="definition[@term and @id]">
    <xsl:element name="p">
    	<xsl:apply-templates select="@presentationBreak"/>
        <a name="{@id}"><b style="color:#003366;">Definition&#160;<xsl:number count="definition" level="any" format="1"/></b></a>:&#160;<em><xsl:value-of select="@term"/></em><br/>
        <xsl:apply-templates/>
        <br/><br/>
        <xsl:call-template name="writeSeparatorLine"/>
    </xsl:element>
</xsl:template>

<xsl:template match="exRef[@ref]">
    <xsl:variable name="ref" select="@ref"/>
    <xsl:value-of select="count(//example[following::example[@id = $ref]])+1"/>
</xsl:template>


<xsl:template match="defRef[@ref]">
    <xsl:variable name="ref" select="@ref"/>
    <xsl:value-of select="count(//definition[following::definition[@id = $ref]])+1"/>
</xsl:template>

<xsl:template match="defJmp[@ref]">
    <a href="#{@ref}"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="definitionLink">
	<xsl:variable name="ref" select="@ref"/>
	<a href="#{@ref}">Definition <xsl:value-of select="count(//definition[following::definition[@id = $ref]])+1"/></a>
</xsl:template>
<!-- definition handling ends ... -->





<!-- defList handling -->
<xsl:template match="defList">
    <p>
        <xsl:apply-templates select="//definition" mode="defList">
            <xsl:sort data-type="text" order="ascending" select="@term"/>
        </xsl:apply-templates>
    </p>
</xsl:template>

<xsl:template match="definition" mode="defList">
    <a href="#{@id}"><xsl:value-of select="@term"/></a><br/>
</xsl:template>
<!-- defList handling ends ... -->

<!-- defList handling -->
<xsl:template match="scriptElementList[@type='definition']">
    <p>
        <xsl:apply-templates select="//scriptElement[@type='definition']" mode="defList">
            <xsl:sort data-type="text" order="ascending" select="@title"/>
        </xsl:apply-templates>
    </p>
</xsl:template>

<xsl:template match="scriptElement[@type='definition']" mode="defList">
    <a href="#{@id}"><xsl:value-of select="@title"/></a><br/>
</xsl:template>
<!-- defList handling ends ... -->



<!-- keyword handling -->
<xsl:template match="keyword">
    <a name="{generate-id(.)}"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="keywordList">
    <p>
        <xsl:apply-templates select="//keyword|//definition" mode="keywordList">
            <xsl:sort data-type="text" order="ascending" select="concat(@term,@alt,.)"/>
        </xsl:apply-templates>
    </p>
</xsl:template>

<xsl:template match="keyword" mode="keywordList">
    <a href="#{generate-id(.)}"><xsl:value-of select="."/></a><br/>
</xsl:template>

<xsl:template match="keyword[@alt]" mode="keywordList">
    <a href="#{generate-id(.)}"><xsl:value-of select="@alt"/></a><br/>
</xsl:template>

<xsl:template match="definition[@id]" mode="keywordList">
    <a href="#{@id}"><xsl:value-of select="@term"/></a><br/>
</xsl:template>
<!-- keyword handling ends ... -->

<!-- illustration handling -->
<xsl:template match="illustration[@id and (@gfx or @ext) and @width and @caption]">
      <xsl:if test="$mode='presentation'">
      	<div style="page-break-before:always"/>
      </xsl:if>
    <div style="margin-left:150px;font-size:10pt;font-family:Verdana,Arial,Geneva,sans-serif;">
        <b style="color:#003366;">Abbildung&#160;<xsl:number count="illustration" level="any" format="1"/></b>:&#160;<em><xsl:value-of select="@caption"/></em><br/>
        <xsl:if test="@gfx != ''">
        <a name="{@id}"
        	  href="http://www.jeckle.de/images/{@gfx}">
            <img src="http://www.jeckle.de/images/{@gfx}" width="{@width}" alt="{@caption}" title="{@caption}" border="0"/>
        </a>
        </xsl:if>
        <xsl:if test="@ext != ''">
        <a name="{@id}"
        	  href="{@ext}">
            <img src="{@ext}" width="{@width}" alt="{@caption}" border="0"/>
		  </a>
		  </xsl:if>
        <br/>
        <div style="font-size:8pt;">(click on image to enlarge!)</div><br/>
    </div>
</xsl:template>

<xsl:template match="illustrationList">
    <p>
        <xsl:apply-templates select="//illustration" mode="illustrationList"/>
    </p>
</xsl:template>

<xsl:template match="illustration" mode="illustrationList">
    <a href="#{@id}"><xsl:value-of select="@caption"/></a><br/>
</xsl:template>

<xsl:template match="illustrationRef">
    <xsl:variable name="id" select="@id"/>
    <xsl:value-of select="count(//illustration[following::illustration[@id = $id]])+1"/>
</xsl:template>

<xsl:template match="illustrationLink">
	<xsl:variable name="ref" select="@ref"/>
	<a href="#{@ref}">Abbildung <xsl:value-of select="count(//illustration[following::illustration[@id = $ref]])+1"/></a>
</xsl:template>
<!-- illustration handling ends ... -->

<!-- scriptTabular handling -->
<xsl:template match="scriptTabular[@id and @caption]">
    <div style="margin-left:150px;font-size:10pt;font-family:Verdana,Arial,Geneva,sans-serif;">
        <a name="{@id}">
        	<xsl:apply-templates/>
        </a><br/>
        <b style="color:#003366;">Tabelle&#160;<xsl:number count="scriptTabular" level="any" format="1"/></b>:&#160;<em><xsl:value-of select="@caption"/></em>
    </div>
</xsl:template>

<xsl:template match="scriptTabularLink[@ref]">
	<xsl:variable name="ref" select="@ref"/>
	<a href="#{@ref}">Tabelle <xsl:value-of select="count(//scriptTabular[following::scriptTabular[@id = $ref]])+1"/></a>
</xsl:template>
<!-- scriptTabular handling ends ... -->

<!-- example handling -->
<xsl:template match="example/@javaDoc">
<xsl:text>&#160;&#160;&#160;</xsl:text><a href="examples/{.}">JavaDoc</a>
</xsl:template>

<xsl:template match="example[@id and @caption and @filename]">
    <div style="margin-left:150px;font-size:10pt;font-family:Verdana,Arial,Geneva,sans-serif;">
        <a name="{@id}"><b style="color:#003366;">Beispiel&#160;<xsl:number count="example" level="any" format="1"/></b></a>:&#160;<em><xsl:value-of select="@caption"/></em><br/>
        <small><a href="examples/{@filename}">Quellcode</a>
            <xsl:apply-templates select="@output">
                <xsl:with-param name="output">
                    <xsl:value-of select="@output"/>
                </xsl:with-param>
            </xsl:apply-templates>
            <xsl:apply-templates select="@outputMP">
                <xsl:with-param name="output">
                    <xsl:value-of select="@outputMP"/>
                </xsl:with-param>
            </xsl:apply-templates>
            <xsl:apply-templates select="@javaDoc"/>
            </small><br/>
<pre style="margin-left:0px;"><code>
    <xsl:choose>
        <xsl:when test="descendant::b">
            <xsl:apply-templates/>
        </xsl:when>
        <xsl:when test="descendant::importText">
            <xsl:apply-templates select="importText"/>
        </xsl:when>
        <xsl:otherwise>
            <xsl:call-template name="printLine">
            <xsl:with-param name="line2Print" select="concat(normalize-space(substring(.,1,2)), substring(.,3,string-length(.)), '&#xA;')"/>
        </xsl:call-template>
    </xsl:otherwise>
   </xsl:choose>
</code></pre>
<xsl:call-template name="writeSeparatorLine"/>
</div>
</xsl:template>

<xsl:template match="example/@output">
<xsl:param name="output"/>
&#160;&#160;&#160;<a href="output/{$output}">Ausgabe der Ausführung</a>
</xsl:template>

<xsl:template match="example/@outputMP">
<xsl:param name="output"/>
&#160;&#160;&#160;<a href="output/{$output}">... auf einer Multiprozessormaschine</a>
</xsl:template>

<xsl:template match="exampleList">
<p>
    <xsl:apply-templates select="//example" mode="exampleList"/>
</p>
</xsl:template>

<xsl:template match="exampleList2">
<p>
    <xsl:apply-templates select="//scriptElement[@type='example' and @title!='']" mode="exampleList"/>
</p>
</xsl:template>

<xsl:template match="scriptElement[@type='example' and @title!='']" mode="exampleList">
<a href="#{@name}"><xsl:value-of select="@title"/></a>
<xsl:if test="@filename=''"><xsl:text>    </xsl:text><small>(<a href="examples/{@filename}">Quellcode</a>)</small></xsl:if><br/>
</xsl:template>

<xsl:template match="example" mode="exampleList">
<a href="#{@name}"><xsl:value-of select="@caption"/></a>
<xsl:if test="@exampleuri=''"><xsl:text>    </xsl:text><small>(<a href="examples/{@filename}">Quellcode</a>)</small></xsl:if><br/>
</xsl:template>
<!-- example list handling ends ... -->

<!-- unparsedText rebuilts XSLT v2's unparsed-text function -->
<xsl:template match="importText[@URI]">
    <xsl:variable name="file" select="@URI"/>
    <xsl:call-template name="printLine">
    	<xsl:with-param name="line2Print" select="mcj:unparsedText($file)"/>
    </xsl:call-template>
    <xsl:apply-templates select="@downloadPath"/>
</xsl:template>

<xsl:template match="importText/@downloadPath">
    <p><a href="{.}">Download</a></p>
</xsl:template>

<xsl:template match="importText[@URI and @verbatim='true']" priority="2">
    <xsl:variable name="file" select="@URI"/>
    <xsl:value-of disable-output-escaping="yes" select="mcj:unparsedText($file)"/>
    <xsl:apply-templates select="@downloadPath"/>
</xsl:template>

<xsl:template match="link[@href]">
    <img src="http://www.jeckle.de/images/navigation/pf_re_gr.gif" height="12" width="12" alt="jump to ..."/><a href="{@href}"><xsl:apply-templates/></a>
</xsl:template>

<!-- ... ends -->

<xsl:template match="footnote[@id]">
    <sup><xsl:text>(</xsl:text><a href="#{@id}"><xsl:number level="any" count="footnote[@id]" format="1" /></a><xsl:text>)</xsl:text></sup>
</xsl:template>

<xsl:template match="footnote[@reuse]">
    <xsl:variable name="reuse" select="@reuse"/>
    <sup><xsl:text>(</xsl:text><a href="#{@reuse}"><xsl:value-of select="count(//footnote[@id and following::footnote[@id = $reuse]])+1"/></a><xsl:text>)</xsl:text> <a name="{@ref}"><xsl:apply-templates/></a></sup>
</xsl:template>

<xsl:template match="footnote[@ref]">
    <xsl:variable name="refId" select="@ref"/>
    <xsl:text>(</xsl:text><xsl:value-of select="count(//footnote[@id and following::footnote[@id = $refId]])+1"/><xsl:text>) </xsl:text> <a name="{@ref}"><xsl:apply-templates/></a>
</xsl:template>

<xsl:template match="thumbnailPic">
    <a href="{@pic}" border="0"><img src="{@tn}" alt="click on image to enlarge!"/></a>
</xsl:template>

<xsl:template match="name">
	<span style="font-variant: small-caps;"><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match="E3R">
<abbr title="Semantically Enriched Extended Entity Relationship Model">E<sup>3</sup>R</abbr>
</xsl:template>

<!-- simple table -->
<xsl:template match="SimpleTable">
	<table border="1" style="margin-left:150px;font-family:Verdana,Arial,Geneva,sans-serif;font-size:10pt">
		<xsl:apply-templates/>
	</table>
</xsl:template>

<xsl:template match="SimpleTable/tr[1]">
	<tr style="font-weight:bold">
		<xsl:apply-templates/>
	</tr>
</xsl:template>
<!-- simple table ends -->




<xsl:template match="eos[@year]">
<div style="font-size:x-small;margin-left:150px;font-family:Verdana,Arial,Geneva, sans-serif;color:#003366;">
<xsl:call-template name="makeSeparator"/>
Copyright <xsl:value-of select="@year"/> Mario Jeckle<br/>
<a href="MailTo:mario@jeckle.de">mario@jeckle.de</a>, <a href="http://www.jeckle.de">jeckle.de</a><br/>
Last Modified <xsl:value-of select="mcj:current('year')"/>-<xsl:value-of select="mcj:current('month')"/>-<xsl:value-of select="mcj:current('day')"/>
</div></xsl:template>

<xsl:template match="fieldset">
	<fieldset>
		<xsl:apply-templates/>
	</fieldset>
</xsl:template>

<xsl:template match="fieldset/legend">
	<legend>
		<xsl:apply-templates/>
	</legend>
</xsl:template>


<xsl:template match="nop"><xsl:apply-templates/></xsl:template>

</xsl:transform>

