<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="book">
<html>
<head>
<title><xsl:apply-templates select="@title"/></title>
<link rel='stylesheet'> <!-- test6.css -->
   <xsl:attribute name='href'><xsl:value-of select='@style'/>.css</xsl:attribute>
</link>
</head>
<body>
   <xsl:apply-templates/>
</body>
</html>
</xsl:template>

<!--
<xsl:template match="chapter/heading[@style='italic']">
     <i><xsl:apply-templates/></i>
</xsl:template>
-->

<xsl:template match="chapter/heading">
<h2>
  <xsl:if test="@style='italic'">
     <i><xsl:apply-templates/></i>
  </xsl:if>
  <xsl:if test="not(@style='italic')">
     <b><xsl:apply-templates/></b>
  </xsl:if>
</h2>
</xsl:template>

<xsl:template match="section/heading">
<h4><xsl:apply-templates/></h4>
</xsl:template>

</xsl:stylesheet>