<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
	<xsl:template match="/">
		<!--
December 1, 2007

Show new reading

Current value of <h1> heading is "Prologue" - must change for other sections of poem.
-->
		<html>
			<head>
				<title>Piers Plowman</title>
				<link rel="stylesheet" type="text/css" href="reset-fonts-grids.css"/>
				<style type="text/css">#custom-doc { width: 50%; min-width: 250px; }</style>
				<!-- Persistent stylesheet with all global styles -->
				<link rel="stylesheet" href="piersStyle.css" type="text/css"/>
				<!-- Preferred stylesheet -->
				<link rel="stylesheet" href="piersStyleDefault.css" type="text/css" title="default"/>
				<!-- Alternative stylesheets -->
			</head>
			<body>
				<div id="custom-doc" class="yui-t7">
					<div id="hd">
						<!-- Head of the document -->
						<div class="header">
							<table>
								<tr style="width: 800">
									<td>
										<h1 class="scriptText">Prologue</h1>
									</td>
									<td align="right" style="width: 700">
										<p style="margin-left: 120px; font-size:smaller; font-style:italic">New reading</p>
									</td>
								</tr>
							</table>
						</div>
					</div>
					<div id="bd">
						<div class="yui-g">
							<div class="mainWindow">
								<table bgcolor="#FFFFCC">
									<tbody>
										<!--  //////// Basic loop: Each line of poetry ////  -->
										<xsl:for-each select="section/line">
											<tr>
												<xsl:if test="unit/@special = 'indent' ">
													<td height="10px">
														<xsl:text> </xsl:text>
													</td>
												</xsl:if>
											</tr>
											<tr>
												<td width="50px" bgcolor="#FFFFCC" height="20px">
													<!-- ////////// Line numbers ////////// -->
													<xsl:if test=" (position() mod 5) = 0 ">
														<span style="font-size: smaller">
															<xsl:number value="position()" format="1  "/>
														</span>
													</xsl:if>
												</td>
												<td width="600px" bgcolor="#FFFFCC" height="20px">
													<!-- ///////// Each word in line //////////////// -->
													<xsl:for-each select="unit">
														<!-- /////  Indentation word ///////////////////  -->
														<xsl:if test="@special = 'indent' ">
															<span class="indent">
																<xsl:text> </xsl:text>
															</span>
														</xsl:if>
														<!-- //////////////////////////////// Glossterm //////////////////////////////////////////////////////////// -->
														<xsl:choose>
															<xsl:when test="@glossterm != 'null' ">
																<!--  ////////////////////////////// There is a glossterm ///////////////////////////////////// -->
																<span class="glosser">
																	<xsl:attribute name="title"><xsl:value-of select="@glossterm"/></xsl:attribute>
																	<!-- //////////////////////////////  New Reading - Modern spelling  //////////////////////// -->
																	<xsl:choose>
																		<xsl:when test="@oldReading = 'false' ">
																			<xsl:value-of select="@value"/>
																			<!-- //// Space //////////  -->
																			<xsl:if test="@space = 'yes' ">
																				<xsl:text> </xsl:text>
																			</xsl:if>
																		</xsl:when>
																		<xsl:when test="@oldReading = 'null' ">
																			<xsl:value-of select="@value"/>
																			<!-- //// Space //////////  -->
																			<xsl:if test="@space = 'yes' ">
																				<xsl:text> </xsl:text>
																			</xsl:if>
																		</xsl:when>
																	</xsl:choose>
																</span>
															</xsl:when>
															<xsl:otherwise>
																<!-- //////////////////////////////////////// No glossterm  ////////////////////////////////////////////////////////////// -->
																<!-- //////////////////////////////  New Reading - Modern spelling //////////////////////// -->
																<xsl:choose>
																	<xsl:when test="@oldReading = 'false' ">
																		<xsl:value-of select="@value"/>
																		<!-- //// Space //////////  -->
																		<xsl:if test="@space = 'yes' ">
																			<xsl:text> </xsl:text>
																		</xsl:if>
																	</xsl:when>
																	<xsl:when test="@oldReading = 'null' ">
																		<xsl:value-of select="@value"/>
																		<!-- //// Space //////////  -->
																		<xsl:if test="@space = 'yes' ">
																			<xsl:text> </xsl:text>
																		</xsl:if>
																	</xsl:when>
																</xsl:choose>
															</xsl:otherwise>
														</xsl:choose>
														<!-- //////////////////////////////////////  Bottom of glossterm ////////////////////////////////////////////// -->
													</xsl:for-each>
													<!-- ////////////////////////////////////  Bottom of each word  ////////////////////////////// -->
												</td>
											</tr>
											<!-- ///////////////////////////////// Bottom of basic loop //////////////////////////////////////// -->
										</xsl:for-each>
									</tbody>
								</table>
								<div style="height: 20px;">
									<xsl:text> </xsl:text>
								</div>
								<!-- bottom of main window -->
							</div>
							<!-- bottom of yui-g -->
						</div>
						<!-- bottom bd -->
					</div>
					<div id="ft">
						<p style="height: 20px">
							<xsl:text> </xsl:text>
						</p>
					</div>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
