<?xml version="1.0" encoding="utf-8"?>

<!--
template.xsl
2002-10-25
David Wallace Croft
http://www.croftsoft.com/library/tutorials/xslt/
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="html" indent="no" />

<xsl:variable name="content" select="/"/>

<xsl:variable name="template" select="document('template.html')"/>

<xsl:template match="/">
  <xsl:apply-templates select="$template/node()"/>
</xsl:template>

<xsl:template match="/html/head/title">
  <title>
    <xsl:apply-templates select="$content/html/head/title/node()" />
  </title>
</xsl:template>

<xsl:template match="content">
  <xsl:apply-templates select="$content/html/body/node()"/>
</xsl:template>

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()" />
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>
