﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:atom="http://purl.org/atom/ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	exclude-result-prefixes="dc atom">

	<xsl:template match="/">
	<xsl:apply-templates/>
	</xsl:template> 

		<xsl:template match="atom:feed">
		<html xml:lang="ja" lang="ja">
		<head>
		<title><xsl:value-of select="atom:title"/>の更新情報</title>
		<meta http-equiv="Content-Style-Type" conent="text/css"/>
		<link rel="stylesheet" href="skin/feed.css" type="text/css" />
		<xsl:if test="system-property('xsl:vendor')='Transformiix'">
			<script type="text/javascript">
				function decoding() {
					var elements = document.getElementsByTagName('div');
					for (var i = 0; i &lt; elements.length; i++) {
						var e = elements[i];
						if (e.className == 'description') {
							e.innerHTML = e.firstChild.data;
						}
					}
				}
			</script>
		</xsl:if>
		</head>
		<body>
		<xsl:if test="system-property('xsl:vendor')='Transformiix'">
			<xsl:attribute name="onload">decoding()</xsl:attribute>
		</xsl:if>
		<h1><a><xsl:attribute name="href"><xsl:value-of select="//@href"/></xsl:attribute><xsl:value-of select="atom:title"/></a></h1>
		<p id="update">最終更新日：<xsl:value-of select="atom:modified"/></p>
		<xsl:apply-templates select="atom:entry"/>
		</body>
		</html>
		</xsl:template>
		
	<xsl:template match="atom:entry">
		<div class="section">
		<h2><a><xsl:attribute name="href"><xsl:value-of select="atom:link/@href"/></xsl:attribute><xsl:value-of select="atom:title"/></a></h2>
			<div class="description">
				<xsl:apply-templates select="atom:content"/>
			</div>
		<p class="category">カテゴリー：<xsl:value-of select="dc:subject"/></p>
		<p class="date"><xsl:value-of select="atom:issued"/></p>
		</div>
	</xsl:template>
	
	<xsl:template match="atom:content">
		<xsl:value-of disable-output-escaping="yes" select="."/>
	</xsl:template>
</xsl:stylesheet>
