Move smaller, reusable templates to separate file
parent
5e50549d2e
commit
46a7c8e8e2
104
templates/cv.xsl
104
templates/cv.xsl
|
@ -1,110 +1,8 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||||
|
<xsl:import href="./index.xsl"/>
|
||||||
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" standalone="yes" doctype-system="about:legacy-compat" />
|
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" standalone="yes" doctype-system="about:legacy-compat" />
|
||||||
<xsl:param name="title" select="'Ainsley Ellis CV'"/>
|
<xsl:param name="title" select="'Ainsley Ellis CV'"/>
|
||||||
<xsl:template name="company">
|
|
||||||
<article>
|
|
||||||
<h3><xsl:value-of select="./name/text()"/></h3>
|
|
||||||
<xsl:for-each select="./role">
|
|
||||||
<xsl:call-template name="role"/>
|
|
||||||
</xsl:for-each>
|
|
||||||
</article>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template name="project">
|
|
||||||
<article>
|
|
||||||
<header>
|
|
||||||
<h3><xsl:value-of select="./name/text()" /></h3>
|
|
||||||
<p>
|
|
||||||
<xsl:value-of select="./activity/text()" />
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
<xsl:copy-of select="./description/node()" />
|
|
||||||
</article>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template name="institution">
|
|
||||||
<article>
|
|
||||||
<hgroup>
|
|
||||||
<h3><xsl:value-of select="./name/text()" /></h3>
|
|
||||||
<p><xsl:value-of select="./location" /></p>
|
|
||||||
</hgroup>
|
|
||||||
<dl>
|
|
||||||
<xsl:for-each select="./degree">
|
|
||||||
<dt><xsl:value-of select="./level/text()" /> in <xsl:value-of select="./concentration/text()" /></dt>
|
|
||||||
<xsl:if test="boolean(./school)">
|
|
||||||
<dd>
|
|
||||||
<xsl:text>School: </xsl:text>
|
|
||||||
<xsl:value-of select="./school/text()" />
|
|
||||||
</dd>
|
|
||||||
</xsl:if>
|
|
||||||
<dd>
|
|
||||||
<xsl:text>Attended: </xsl:text>
|
|
||||||
<time>
|
|
||||||
<xsl:attribute name="datetime">
|
|
||||||
<xsl:value-of select="./duration/starrt[@datetime]" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:value-of select="./duration/start/text()" />
|
|
||||||
</time>
|
|
||||||
<xsl:text> to </xsl:text>
|
|
||||||
<time>
|
|
||||||
<xsl:attribute name="datetime">
|
|
||||||
<xsl:value-of select="./duration/end[@datetime]" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:value-of select="./duration/end/text()" />
|
|
||||||
</time>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<xsl:if test="boolean(./gpa)">
|
|
||||||
<dd>GPA: <xsl:value-of select="./gpa/text()" /></dd>
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="boolean(./honors)">
|
|
||||||
<dd>
|
|
||||||
<xsl:text>Honours: </xsl:text>
|
|
||||||
<xsl:for-each select="./honors/item">
|
|
||||||
<xsl:value-of select="./text()" />
|
|
||||||
<xsl:if test="not(position()=last())">, </xsl:if>
|
|
||||||
</xsl:for-each>
|
|
||||||
</dd>
|
|
||||||
</xsl:if>
|
|
||||||
</xsl:for-each>
|
|
||||||
</dl>
|
|
||||||
</article>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template name="skill-category">
|
|
||||||
<section>
|
|
||||||
<h3><xsl:value-of select="./name/text()" /></h3>
|
|
||||||
<ul role="list">
|
|
||||||
<xsl:for-each select="./item">
|
|
||||||
<li><xsl:value-of select="./text()" /></li>
|
|
||||||
</xsl:for-each>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template name="role">
|
|
||||||
<article>
|
|
||||||
<header>
|
|
||||||
<h4><xsl:value-of select="./title/text()" /></h4>
|
|
||||||
<p>
|
|
||||||
<time>
|
|
||||||
<xsl:attribute name="datetime">
|
|
||||||
<xsl:value-of select="./duration/start[@datetime]" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:value-of select="./duration/start/text()" />
|
|
||||||
</time>
|
|
||||||
<xsl:choose>
|
|
||||||
<xsl:when test="./duration/start[@datetime] != ./duration/end[@datetime]"> to <time>
|
|
||||||
<xsl:attribute name="datetime">
|
|
||||||
<xsl:value-of select="./duration/end[@datetime]" />
|
|
||||||
</xsl:attribute>
|
|
||||||
<xsl:value-of select="./duration/end/text()" />
|
|
||||||
</time>
|
|
||||||
</xsl:when>
|
|
||||||
<xsl:when test="not(boolean(./duration/end))"> to Present</xsl:when>
|
|
||||||
</xsl:choose>
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
<xsl:copy-of select="./description/node()" />
|
|
||||||
</article>
|
|
||||||
</xsl:template>
|
|
||||||
<xsl:template match="/cv" data-xmlns="http://www.w3.org/1999/xhtml">
|
<xsl:template match="/cv" data-xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<html lang="en" dir="ltr">
|
<html lang="en" dir="ltr">
|
||||||
<!-- The Yesterweb is dead, long live the Yesterweb! -->
|
<!-- The Yesterweb is dead, long live the Yesterweb! -->
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||||
|
<xsl:template name="company">
|
||||||
|
<xsl:param name="type">full</xsl:param>
|
||||||
|
<article>
|
||||||
|
<h3><xsl:value-of select="./name/text()"/></h3>
|
||||||
|
<xsl:for-each select="./role">
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h4><xsl:value-of select="./title/text()" /></h4>
|
||||||
|
<p><xsl:call-template name="duration" /></p>
|
||||||
|
</header>
|
||||||
|
<xsl:if test="$type = 'full' and not(./description[@type=$type]/node())">
|
||||||
|
<xsl:copy-of select="./description[@type='brief']/node()" />
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:copy-of select="./description[@type=$type]/node()" />
|
||||||
|
</article>
|
||||||
|
</xsl:for-each>
|
||||||
|
</article>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template name="duration">
|
||||||
|
<time>
|
||||||
|
<xsl:attribute name="datetime">
|
||||||
|
<xsl:value-of select="./duration/start[@datetime]" />
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:value-of select="./duration/start/text()" />
|
||||||
|
</time>
|
||||||
|
<xsl:choose>
|
||||||
|
<xsl:when test="./duration/start[@datetime] != ./duration/end[@datetime]"> to <time>
|
||||||
|
<xsl:attribute name="datetime">
|
||||||
|
<xsl:value-of select="./duration/end[@datetime]" />
|
||||||
|
</xsl:attribute>
|
||||||
|
<xsl:value-of select="./duration/end/text()" />
|
||||||
|
</time>
|
||||||
|
</xsl:when>
|
||||||
|
<xsl:when test="not(boolean(./duration/end))"> to Present</xsl:when>
|
||||||
|
</xsl:choose>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template name="institution">
|
||||||
|
<article>
|
||||||
|
<hgroup>
|
||||||
|
<h3><xsl:value-of select="./name/text()" /></h3>
|
||||||
|
<p><xsl:value-of select="./location" /></p>
|
||||||
|
</hgroup>
|
||||||
|
<dl>
|
||||||
|
<xsl:for-each select="./degree">
|
||||||
|
<dt><xsl:value-of select="./level/text()" /> in <xsl:value-of select="./concentration/text()" /></dt>
|
||||||
|
<xsl:if test="boolean(./school)">
|
||||||
|
<dd>
|
||||||
|
<xsl:text>School: </xsl:text>
|
||||||
|
<xsl:value-of select="./school/text()" />
|
||||||
|
</dd>
|
||||||
|
</xsl:if>
|
||||||
|
<dd>
|
||||||
|
<xsl:text>Attended: </xsl:text>
|
||||||
|
<xsl:call-template name="duration" />
|
||||||
|
</dd>
|
||||||
|
<xsl:if test="boolean(./gpa)">
|
||||||
|
<dd>GPA: <xsl:value-of select="./gpa/text()" /></dd>
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:if test="boolean(./honors)">
|
||||||
|
<dd>
|
||||||
|
<xsl:text>Honours: </xsl:text>
|
||||||
|
<xsl:for-each select="./honors/item">
|
||||||
|
<xsl:value-of select="./text()" />
|
||||||
|
<xsl:if test="not(position()=last())">, </xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
</dd>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:for-each>
|
||||||
|
</dl>
|
||||||
|
</article>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template name="project">
|
||||||
|
<xsl:param name="type">full</xsl:param>
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h3><xsl:value-of select="./name/text()" /></h3>
|
||||||
|
<p>
|
||||||
|
<xsl:value-of select="./activity/text()" />
|
||||||
|
</p>
|
||||||
|
</header>
|
||||||
|
<xsl:if test="$type = 'full' and not(./description[@type=$type]/node())">
|
||||||
|
<xsl:copy-of select="./description[@type='brief']/node()" />
|
||||||
|
</xsl:if>
|
||||||
|
<xsl:copy-of select="./description[@type=$type]/node()" />
|
||||||
|
</article>
|
||||||
|
</xsl:template>
|
||||||
|
<xsl:template name="skill-category">
|
||||||
|
<section>
|
||||||
|
<h3><xsl:value-of select="@name" /></h3>
|
||||||
|
<ul role="list">
|
||||||
|
<xsl:for-each select="./item">
|
||||||
|
<li><xsl:value-of select="./text()" /></li>
|
||||||
|
</xsl:for-each>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
Loading…
Reference in New Issue