<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/Profiles/XHTML-transitional">
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
<xsl:output indent="no" method="html"/>
<xsl:template match="/">

<div style="font-size:large;"><strong><xsl:call-template name="title" /></strong></div><br />
<div style="font-size:large;"><strong><xsl:call-template name="artist" /></strong></div><br />
<xsl:call-template name="songwriter" /><br />
<xsl:call-template name="composer" />
<hr />
<xsl:call-template name="body" />
</xsl:template>


<xsl:template name="title0">
<xsl:for-each select="(song/head/title/ko|song/head/title/ko/ruby/rb)/text()"><xsl:value-of select="."/></xsl:for-each>
</xsl:template>

<xsl:template name="artist0">
<xsl:for-each select="(song/head/artist/ko|song/head/artist/ko/ruby/rb)/text()">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>

<xsl:template name="title">
<xsl:choose>

<xsl:when test="song/head/title/ko/node() = song/head/title/ja/node()">
<xsl:copy-of select="song/head/title/ko/node()" />
</xsl:when>

<xsl:otherwise>
<xsl:copy-of select="song/head/title/ko/node()" /><br /><xsl:value-of select="song/head/title/ja" />
</xsl:otherwise>

</xsl:choose>
</xsl:template>

<xsl:template name="artist">
<xsl:copy-of select="song/head/artist/ko/node()" />
</xsl:template>

<xsl:template name="songwriter">
<ruby>작사<rt>作詞</rt></ruby>:<xsl:copy-of select="song/head/songwriter/ko/node()" />
</xsl:template>

<xsl:template name="composer">
<ruby>작곡<rt>作曲</rt></ruby>:<xsl:copy-of select="song/head/composer/ko/node()" />
</xsl:template>



<xsl:template name="body">
<xsl:for-each select="song/body/interlude|song/body/row">
<xsl:choose>

<xsl:when test="self::interlude">
<br /><br />
</xsl:when>

<xsl:when test="ko/node() = ja/node()">
<br /><b><xsl:copy-of select="ko/node()" /></b><br /><br />
</xsl:when>

<xsl:otherwise>
<b><xsl:copy-of select="ko/node()" /></b><br />
<xsl:copy-of select="ja/node()" /><br />
</xsl:otherwise>
</xsl:choose>

</xsl:for-each>
</xsl:template>


</xsl:stylesheet>
