﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:maiden="http://xml-maiden.com" version="1.0">
<xsl:output method="xml" encoding="utf-8"/>
<!-- 
This style sheet transforms XML MAIDEN 2.1 document structure into XHTML 1.0 Strict.
Style sheet is maintained by George Chavchanidze as a part of XML MAIDEN project http://xml-maiden.com 
You can copy, modify and redistribute current style sheet without any restrictions.
Last modified on 16:25 09/05/2006
-->

<xsl:template match="maiden:article">
<xsl:processing-instruction name="xml-stylesheet">href="math.css" type="text/css"</xsl:processing-instruction>
<html>
<head>
<title>
<xsl:choose>
<xsl:when test="maiden:title">
<xsl:apply-templates select="maiden:title/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>XHTML document</xsl:text>
</xsl:otherwise>
</xsl:choose>
</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<xsl:template match="maiden:abstract | maiden:acknowledgements | maiden:affiliation | maiden:appendix | maiden:author | maiden:authors | maiden:axiom | maiden:code | maiden:corollary | maiden:date | maiden:definition | maiden:editor | maiden:example | maiden:exercise | maiden:front | maiden:info | maiden:keywords | maiden:lemma | maiden:msc | maiden:notes | maiden:pacs | maiden:paragraph | maiden:problem | maiden:proof | maiden:proposition | maiden:remark | maiden:referee | maiden:reference | maiden:section | maiden:segment | maiden:statement | maiden:subject | maiden:subparagraph | maiden:subsection | maiden:subsegment | maiden:summary | maiden:theorem | maiden:warning">
<div>
<xsl:attribute name="class"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:if test="@xml:id">
<xsl:attribute name="id"><xsl:value-of select="@xml:id"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</div>
</xsl:template>

<xsl:template match="maiden:key | maiden:name | maiden:who | maiden:what | maiden:when | maiden:where">
<span>
<xsl:attribute name="class"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:if test="@xml:id">
<xsl:attribute name="id"><xsl:value-of select="@xml:id"/></xsl:attribute>
</xsl:if>
<xsl:if test="@title">
<xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</span>
</xsl:template>

<xsl:template match="maiden:header">
<xsl:if test="parent::maiden:article or parent::maiden:section or parent::maiden:appendix">
<h2><xsl:apply-templates/></h2>
</xsl:if>
<xsl:if test="parent::maiden:subsection">
<h3><xsl:apply-templates/></h3>
</xsl:if>
<xsl:if test="parent::maiden:segment">
<h4><xsl:apply-templates/></h4>
</xsl:if>
<xsl:if test="parent::maiden:subsegment">
<h5><xsl:apply-templates/></h5>
</xsl:if>
</xsl:template>

<xsl:template match="maiden:title">
<h1><xsl:apply-templates/></h1>
</xsl:template>

<xsl:template match="maiden:cite | maiden:ref | maiden:item">
<li><xsl:apply-templates/></li>
</xsl:template>

<xsl:template match="maiden:list">
<ol><xsl:apply-templates/></ol>
</xsl:template>

<xsl:template match="maiden:references">
<h2 class="references"><xsl:text>References</xsl:text></h2>
<ol class="references"><xsl:apply-templates/></ol>
</xsl:template>

<xsl:template match="maiden:quote">
<blockquote><xsl:apply-templates/></blockquote>
</xsl:template>

<xsl:template match="maiden:shell">
<span><xsl:apply-templates/></span>
</xsl:template>

<xsl:template match="maiden:stress">
<strong><xsl:apply-templates/></strong>
</xsl:template>

</xsl:stylesheet>