﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:local="urn:local" extension-element-prefixes="msxsl">
	<xsl:output method="xml" indent="yes"/>

	<!--
	<msxsl:script language="CSharp" implements-prefix="local">
		public string dateTimeNow()
		{
		String date = DateTime.Now.ToString("yyyyMMddTHHmmsszzz");
		date = date.Replace(":", String.Empty);
		return date;
		}
	</msxsl:script>
	-->	
	
	<!-- main template -->
	<xsl:template match="text()|@*"></xsl:template>
	<xsl:template match="/">
		<nitf version="-//IPTC//DTD NITF 3.6//EN" change.date="September 11, 2009" change.time="12:26">
			<head>
				<title>AHL-STAND-SCHED</title>
				<!-- LIBELLE GROUPE PAGE / PAGE -->
				<tobject tobject.type="news">
					<tobject.property tobject.property.type="current" />
					<tobject.subject tobject.subject.ipr="IPTC" />
				</tobject>
				<docdata management-status="usable">
					<doc-id id-string="090feaaa6d3144a6b576cb297878882f" />
					<doc.copyright holder="SoHO Sports. All rights reserved." year="2012" />
					<doc-scope scope="Agate" />
					<date.expire norm="YYYYMMDD000000-HHMM" />
					<!--<xsl:variable name="dateTimeNow" select="local:dateTimeNow()" />-->
					<date.issue norm="YYYYMMDD000000-HHMM" />
					<!-- DATE EXPORT -->
					<date.release norm="YYYYMMDD000000-HHMM" />
					<ed-msg info="" />
					<key-list>
						<keyword>Agate</keyword>
					</key-list>
					<series series.part="0" series.totalpart="0" />
				</docdata>
				<urgency ed-urg="5" />
			</head>
			<body>
				<body.head>
					<hedline>
						<hl1>AHL-STAND-SCHED</hl1>
						<hl2>AHL-STAND-SCHED</hl2>
					</hedline>
					<byline>
						<person></person>
						<byttl>SoHO Sports</byttl>
					</byline>
					<dateline>
						<location>
							<city></city>
							<state></state>
							<country></country>
						</location>
						<story.date norm="20120925T161006-0400" />
					</dateline>
					<distributor>SOHO SPORTS</distributor>
					<abstract>
						<media>
							<media-metadata name="TransRef" value="" />
						</media>
					</abstract>
				</body.head>
				<body.content>
					<block id="CPARTICLE">
						<xsl:apply-templates />
					</block>
				</body.content>
			</body>
		</nitf>
	</xsl:template>	
	<xsl:template match="dataContainers">
		<xsl:apply-templates />
	</xsl:template>
	<xsl:template match="dataContainer">
		<xsl:choose>
			<!-- header line -->
			<xsl:when test="@type = '2' or @type = '3' or @type = '4'">
				<p><xsl:value-of select="./dataBlocs/dataBloc/dataList/data/value" /></p>
			</xsl:when>
			<xsl:when test="@type = '5' or @type = '6'">
				<xsl:apply-templates />
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="dataBlocs">
		<table>
			<tbody>
				<xsl:apply-templates />
			</tbody>
		</table>
	</xsl:template>
	<xsl:template match="dataBloc">
		<tr>
			<xsl:apply-templates />
		</tr>
	</xsl:template>
	<xsl:template match="dataCell">
		<td>
			<xsl:apply-templates />
		</td>
	</xsl:template>
	<xsl:template match="element">
		<xsl:value-of select="." />
	</xsl:template>
</xsl:stylesheet>
