<!--

By: Tomoko Okuno
Summer 2003
To: output a word list based on the Biao-Min lexicon xml file

-->
<!-- This is a stylesheet -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:field="http://www.emeld.org/field/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--
The xsl:template tag defines the start of a template. The match="/" attribute matches the template to the root (/) of the XML source document.
-->
	<xsl:template match="/">
		<html>
			<head>
				<title>Patowatomi Stylesheets</title>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
			</head>
			<body>
				<!-- The "lexicon" element is the root element in the xml file.  This is a loop. This tag tells the parser, each time you encounter a "lexicon" tag, do everything contained in the xsl:for-each tag. 
				-->
				<xsl:for-each select="lexicon">
					<br/>
					<!-- This is a loop.   The @ symbol means 'attribute'  This tells the parser, each time you encounter an "lang" attribute (of the lexicon element)  in the xml file, do what is contained in the :xsl for-each tag.  -->
					<xsl:for-each select="@lang">
						<span style="font-family:Arial Unicode MS;font-size:large; color:#666699; font-weight:bold;">
							<!--  output the value of the current node.  Since we are currently in the lang attribute, the information contained in it will be output -->
							<xsl:value-of select="."/>
						</span>
						<!-- close lang loop -->
					</xsl:for-each>
					<br/>
					<span style="font-family:Arial Unicode MS;font-size:small;color:#666699;">
						<b>Field Linguist:</b>
					</span>
					<span style="font-family:Arial Unicode MS; ">&#160;</span>
					<!-- For each attribute 'linguist', -->
					<xsl:for-each select="@linguist">
						<span style="font-family:Arial Unicode MS;color:#666699; ">
							<!-- Output the value -->
							<xsl:value-of select="."/>
						</span>
					<!-- close linguist loop -->
					</xsl:for-each>
					<br/>
					<br/>
					<!-- For each forms element, do what is contained in the tags. -->
					<xsl:for-each select="forms">
						<table align="left" border="0" width="580">
							<!-- For each form element, -->
							<xsl:for-each select="form">
								<tr>
									<td align="left" width="580">
										<!-- for each orthographicform element -->
										<xsl:for-each select="orthographicform">
											<span style="font-family:Arial Unicode MS;color:#666699;font-weight:bold; ">
												<!--This tag applys any matching templates in the xsl file to the current node and its children. -->
												<xsl:apply-templates/>
											</span>
										</xsl:for-each>
										<span style="font-family:Arial Unicode MS; ">&#160;</span>
										<span style="font-family:Arial Unicode MS; ">&#160;</span>
										<xsl:for-each select="grammatical-relation">
											<xsl:choose>
												<xsl:when test="@pos='Noun'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>n</small>
														</span>
													</xsl:for-each>
												</xsl:when>
												<xsl:when test="@pos='Verb'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>v</small>
														</span>
													</xsl:for-each>
												</xsl:when>
												<xsl:when test="@pos='Particle'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>pc</small>
														</span>
													</xsl:for-each>
												</xsl:when>
												<xsl:when test="@pos='IndefinitePronoun'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>pr (indefi)</small>
														</span>
													</xsl:for-each>
												</xsl:when>
												<xsl:when test="@pos='Preverb'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>pv</small>
														</span>
													</xsl:for-each>
												</xsl:when>
											</xsl:choose>
										</xsl:for-each>
										<xsl:if test="featurevalue='AlienablyPossessed'">
											<xsl:if test="featurevalue='Animate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Possessibility'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>a</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="featurevalue='Inanimate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Possessibility'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>i</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
										</xsl:if>
										<xsl:if test="featurevalue='InalienablyPossessed'">
											<xsl:if test="featurevalue='Animate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Possessibility'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>ad</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="featurevalue='Inanimate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Possessibility'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>id</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
										</xsl:if>
										<xsl:if test="featurevalue='Transitive'">
											<xsl:if test="featurevalue='Animate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Transitivity'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>ta</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="featurevalue='Inanimate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Transitivity'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>ti</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
										</xsl:if>
										<xsl:if test="featurevalue='Intransitive'">
											<xsl:if test="featurevalue='Animate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Transitivity'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>ai</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
											<xsl:if test="featurevalue='Inanimate'">
												<xsl:for-each select="featurevalue">
													<xsl:choose>
														<xsl:when test="@type='Transitivity'">
															<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																<small>ii</small>
															</span>
														</xsl:when>
													</xsl:choose>
												</xsl:for-each>
											</xsl:if>
										</xsl:if>
										<xsl:if test="featurevalue='Plural'">
											<xsl:for-each select="featurevalue">
												<xsl:choose>
													<xsl:when test="@type='Number'">
														<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
															<small>(pl)</small>
														</span>
													</xsl:when>
												</xsl:choose>
											</xsl:for-each>
										</xsl:if>
										<xsl:for-each select="grammatical-relation">
											<xsl:choose>
												<xsl:when test="@pos='Participle'">
													<xsl:for-each select="@pos">
														<span style="font-family:Arial Unicode MS;color:#666699; font-style:italic;  ">
															<small>-pt</small>
														</span>
													</xsl:for-each>
												</xsl:when>
											</xsl:choose>
										</xsl:for-each>
										<span style="font-family:Arial Unicode MS; ">&#160;</span>
										<span style="font-family:Arial Unicode MS; ">&#160;</span>
										<xsl:for-each select="gloss/@value">
											<span style="font-family:Arial Unicode MS;color:#666699; ">
												<xsl:value-of select="."/>
												<xsl:if test="position() != last()" >; </xsl:if>
											</span>
										</xsl:for-each>
									</td>
								</tr>
								<tr>
									<td align="left" width="600">
										<table align="left" border="0" width="600">
											<xsl:for-each select="inflected-form">
												<tr>
													<td align="center" width="20">
														<span style="font-family:Arial Unicode MS; ">&#160;</span>
													</td>
													<td align="left" width="580">
														<xsl:if test="featurevalue='Plural'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Number'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>pl</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='1st'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Poss Pron Aff'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>pos</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='Pejorative'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Evaluative'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>pej</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='SpatialCase'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Case'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>loc</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='Diminutive'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Size'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>dim</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='Obviative'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Person'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>obv</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='VocativeCase'">
															<xsl:for-each select="featurevalue">
																<xsl:choose>
																	<xsl:when test="@type='Case'">
																		<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																			<small>voc</small>
																		</span>
																	</xsl:when>
																</xsl:choose>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='Singular'">
															<xsl:if test="featurevalue='FirstPerson'">
																<xsl:for-each select="featurevalue">
																	<xsl:choose>
																		<xsl:when test="@type='Number'">
																			<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																				<small>pos</small>
																			</span>
																		</xsl:when>
																	</xsl:choose>
																</xsl:for-each>
															</xsl:if>
														</xsl:if>
														<xsl:if test="featurevalue='ThirdPerson'">
															<xsl:for-each select="featurevalue">
																<xsl:if test="@type='Person'">
																	<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																		<small>3 sg</small>
																	</span>
																</xsl:if>
																<xsl:if test="@type='Clause Type'">
																	<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																		<small> prt</small>
																	</span>
																</xsl:if>
															</xsl:for-each>
														</xsl:if>
														<xsl:if test="featurevalue='Singular'">
															<xsl:if test="featurevalue='SecondPerson'">
																<xsl:if test="featurevalue='ImperativeMood'">
																	<xsl:for-each select="featurevalue">
																		<xsl:choose>
																			<xsl:when test="@type='Modality'">
																				<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																					<small>2 imp</small>
																				</span>
																			</xsl:when>
																		</xsl:choose>
																	</xsl:for-each>
																</xsl:if>
															</xsl:if>
														</xsl:if>
														<xsl:if test="featurevalue='Singular'">
															<xsl:if test="featurevalue='Inanimate'">
																<xsl:for-each select="featurevalue">
																	<xsl:choose>
																		<xsl:when test="@type='Gender'">
																			<span style="font-family:Arial Unicode MS;color:#666699;font-style:italic;  ">
																				<small>aug</small>
																			</span>
																		</xsl:when>
																	</xsl:choose>
																</xsl:for-each>
															</xsl:if>
														</xsl:if>
														<span style="font-family:Arial Unicode MS; ">&#160;</span>
														<span style="font-family:Arial Unicode MS; ">&#160;</span>
														<xsl:for-each select="iorthoform">
															<span style="font-family:Arial Unicode MS;color:#666699; font-weight:bold">
																<small>
																	<xsl:apply-templates/>
																</small>
															</span>
														</xsl:for-each>
													</td>
												</tr>
											</xsl:for-each>
											<xsl:for-each select="example-sentence">
												<tr>
													<td align="center" width="20">
														<span style="font-family:Arial Unicode MS; ">&#160;</span>
													</td>
													<td align="left" width="580">
														<xsl:choose>
															<xsl:when test="lang='Potawatomi'">
																<xsl:for-each select="example">
																	<span style="font-family:Arial Unicode MS;color:#666699; font-weight:bold">
																		<small>
																			<xsl:apply-templates/>
																		</small>
																	</span>
																</xsl:for-each>
															</xsl:when>
															<xsl:when test="lang='English'">
																<xsl:for-each select="example">
																	<span style="font-family:Arial Unicode MS;color:#666699; ">
																		<small>
																			<xsl:apply-templates/>
																		</small>
																	</span>
																</xsl:for-each>
															</xsl:when>
														</xsl:choose>
													</td>
												</tr>
											</xsl:for-each>
										</table>
									</td>
								</tr>
							</xsl:for-each>
						</table>
					</xsl:for-each>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>


