<?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 20, 2007

Show new reading

Current value of <h1> heading is "Prologue" - must change for other sections of poem.
-->
		<html>
			<head>
				<title>Piers Plowman</title>
				<script type="text/javascript" src="piersJavaScript.js"/>
				<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">Vaughan</p>
									</td>
								</tr>
							</table>
						</div>
					</div>
					<div id="bd">
						<div class="yui-g">
							<div class="mainWindow">
								


										<!--  //////// Basic loop: Each line of poetry ////  -->
										<div class="line">


										<xsl:for-each select="section/line">

												<!-- Establish the line number -->
												<xsl:variable name="thisLineNumber">
													<xsl:value-of select="position()"></xsl:value-of>
												</xsl:variable>	
											




											
													<!-- ////////// Line numbers ////////// -->
													<div class="nums">
													 <xsl:choose>


													<xsl:when test=" (position() mod 5) = 0 ">
														<span style="font-size: smaller">
															<xsl:number value="position()" format="1  "/>
														</span>
													</xsl:when>
													<xsl:otherwise>
															<span style="color:#FFFFCC">PP</span>
														</xsl:otherwise>
													</xsl:choose>																									
												</div>
												



												<!-- ////////////  Signal for commentary ////////// -->
												<div class="square">
													<xsl:choose>
												


													<xsl:when test="footnote">

														<hr>															
															<xsl:attribute name="class">
																<xsl:text>clicker</xsl:text>
															</xsl:attribute>
															<xsl:attribute name="onclick">
																<xsl:text>show('</xsl:text>
																<xsl:value-of select="position()"/>
																<xsl:text>')</xsl:text>
															</xsl:attribute>
															<xsl:attribute name="width">
																<xsl:text>8px</xsl:text>
															</xsl:attribute>
															<xsl:attribute name="size">
																<xsl:text>8px</xsl:text>
															</xsl:attribute>
															<xsl:attribute name="color">
																<xsl:text>#FFCC66</xsl:text>
															</xsl:attribute>
														</hr>
													</xsl:when>
														<xsl:otherwise>
														<span style="color:#FFFFCC">PP</span>
													</xsl:otherwise>

													</xsl:choose>
												</div>


												<!-- Words in a line -->
												<div class="words">			




													
												
													<!-- ///////// Each word in line //////////////// -->
													<xsl:for-each select="unit">

														<!-- ///// Calculate the glossterm /// -->
														<xsl:variable name="thisGlossTerm">
															<xsl:choose>

																<xsl:when test=" @glossterm= 'null' and @modernSpelling != 'null' ">
																	<xsl:value-of select="@modernSpelling"></xsl:value-of>
																</xsl:when>

																<xsl:when test="@glossterm != 'null'">
																	<xsl:value-of select="@glossterm"></xsl:value-of>
																</xsl:when>

																<xsl:otherwise>
																	<xsl:value-of select=" 'null' "></xsl:value-of>
																</xsl:otherwise>
															</xsl:choose>
														</xsl:variable>





														<!-- /////  Indentation word ///////////////////  -->
														<!-- //// Hide indents in new readings														
														<xsl:if test="@special = 'indent' ">
															<span class="indent">
																<xsl:text> </xsl:text>
															</span>
														</xsl:if>
														-->
														<!-- //////////////////////////////// Glossterm //////////////////////////////////////////////////////////// -->
														<xsl:choose>
															<xsl:when test="$thisGlossTerm != 'null' ">
																<!--  ////////////////////////////// There is a glossterm ///////////////////////////////////// -->
																<span class="glosser">
																	<xsl:attribute name="title">
																		<xsl:value-of select="$thisGlossTerm"/>
																	</xsl:attribute>
																	<!-- //////////////////////////////  New Reading - Modern spelling  //////////////////////// -->
																	<xsl:choose>
																		<xsl:when test="@oldReading = 'false' ">
																			<!-- /// Special printing styles ////////// -->
																			<xsl:choose>
																				<xsl:when test="@special= 'italic'  ">
																					<span class="italic">
																						<xsl:value-of select="@value"/>
																					</span>
																				</xsl:when>
																				<xsl:when test="@value= 'Xmt' ">
																					<xsl:text> </xsl:text>
																				</xsl:when>
																				<xsl:otherwise>
																					<xsl:value-of select="@value"/>
																				</xsl:otherwise>
																			</xsl:choose>
																			<!-- //// Space //////////  -->
																			<xsl:if test="@space = 'yes' ">
																				<xsl:text> </xsl:text>
																			</xsl:if>
																		</xsl:when>
																		<xsl:when test="@oldReading = 'null' ">
																			<!-- /// Special printing styles ////////// -->
																			<xsl:choose>
																				<xsl:when test="@special= 'italic'  ">
																					<span class="italic">
																						<xsl:value-of select="@value"/>
																					</span>
																				</xsl:when>
																				<xsl:when test="@value= 'Xmt' ">
																					<xsl:text> </xsl:text>
																				</xsl:when>
																				<xsl:otherwise>
																					<xsl:value-of select="@value"/>
																				</xsl:otherwise>
																			</xsl:choose>
																			<!-- //// 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' ">
																		<!-- /// Special printing styles ////////// -->
																		<xsl:choose>
																			<xsl:when test="@special= 'italic'  ">
																				<span class="italic">
																					<xsl:value-of select="@value"/>
																				</span>
																			</xsl:when>
																			<xsl:when test="@value= 'Xmt' ">
																				<xsl:text> </xsl:text>
																			</xsl:when>
																			<xsl:otherwise>
																				<xsl:value-of select="@value"/>
																			</xsl:otherwise>
																		</xsl:choose>
																		<!-- //// Space //////////  -->
																		<xsl:if test="@space = 'yes' ">
																			<xsl:text> </xsl:text>
																		</xsl:if>
																	</xsl:when>
																	<xsl:when test="@oldReading = 'null' ">
																		<!-- /// Special printing styles ////////// -->
																		<xsl:choose>
																			<xsl:when test="@special= 'italic'  ">
																				<span class="italic">
																					<xsl:value-of select="@value"/>
																				</span>
																			</xsl:when>
																			<xsl:when test="@value= 'Xmt' ">
																				<xsl:text> </xsl:text>
																			</xsl:when>
																			<xsl:otherwise>
																				<xsl:value-of select="@value"/>
																			</xsl:otherwise>
																		</xsl:choose>
																		<!-- //// 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 div class="words" -->
													</div>
													<br clear="all" />




													<!-- /////////////////  Commentary /////////////////////////////-->
													<xsl:if test="footnote">

														<!-- Commentary panel -->
														
															<div>
																<xsl:attribute name="id">
																	<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																</xsl:attribute>
																<xsl:attribute name="class">
																	<xsl:text>hideThis</xsl:text>
																</xsl:attribute>
														
																<p class="commentaryHeader">Commentaries</p>

																<!-- Spin through commentary authors -->
																<xsl:for-each select="footnote">																
																	<p>
																		<xsl:attribute name="class">
																			<xsl:text>commentaryItem</xsl:text>
																		</xsl:attribute>
																		<xsl:attribute name="onclick">
																			<xsl:text>showFootnote('</xsl:text>
																			<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																			<xsl:text>','</xsl:text>
																			<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																			<xsl:text>-</xsl:text>
																			<xsl:value-of select="@footNoteAuthor"></xsl:value-of>
																			<xsl:text>')</xsl:text>
																		</xsl:attribute>
																		<xsl:value-of select="@footNoteAuthor"></xsl:value-of>
																	</p>																															
																</xsl:for-each>
														
																<!-- Close commentary panel -->

																	<p>
																		<xsl:attribute name="class">
																			<xsl:text>closeButton</xsl:text>
																		</xsl:attribute>
																		<xsl:attribute name="onclick">
																			<xsl:text>doClose('</xsl:text>
																			<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																			<xsl:text>')</xsl:text>
																		</xsl:attribute>
																		Close
																	</p>
																			

															 </div>
															<!-- Bottom of commentary panel -->
															
														
														
															<!-- Spin around throwing comments -->


															<xsl:for-each select="footnote">

																<div>
																	<xsl:attribute name="id">
																		<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																		<xsl:text>-</xsl:text>
																		<xsl:value-of select="@footNoteAuthor"></xsl:value-of>
																	</xsl:attribute> 
																	<xsl:attribute name="class">
																		<xsl:text>hideThisFootnote</xsl:text>
																	</xsl:attribute>																	
																	
																	<p>
																	<xsl:value-of select="footNoteLine"/>
																	</p>

																	<!-- Close the commentary -->
																	
																	<p>
																		<xsl:attribute name="class">
																			<xsl:text>closeButton</xsl:text>
																		</xsl:attribute>
																		<xsl:attribute name="onclick">
																			<xsl:text>doClose('</xsl:text>
																			<xsl:value-of select="$thisLineNumber"></xsl:value-of>
																			<xsl:text>-</xsl:text>
																			<xsl:value-of select="@footNoteAuthor"></xsl:value-of>
																			<xsl:text>')</xsl:text>																		
																		</xsl:attribute>
																		Close
																	</p>
																</div>
															</xsl:for-each>																																						
													
													


													</xsl:if>
													<!-- ////////////////////////////////////  Bottom of each word  ////////////////////////////// -->
											

											<!-- ///////////////////////////////// Bottom of basic loop //////////////////////////////////////// -->
										</xsl:for-each>

										<!-- /// Bottom of div class="line" ///// -->
										</div>



								
								<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><!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="prologue.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="" ><advancedProp name="sInitialMode" value=""/><advancedProp name="bXsltOneIsOkay" value="true"/><advancedProp name="bSchemaAware" value="false"/><advancedProp name="bXml11" value="false"/><advancedProp name="iValidation" value="0"/><advancedProp name="bExtensions" value="true"/><advancedProp name="iWhitespace" value="0"/><advancedProp name="sInitialTemplate" value=""/><advancedProp name="bTinyTree" value="true"/><advancedProp name="bWarnings" value="true"/><advancedProp name="bUseDTD" value="false"/><advancedProp name="iErrorHandling" value="fatal"/></scenario></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->