<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:param name="title-color">#06A</xsl:param>
	<xsl:output method="html" media-type="text/html"/>
	<xsl:template match="name">
		<h1><xsl:apply-templates/></h1>
	</xsl:template>
	<xsl:template match="/entity/author">
		<b>Author:</b> <xsl:apply-templates/><br />
	</xsl:template>
	<xsl:template match="/entity/date">
		<b>Date:<small><xsl:text> (</xsl:text><xsl:value-of select="@format"/><xsl:text>) </xsl:text></small></b><xsl:text> </xsl:text><xsl:apply-templates/><br />
	</xsl:template>
	<xsl:template match="/entity/license">
		<b>License:</b><xsl:text> </xsl:text><xsl:apply-templates/><br />
	</xsl:template>
	<xsl:template match="description">
		<p><xsl:apply-templates/></p>
	</xsl:template>
	<xsl:template match="strings">
		
		<h3><xsl:text>Strings</xsl:text></h3>
		<xsl:apply-templates/>
		<ol start="0">
			<xsl:for-each select="string">

			<li><xsl:value-of select="@name"/></li>
			</xsl:for-each>
		</ol>
	</xsl:template>
	<xsl:template match="functions">
		
		<h3><xsl:text>Public Functions</xsl:text></h3>
		<xsl:apply-templates/>
		<dl>
			<xsl:for-each select="function">
			<dt>
				<xsl:value-of select="@name"/>
				
				<xsl:text>(</xsl:text>
				<xsl:for-each select="argument">
					<xsl:value-of select="@name"/>
					<xsl:text>,</xsl:text>
				</xsl:for-each>				
				<xsl:text>) </xsl:text>
			</dt>
			<dd>
				<xsl:text>returns </xsl:text>
				<xsl:value-of select="@returns"/>
			</dd>
			
			</xsl:for-each>
		</dl>
	</xsl:template>
	<xsl:template match="/">
		<html>
		<head>
		<title>
			<xsl:value-of select="pack"/><xsl:text> </xsl:text><xsl:value-of select="name"/>
		</title>
		<style type="text/css">
			h1 { text-align: center; color: <xsl:value-of select="$title-color"/>; margin: 0.2em; }
			h2,h3 { text-align: left; color: <xsl:value-of select="$title-color"/>; margin: 0.2em }
			body { font-family: sans-serif; background-color: white; margin: 6px; }
			dl, ul, ol { margin-left: 1em; }
		      </style>
		    </head>
		<body>
		<xsl:apply-templates/></body></html></xsl:template>
</xsl:stylesheet>