<?xml version="1.0" encoding="UTF-8"?>
<!--
	Default conversion script for transforming the CV into a HTML-format.
	author: Felipe vieira Silva - fgaucho@gmail.com
	version: 0.0.1
-->
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fo="http://www.w3.org/1999/XSL/Format"
	xmlns:gml="http://www.opengis.net/gml">

	<xsl:template match="curriculum">
		<html>
			<meta content="" />
			<body bgcolor="#FFFFFF">
				<font face="Helvetica, Arial, sans-serif">
					<table align="center" bgcolor="#DDDDDD" border="0"
						cellspacing="10">
						<tr valign="top">
							<td bgcolor="#FFBB00" width="230"
								align="middle">
								<xsl:apply-templates select="contact" />
							</td>
							<td>
								<xsl:apply-templates select="education" />
								<xsl:apply-templates select="languages" />
								<xsl:apply-templates select="skills" />
								<xsl:apply-templates
									select="experience" />
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<font
									face="Helvetica, Arial, sans-serif" size="-2"
									color="#EEAA00">
									Tthe XML schema and the XSLT used to
									transform the CV data into this HTML
									page was designed by Felipe Vieira
									Silva. You can request any
									information about the techniques
									used in this project
									<a href="fgaucho@gmail.com">
										through the mail
									</a>
									.
									<script LANGUAGE="JavaScript">
										var now = new Date();
										document.write( now );
									</script>
								</font>
							</td>
						</tr>
					</table>
				</font>
			</body>
		</html>
	</xsl:template>


	<xsl:template match="contact">
		<table>
			<tr>
				<td valign="top" align="middle">
				   <xsl:apply-templates select="photo" />
				</td>
				<td valign="bottom" align="middle">
					<br />
					<font size="+2">
						<xsl:value-of select="name" />
					</font>
					<br />
					<font color="#FF0000" size="+1">
						<xsl:value-of select="title" />
					</font>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<hr />
				</td>
			</tr>
			<tr>
				<td>
					<small>mail:</small>
				</td>
				<td>
					<strong>
						<xsl:apply-templates select="email" />
					</strong>
				</td>
			</tr>
			<tr>
				<td>
					<small>phone:</small>
				</td>
				<td>
					<strong>
						<xsl:value-of select="phone" />
					</strong>
				</td>
			</tr>
			<tr>
				<td>
					<small>blog:</small>
				</td>
				<td>
					<small>
						<xsl:apply-templates select="url" />
					</small>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<br />
					<i>
						<small>
							<xsl:value-of select="summary" />
						</small>
					</i>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="languages">
		<table>
			<tr>
				<td width="1000" valign="top" align="left"
					bgcolor="#FFBB00">
					<small>
						<strong>idioms</strong>
					</small>
				</td>
			</tr>
			<xsl:for-each select="idiom">
				<tr>
					<td>
						<strong>
							<xsl:value-of select="@language" />
						</strong>
						<small>
							<i>
								-
								<xsl:value-of select="@proficiency" />
							</i>
						</small>
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>

	<xsl:template match="education">
		<table>
			<tr>
				<td width="1000" valign="top" align="left"
					bgcolor="#FFBB00">
					<small>
						<strong>education</strong>
					</small>
				</td>
			</tr>
			<xsl:for-each select="degree">
				<tr>
					<td>
						<strong>
							<xsl:value-of select="@name" />
						</strong>
						<small>
							(
							<xsl:variable name="dateInitial"
								select="period/initial" />
							<xsl:variable name="dayYearInitial"
								select="substring-after($dateInitial, '-')" />
							<xsl:value-of
								select="substring-before($dayYearInitial, '-')" />
							/
							<xsl:value-of
								select="substring-before($dateInitial, '-')" />
							-->
							<xsl:variable name="dateFinal"
								select="period/final" />
							<xsl:variable name="dayYearFinal"
								select="substring-after($dateFinal, '-')" />
							<xsl:value-of
								select="substring-before($dayYearFinal, '-')" />
							/
							<xsl:value-of
								select="substring-before($dateFinal, '-')" />
							)
							<xsl:value-of select="school" />
							<i>
								-
								<xsl:value-of select="url" />
							</i>
						</small>
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>

	<xsl:template match="skills">
		<table>
			<tr>
				<td width="1000" valign="top" align="left"
					bgcolor="#FFBB00">
					<small>
						<strong>skills</strong>
					</small>
				</td>
			</tr>
			<xsl:for-each select="skill">
				<tr>
					<td>
						<strong>
							<xsl:value-of select="name" />
						</strong>
						:
						<small>
							<xsl:value-of select="description" />
						</small>
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>


	<xsl:template match="experience">
		<table>
			<tr>
				<td width="1000" valign="top" align="left"
					bgcolor="#FFBB00">
					<small>
						<strong>work experience</strong>
					</small>
				</td>
			</tr>
			<xsl:for-each select="job">
				<tr>
					<td>
						<strong>
							<xsl:value-of select="@title" />
						</strong>
						<small>
							(
							<xsl:variable name="dateInitial"
								select="period/initial" />
							<xsl:variable name="dayYearInitial"
								select="substring-after($dateInitial, '-')" />
							<xsl:value-of
								select="substring-before($dayYearInitial, '-')" />
							/
							<xsl:value-of
								select="substring-before($dateInitial, '-')" />
							-->
							<xsl:variable name="dateFinal"
								select="period/final" />
							<xsl:variable name="dayYearFinal"
								select="substring-after($dateFinal, '-')" />
							<xsl:value-of
								select="substring-before($dayYearFinal, '-')" />
							/
							<xsl:value-of
								select="substring-before($dateFinal, '-')" />
							)

							<xsl:value-of select="description" />
							<i>
								<xsl:value-of select="company/name" />
								-
								<xsl:value-of select="company/url" />
							</i>
							-
							<xsl:value-of select="type" />
							- Technologies:
							<emph>
								<xsl:value-of select="tecnologies" />
							</emph>

						</small>
					</td>
				</tr>
			</xsl:for-each>
		</table>
	</xsl:template>


	<xsl:template match="email">
		<a href="mailto:{.}">
			<xsl:value-of select="." />
		</a>
	</xsl:template>


	<xsl:template match="url">
		<a href="mailto:{.}">
			<xsl:value-of select="." />
		</a>
	</xsl:template>

	<xsl:template match="photo">
	   <img src="{.}"/>
	</xsl:template>

</xsl:stylesheet>
