<xslt:stylesheet xmlns:xslt="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- © 2005 Stefan Mintert This is copyrighted material. Please read http://www.linkwerk.com/pub/xml/invitation/licence.txt The purpose of this XSLT style sheet is described online at http://www.linkwerk.com/pub/xml/invitation/. -->
<xslt:output method="html" encoding="utf-8"></xslt:output>
<!-- ====================================================== -->
<!-- Template for root element type 'invitation' -->
<xslt:template match="invitation">
<html>
<head>
<title>
Invitation to
<xslt:value-of select="event"></xslt:value-of>
</title>
<style type="text/css">
body { font-family: "Comic Sans MS", sans-serif; background: #999999; font-size: 150%; } div.body { margin-left: 20%; margin-right: 20%; background: #ffffff; border: solid 3px red; padding: 2ex 3em; } h1 { font-size: 180%; color: #ffffff; background: #66aa66; padding: 1ex 1.5em; text-align: center; } p.meta { border-left: solid 1em #ff3333; border-right: solid 1em #ff3333; padding-left: 1em; padding-right: 1em; } address { text-align: center; font-size: 66%; font-family: sans-serif; margin-top: 2ex; } .location, .date, .time { font-weight: bold; }
</style>
</head>
<body>
<div class="body">
<xslt:apply-templates select="event"></xslt:apply-templates>
<p class="meta">
I'd like to invite you to come to
<xslt:apply-templates select="location"></xslt:apply-templates>
. The event takes place on
<xslt:apply-templates select="date"></xslt:apply-templates>
at
<xslt:apply-templates select="time"></xslt:apply-templates>
</p>
<xslt:apply-templates select="description|dresscode"></xslt:apply-templates>
</div>
<address>
Generated from XML with
<kbd>
invitation2html.xslt
</kbd>
. Copyright ©
<a href="http://www.mintert.com/">
Stefan Mintert
</a>
,
<br></br>
<a href="http://www.linkwerk.com/">
Linkwerk
</a>
</address>
</body>
</html>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<!-- Template for element type 'event' -->
<xslt:template match="event">
<h1>
<xslt:apply-templates></xslt:apply-templates>
</h1>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<xslt:template match="location | date | time">
<span class="{local-name()}">
<xslt:apply-templates></xslt:apply-templates>
</span>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<!-- Template for element type 'para' -->
<xslt:template match="para">
<p>
<xslt:apply-templates></xslt:apply-templates>
</p>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<!-- Template for element type 'emph' -->
<xslt:template match="emph">
<em>
<xslt:apply-templates></xslt:apply-templates>
</em>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<!-- Template for element type 'description' -->
<xslt:template match="description">
<div class="description">
<strong>
What's up?
</strong>
<xslt:apply-templates></xslt:apply-templates>
</div>
</xslt:template>
<!-- ====================================================== -->
<!-- ====================================================== -->
<!-- Template for element type 'dresscode' -->
<xslt:template match="dresscode">
<p class="dresscode">
<strong>
What to wear?
</strong>
<xslt:apply-templates></xslt:apply-templates>
</p>
</xslt:template>
<!-- ====================================================== -->
</xslt:stylesheet>