<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output indent="no" doctype-public="-//w3c//dtd html 4.01 transitional//en" method="html"/>

    <xsl:template match="resume">
        <html>
            <head>
                <title>Resumé</title>
                <style type="text/css">p            {  } p.ssma, p.t, p.d { font-family: Arial; 
                font-size: 11px } p.b, p.c, li { font-size: 12px } p.b          { font-weight: 
                bold } p.d          { color: #666666 } p.section    { font-family: Arial; font-size: 
                12px; color: #666666 }</style>
            </head>
            <body bgcolor="#9BA882">
                <br/>
                <table width="90%" align="center" border="0" cellpadding="0" cellspacing="0">
                    <tr bgcolor="white">
                        <td width="5%"> </td>
                        <td width="75%">
                            <br/>
                            <br/>
                            <br/>
                            <xsl:apply-templates select="person"/>
                            <xsl:apply-templates select="backgr"/>
                            <xsl:apply-templates select="work"/>
                            <xsl:apply-templates select="misc"/>
                            <xsl:apply-templates select="current"/>
                            <br/>
                            <br/>
                            <br/>
                        </td>
                        <td width="10%">  </td>
                    </tr>
                </table>
                <br/>
                <br/>
            </body>
        </html>
    </xsl:template>

    <xsl:template match="person">
        <table border="0" width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td valign="bottom">
                    <font size="+2" face="arial">
                        <br/>
                        <br/>
                        <b>
                            <xsl:value-of select="name"/>
                        </b>
                    </font>
                </td>
            </tr>
        </table>
        <hr width="100%" size="3" color="0" align="right"/>
        <br/>
    </xsl:template>

    <xsl:template match="backgr">
        <p class="b" align="justify">
            <xsl:apply-templates/>
        </p>
        <br/>
    </xsl:template>

    <xsl:template match="objective">
        <p class="section">OBJECTIVE

            <hr width="100%" color="acacac" align="right"/>
            <br/>
            <xsl:value-of select="."/>
        </p>
        <br/>
    </xsl:template>

    <xsl:template match="work">
        <p class="section">WORK EXPERIENCE

            <hr width="100%" color="acacac" align="right"/>
            <br/>
            <xsl:for-each select="company">
                <xsl:call-template name="render-company"/>
            </xsl:for-each>
        </p>
    </xsl:template>

    <xsl:template name="render-company">
        <table width="100%" border="0">
            <tr>
                <td width="20%" align="right" valign="top">
                    <p class="b">
                        <xsl:value-of select="role"/>
                    </p>
                </td>
                <td width="2%"> </td>
                <td width="80%" valign="top">
                    <table width="100%" border="0">
                        <tr>
                            <td width="33%" valign="top">
                                <p class="d">
                                    <xsl:value-of select="date"/>
                                </p>
                            </td>
                            <td width="33%" valign="top" align="center">
                                <p class="d">
                                    <xsl:value-of select="name"/>
                                </p>
                            </td>
                            <td width="33%" valign="top" align="right">
                                <p class="d">
                                    <xsl:apply-templates select="www"/>
                                </p>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <xsl:apply-templates select="summary"/>
                                <br/>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </xsl:template>

    <xsl:template match="sumary">
        <xsl:apply-templates select="comment"/>
    </xsl:template>

    <xsl:template match="comment">
        <p align="justify" class="c">
            <xsl:apply-templates/>
        </p>
    </xsl:template>

    <xsl:template match="list">
        <ul>
            <xsl:for-each select="item">
                <li>
                    <xsl:value-of select="."/>
                </li>
            </xsl:for-each>
        </ul>
    </xsl:template>

    <xsl:template match="misc">
        <p class="section">SKILLS/EDUCATION/AFFILIATIONS


            <hr width="100%" color="acacac" align="right"/>
            <br/>
            <ul>
                <xsl:apply-templates select="skills"/>
                <xsl:apply-templates select="education"/>
                <xsl:apply-templates select="affiliations"/>
            </ul>
        </p>
        <br/>
    </xsl:template>

    <xsl:template match="skills">
        <xsl:for-each select="skills-grp">
            <li>
                <xsl:value-of select="."/>
            </li>
        </xsl:for-each>
    </xsl:template>

    <xsl:template match="education | affiliations">
        <xsl:for-each select="institution/pos">
            <li>
                <xsl:value-of select="."/>
            </li>
        </xsl:for-each>
    </xsl:template>

    <xsl:template match="current">
        <table width="100%">
            <tr>
                <td align="center">
                    <font face="arial" size="-2" color="666666">
                        <xsl:copy-of select="./addr/node()"/>
                        <br/>
                        Phone:  
                        <xsl:value-of select="phone"/>
                        <br/>
                        Email:  
                        <a href="mailto:{mail}">
                            <xsl:value-of select="mail"/>
                        </a>
                        <br/>
                        WWW:  
                        <xsl:apply-templates select="www"/>
                    </font>
                </td>
            </tr>
        </table>
    </xsl:template>

    <xsl:template match="www">
        <a href="{.}">
            <xsl:value-of select="."/>
        </a>
    </xsl:template>
</xsl:stylesheet>