﻿<?xml version="1.0"?>
<!--
	Copyright (C) Microsoft Corporation 2003.
	All rights reserved.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	
	<xsl:import href="entities.xsl"/>
	<xsl:include href="txtdecor.xsl"/>
	
	<!--<xsl:include href="strings.xsl"/>-->
	<!-- We only need the following variable in strings.xsl -->
	<xsl:variable name="EDict_Or">or</xsl:variable>
	
	<xsl:variable name="g_title" select="'0'"/>
	<!-- only A has Prons for now, if this changes this needs to be moved to localized res -->
	<xsl:variable name="g_PronToolTip" select="'Click to hear this word spoken'"/>
	
	<xsl:template match="/">
	<HTML>
		<HEAD>
			<TITLE>
				<xsl:choose>
					<xsl:when test="/ARTICLE">
						<xsl:apply-templates select="/ARTICLE/Headword">
							<xsl:with-param name="for_title_text">1</xsl:with-param>
						</xsl:apply-templates>
					</xsl:when>
					<xsl:when test="/DICTIONARY">
						<xsl:apply-templates select="/DICTIONARY/HOMOGRAPH/HEAD/HEADWORD/ENTRY">
							<xsl:with-param name="for_title_text">1</xsl:with-param>
						</xsl:apply-templates>
					</xsl:when>
				</xsl:choose>
			</TITLE>
		<STYLE>
		BODY
		{
			margin-left:6pt;
			margin-top:3pt;
			margin-right:3pt;
			margin-bottom:3pt;
			font-size:8pt;
			font-family:"MS Reference Sans Serif";
			line-height:10pt;
			overflow:auto;
		}

		SPAN.DEFINITION
		{
			text-indent:11.25pt;
			font-size:8pt;
			font-family:"MS Reference Sans Serif";
			line-height:10pt;
		}

		SPAN.XREF
		{
			color:#0000FF;
			<!--cursor:hand;-->
		}

		div.pron
		{
			font-size:8pt;
			font-family:"MS Reference Sans Serif";
			color=#7f261c;
			margin-bottom:4.5pt;
			<!--
			<xsl:if test="/DICTIONARY/HOMOGRAPH[@Variety= 'US' or @Variety='UK']">
			cursor: hand;
			</xsl:if>
			-->
		}
		span.pron
		{
			font-size:8pt;
			font-family:"MS Reference Sans Serif";
			color=#7f261c;
			margin-bottom:4.5pt;
			<!--
			<xsl:if test="/DICTIONARY/HOMOGRAPH[@Variety= 'US' or @Variety='UK']">
			cursor: hand;
			</xsl:if>
			-->
		}
		TD.DEFINITION
		{
			font-size:8pt;
			font-family:"MS Reference Sans Serif";
			line-height:10pt;
		}

		SPAN.SUBJECT
		{
			font-size:7pt;
			text-transform:uppercase;
		}
		td.headword
		{
			font-size:16pt;
			font-family:"MS Reference Sans Serif";
		}
		div.headword
		{
			font-size:16pt;
			font-family:"MS Reference Sans Serif";
		}
		div.headword_rule
		{
			font-size:0.75pt;
			border=0pt solid #8E8E8E; 
			border-top-width:0.75pt; 
			margin-top:4.5pt;
			margin-bottom:4.5pt;
			
		}
		div.EssayHdr
		{
			font-size:9pt;
			font-weight:bold;
			font-family:"MS Reference Sans Serif";
			background-color:#C0C0C0;
			padding-left:2pt;
			padding-top:1pt;
			padding-bottom:1pt;
			margine-bottom:6pt;
		}
		</STYLE>

		<!--
		<script src="mediascript.js"></script>
		<script>
			g_fClosedCaptionOn = 0;
		</script>
		<script>
			var g_RealURL = "";
			var g_LocalURL = "";			
			function PlayPronOrCHD (URL)
			{
				if (!(window.external.TryPlayPron(URL)))
				{
					window.external.DoCHDForPronFile();
				}
			}
			function ShowPronKey()
			{
				<xsl:if test="/DICTIONARY/HOMOGRAPH[@Variety= 'US' or @Variety='UK']">
				window.navigate('res://edictres.dll/23/EDict_PronKey.htm');
				</xsl:if>
				return;
			}
		</script>
		-->
		
		</HEAD>
		
		<BODY>
		
			<!--
			<xsl:attribute name="ondragstart">return false;</xsl:attribute>
			<xsl:if test="not (/ARTICLE)">
				<xsl:attribute name="ondblclick">onDoubleClick();</xsl:attribute>
			</xsl:if>
			-->
			
			<xsl:choose>
				<xsl:when test="DICTIONARY">
					<xsl:apply-templates select="DICTIONARY"/>
				</xsl:when>
				<xsl:when test="ARTICLE">
					<xsl:apply-templates select="ARTICLE"/>
				</xsl:when>
			</xsl:choose>			

		<!--
		<span id="MsEncartaURL" style="display:none" onclick="this.innerText=window.external.GetMsEncartaURL()"></span>
		-->
		
		</BODY>
	</HTML>
	</xsl:template>

	<xsl:template match="DICTIONARY"><xsl:apply-templates/></xsl:template>
	<xsl:template match="ARTICLE">
		<xsl:apply-templates select="Headword"/>
		<xsl:apply-templates>
			<xsl:with-param name="skip_headword">1</xsl:with-param>
		</xsl:apply-templates>
	</xsl:template>
	
	<xsl:template match="HOMOGRAPH"><xsl:apply-templates/></xsl:template>
	<xsl:template match="HEAD"><xsl:apply-templates/></xsl:template>
	<xsl:template match="ILLUSTRATION"/>
	
	<xsl:template match="HEADWORD">
		<xsl:apply-templates select="ENTRY"/>
		<xsl:apply-templates select="PRONS"/>
		<xsl:apply-templates select="INFLECTIONS"/>
	</xsl:template>

	
	<xsl:template match="Headword">
		<xsl:param name="for_title_text"/>
		<xsl:param name="skip_headword"/>
		<xsl:if test=" not ($skip_headword)">
			<xsl:choose>
				<xsl:when test="$for_title_text">
					<xsl:apply-templates/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:choose>
						<xsl:when test="/ARTICLE">
							<div class="headword">
								<xsl:apply-templates/>
							</div>
							<xsl:if test="Homograph">
								<div style="height:10pt;"/>
							</xsl:if>
							<div class="headword_rule"/>
						</xsl:when>
						<xsl:otherwise>
							<B><xsl:apply-templates/></B><BR/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="Pos">
		<i><xsl:apply-templates/><xsl:text>&#x00A0;</xsl:text></i>
	</xsl:template>
	
	<xsl:template match="Label"><i><xsl:apply-templates/></i><xsl:text>&#x00A0;</xsl:text></xsl:template>
	<xsl:template match="Text"><xsl:apply-templates/></xsl:template>
	
	<xsl:template match="ENTRY">
		<xsl:param name="for_title_text"/>
		<xsl:choose>
			<xsl:when test="$for_title_text">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="name(parent::*) = 'HEADWORD'">
						<table cellpadding="0" cellspacing="0" border="0">
							<tr><td  class="headword">
								<xsl:apply-templates>
									<xsl:with-param name="hide-cdots">1</xsl:with-param>
								</xsl:apply-templates>
								<xsl:if test="../HOMO-NUM">
									<xsl:apply-templates select="../HOMO-NUM"/>
								</xsl:if>
								<xsl:if test="/ENTRY/HOMOGRAPH/BODY/POS/SENSES/SENSE/BIO-DEF/FORENAMES">, <xsl:value-of select="/ENTRY/HOMOGRAPH/BODY/POS/SENSES/SENSE/BIO-DEF/FORENAMES"/></xsl:if>
								<xsl:if test="/ENTRY/HOMOGRAPH/BODY/POS/SENSES/SENSE/BIO-DEF/TITLE"><xsl:text>&#x00A0;</xsl:text><xsl:value-of select="/ENTRY/HOMOGRAPH/BODY/POS/SENSES/SENSE/BIO-DEF/TITLE"/></xsl:if>
								
							</td><td style="width:4.5pt;">
							</td><td>
							
								<!--
								<xsl:if test="//AUDIO_PRON">								
									<img style="cursor:hand">
										<xsl:attribute name="src">res://edictres.dll/JPG/EDict_Pron_Button</xsl:attribute>
										<xsl:attribute name="onClick">
											PlayPronOrCHD (<xsl:text>"</xsl:text><xsl:value-of select="//AUDIO_PRON/FG_AUDIO_WAV"/><xsl:text>"</xsl:text>);
										</xsl:attribute>
										<xsl:attribute name="alt"><xsl:value-of select="$g_PronToolTip"/></xsl:attribute>
									</img>
								</xsl:if>
								-->
								
							</td></tr>
						</table>
						<div class="headword_rule"></div>
					</xsl:when>
					<xsl:otherwise>
						<xsl:choose>
							<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'F']">
								<xsl:apply-templates/>
							</xsl:when>
							<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N'] and ancestor::ONE-INFLECTION">
								<xsl:apply-templates/>
							</xsl:when>
							<xsl:otherwise>
								<B><xsl:apply-templates/></B>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="PRON"><xsl:if test="position()!='1'">, </xsl:if><xsl:apply-templates/></xsl:template>
	<xsl:template match="PRONS">
		<xsl:choose>
			<xsl:when test="position()='1'">
				<div>
					<b><xsl:apply-templates select="ancestor::HEADWORD/ENTRY">
						<xsl:with-param name="for_title_text">1</xsl:with-param>
					</xsl:apply-templates><xsl:text>&#x00A0;</xsl:text></b>
					<span class="PRON">[<xsl:apply-templates/>]</span>
				</div>
				<xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text> </xsl:text><span class="PRON">[<xsl:apply-templates/>]</span>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template match="Homograph"><SUP><xsl:apply-templates/></SUP></xsl:template>
	<xsl:template match="HOMO-NUM"><SUP><xsl:apply-templates/></SUP> </xsl:template>
	<xsl:template match="VARIANT">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:if test="not(ancestor::PHRASE-SENSE/SENSE-NUMBER)"><BR/></xsl:if>
				<xsl:apply-templates/><xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<I><xsl:text> </xsl:text><xsl:value-of select="$EDict_Or"/><xsl:text> </xsl:text></I><xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="CORE-MEANING"><xsl:text> </xsl:text>CORE-MEANING: <xsl:apply-templates/></xsl:template>
	<xsl:template match="QUICK-DEFINITION">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
					<B><xsl:apply-templates/>:<xsl:text> </xsl:text></B>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="DEFINITION"><xsl:apply-templates/></xsl:template>
	<xsl:template match="DEF"><xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="EXAMPLES">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:text> </xsl:text><I><xsl:apply-templates/></I><xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<LI><I><xsl:apply-templates/></I></LI>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="PHRASES">
		<xsl:if test="not(ancestor::HOMOGRAPH/BODY)">
			<BR />
			<BR />
		</xsl:if>
		<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="ONE-PHRASE"><div style="padding-bottom:4.5pt;"><xsl:apply-templates/></div></xsl:template>
	<xsl:template match="AUDIO_PRON"></xsl:template>

	<xsl:template match="INFLECTIONS">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'F']">
				<xsl:if test="./ENTRY-INF-TYPE/ONE-INFLECTION/ENTRY/INFLECT">
					<xsl:text> </xsl:text>(<xsl:apply-templates/>)
				</xsl:if>
			</xsl:when>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:if test="./INFLECTION/ONE-INFLECTION/ENTRY/text()">
					<xsl:text> </xsl:text>(<xsl:apply-templates/>)
				</xsl:if>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text> </xsl:text>(<xsl:apply-templates/>)
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="INFLECTION">
		<xsl:apply-templates/><xsl:if test="position()!=last()">, </xsl:if>
	</xsl:template>
	<xsl:template match="ONE-INFLECTION">
		<xsl:apply-templates/><xsl:if test="position()!=last()"><I> or </I></xsl:if>
	</xsl:template>
	<xsl:template match="INFLECT"><xsl:text> </xsl:text><xsl:apply-templates/></xsl:template>
	<xsl:template match="ENTRY-INF-TYPE"><I><xsl:apply-templates/></I><xsl:text> </xsl:text></xsl:template>

	<xsl:template match="BODY"><xsl:apply-templates/></xsl:template>
	<xsl:template match="POS"><xsl:apply-templates/></xsl:template>
	<xsl:template match="PARTS-OF-SPEECH">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:choose>
					<xsl:when test="ancestor::SENSE/EXAMPLES/GRAM or ancestor::SENSE/STYLE-LEVEL">
						<xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text>
					</xsl:when>
					<xsl:otherwise>
						<div style="padding-bottom:6pt;"><xsl:apply-templates/><xsl:text> </xsl:text></div>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
				<div style="padding-bottom:6pt;"><xsl:apply-templates/><xsl:text> </xsl:text></div>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
		
	<xsl:template match="ONE-POS"><xsl:if test="position()!='1'">, </xsl:if><xsl:apply-templates/></xsl:template>
	<xsl:template match="GRAM">
		<xsl:if test="position() > 1">
			<xsl:text>&#x2022;</xsl:text>
		</xsl:if> 
		<xsl:text> </xsl:text><I><xsl:apply-templates/></I><xsl:text> </xsl:text>
	</xsl:template>
	<xsl:template match="PART-OF-SPEECH"><xsl:text> </xsl:text><I><xsl:apply-templates/></I><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="STYLE-LEVEL">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text> </xsl:text>(<I><xsl:apply-templates/></I>)<xsl:text> </xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="TAIL"><xsl:apply-templates/></xsl:template>
	<xsl:template match="ETYMOLOGY">[<xsl:apply-templates/>]<P/></xsl:template>
	<xsl:template match="ESSAYS"><xsl:apply-templates/></xsl:template>
	<xsl:template match="ESSAY"><div style="padding-top:9pt;"/><xsl:apply-templates/></xsl:template>
	<xsl:template match="SYNONYM-ESSAY">
		<div class="EssayHdr">Word Key: Synonyms</div>
		<div style="padding-left:9pt;width:66%"><xsl:apply-templates/></div>
	</xsl:template>
	<xsl:template match="SYNONYM">
		<span>
			<b><xsl:apply-templates/></b>
			<xsl:if test="position()!=last()"><xsl:text>,&#x00A0;</xsl:text></xsl:if>
		</span>
	</xsl:template>
	<xsl:template match="THEME">
		<div style="margin-bottom:9pt;margin-bottom:6pt;">CORE MEANING:<xsl:text>&#x00A0;</xsl:text><xsl:apply-templates/></div>
	</xsl:template>
	<xsl:template match="ITEM-REF">
		<span><b><xsl:apply-templates/></b>
		<xsl:text> </xsl:text></span>
	</xsl:template>
	<xsl:template match="ITEM">
		<span>
			<xsl:apply-templates/>
			<xsl:if test="position()!=last()"><xsl:text>;&#x00A0;</xsl:text>
		</xsl:if>
		</span>
	</xsl:template>
	<xsl:template match="CULT-ESSAY">
		<div class="EssayHdr">Cultural Note</div>
		<div style="margin-top:9pt;padding-left:9pt;width:66%"><xsl:apply-templates/></div>
	</xsl:template>
	<xsl:template match="PARA"><P/><xsl:apply-templates/></xsl:template>
	<xsl:template match="AUTH">
		<span style="font-variant:small-caps">
			<xsl:apply-templates/><xsl:text> </xsl:text>
		</span>
	</xsl:template>
	<xsl:template match="ENC"><div><xsl:apply-templates/></div></xsl:template>
	
	<xsl:template match="RUNONS"/>

	<xsl:template match="ANC"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="ANC-REF"><xsl:text> </xsl:text><I><xsl:apply-templates/></I></xsl:template>	
	<xsl:template match="TITLE">
		<xsl:choose>
			<xsl:when test="name(parent::*)='BIO-DEF'">
				<!-- Do nothing we have it in the headword -->
				
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="SENSES">
		<xsl:if test="SENSE/BIO-DEF">
			<xsl:if test="SENSE/BIO-DEF/DOB">
				<xsl:text> </xsl:text>(<xsl:value-of select="SENSE/BIO-DEF/DOB"/>
				<xsl:if test="SENSE/BIO-DEF/DOD">
					-<xsl:value-of select="SENSE/BIO-DEF/DOD"/>
				</xsl:if>)
			</xsl:if>
		</xsl:if>
		<TABLE border="0" cellspacing="0" cellpadding="0">
			<xsl:apply-templates/>
		</TABLE>
		<P/>
	</xsl:template>

	<xsl:template match="TIT">
		<i><xsl:apply-templates/></i><xsl:text> </xsl:text>
	</xsl:template>
	<xsl:template match="CITATION">
		<i><xsl:apply-templates/></i><xsl:text> </xsl:text>
	</xsl:template>
	<xsl:template match="/ENTRY/HOMOGRAPH/BODY/POS/SENSES/SENSE/VARIANT">
		<B><xsl:apply-templates/></B><BR/>
	</xsl:template>
	
	<xsl:template match="RUNONS"><xsl:apply-templates/></xsl:template>
	<xsl:template match="RUNON"><BR/>-<xsl:apply-templates/>,<xsl:text> </xsl:text></xsl:template>
	<xsl:template match="ONE-RUNON"><xsl:apply-templates/></xsl:template>
	<xsl:template match="RUNON-POS"><xsl:apply-templates/></xsl:template>

	<xsl:template match="FORENAMES">
		<xsl:if test="name(parent::*)='XREF-ENTRY'">,<xsl:text>&#x00A0;</xsl:text><xsl:apply-templates/>
		</xsl:if>
	</xsl:template>
	<xsl:template match="DOB"></xsl:template>
	<xsl:template match="DOD"></xsl:template>
	<xsl:template match="NATIONALITY"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="DESIGNATION"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>

	<xsl:template match="AREA"><BR/>Area: <xsl:apply-templates/></xsl:template>
	<xsl:template match="CAPITAL"><BR/>Capital: <xsl:apply-templates/></xsl:template>
	<xsl:template match="POPULATION"><BR/>Population: <xsl:apply-templates/></xsl:template>
	<xsl:template match="POP-DATE"> (<xsl:apply-templates/>)</xsl:template>

	<xsl:template match="HEIGHT"><BR/>Height: <xsl:apply-templates/></xsl:template>
	<xsl:template match="LENGTH"><BR/>Length: <xsl:apply-templates/></xsl:template>
	<xsl:template match="MET">
		<xsl:apply-templates/><xsl:if test="position()!=last()">/</xsl:if>
	</xsl:template>		
	<xsl:template match="IMP">
		<xsl:apply-templates/><xsl:if test="position()!=last()">/</xsl:if>
	</xsl:template>		

	<xsl:template match="CURRENCY"><BR/>Currency: <xsl:apply-templates/></xsl:template>
	<xsl:template match="LANGUAGES"><BR/>Language: <xsl:apply-templates/></xsl:template>
	<xsl:template match="LANGUAGE">
		<xsl:apply-templates/><xsl:if test="position()!=last()">, </xsl:if>
	</xsl:template>

	<xsl:template match="SENSE">
		<TR valign="top" style="padding-bottom:3pt;">
			<xsl:choose>
				<xsl:when test="SENSE-NUMBER">
					<TD class="DEFINITION" width="18.75pt">
						<B><xsl:value-of select="SENSE-NUMBER"/>. </B>
					</TD>
				</xsl:when>
				<xsl:otherwise><TD><xsl:text> </xsl:text></TD>
				</xsl:otherwise>
			</xsl:choose>
			<TD class="DEFINITION">
				<xsl:apply-templates/>
			</TD>
		</TR>
	</xsl:template>

	<xsl:template match="PHRASE-SENSE">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
				<xsl:if test="position() != '1'"><BR/><BR/></xsl:if>
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="SENSE-NUMBER">
		<xsl:if test="/DICTIONARY/HOMOGRAPH[@Variety= 'N']">
			<xsl:apply-templates/>.<xsl:text> </xsl:text>
		</xsl:if>
	</xsl:template>
	<xsl:template match="SYNTAX-CODING"><I><xsl:apply-templates/></I><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="SUBJECT-AREA"><SPAN class="SUBJECT"><xsl:apply-templates/></SPAN><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="DIALECT"><I><xsl:apply-templates/></I><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="ANA"><xsl:apply-templates/> </xsl:template>
	<xsl:template match="BIB">(<xsl:apply-templates/>) </xsl:template>
	<xsl:template match="NI"><I><xsl:apply-templates/></I></xsl:template>
	<xsl:template match="CF"><BR/>Formula: <xsl:apply-templates/></xsl:template>
	<xsl:template match="SUB"><xsl:apply-templates/></xsl:template>
	<xsl:template match="TAX"><BR/><xsl:apply-templates/></xsl:template>
	<xsl:template match="TAX-LEVEL"><xsl:apply-templates/>: </xsl:template>
	<xsl:template match="TAX-CLASS"><I><xsl:apply-templates/></I> </xsl:template>
	<xsl:template match="scstat"><xsl:apply-templates/></xsl:template>
	<xsl:template match="SCSTAT"><xsl:apply-templates/></xsl:template>
	<xsl:template match="USAGE-NOTE">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'F']">
				<I><xsl:apply-templates/></I>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text> </xsl:text>(<I><xsl:apply-templates/></I>)<xsl:text> </xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="USAGE"><BR/><xsl:apply-templates/></xsl:template>
	<xsl:template match="SC"><xsl:apply-templates/></xsl:template>
	<xsl:template match="XREF-GROUP">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'F']">
				<BR/><xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates/><xsl:if test="position()!=last()"><BR/></xsl:if>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="XREF-TYPE">
		<xsl:if test=".='='">
			<I>See </I>
		</xsl:if>
		<xsl:if test=".!='='">
			<xsl:text> </xsl:text><I><xsl:apply-templates/><xsl:text> </xsl:text></I>
		</xsl:if>
	</xsl:template>
	<xsl:template match="XREF-ENTRY">
		<xsl:choose>
			<xsl:when test = "@TargetRefID">
				<SPAN class="XREF">
					<!--
					<xsl:attribute name="onclick">
						window.external.onQVClick(<xsl:value-of select="@TargetRefID"/>);
					</xsl:attribute>
					-->
					<xsl:apply-templates/> 
				</SPAN>
			</xsl:when>
			<xsl:otherwise>
				<xsl:apply-templates/> 
			</xsl:otherwise>
		</xsl:choose>	
	</xsl:template>

	<xsl:template match="HWREF"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>

	<xsl:template match="COG-LANG"><xsl:apply-templates/><xsl:text> </xsl:text></xsl:template>
	<xsl:template match="COG-REF"><xsl:text> </xsl:text><span style="font-variant:small-caps;"><I><xsl:apply-templates/></I></span></xsl:template>

	<xsl:template match="FONT">
		<FONT>
			<xsl:attribute name="COLOR">
				<xsl:value-of select='@COLOR'/>
			</xsl:attribute>
			<xsl:apply-templates/>
		</FONT>
	</xsl:template>
	
	<xsl:template match="font">
		<FONT>
			<xsl:attribute name="color">
				<xsl:value-of select='@color'/>
			</xsl:attribute>
			<xsl:apply-templates/>
		</FONT>
	</xsl:template>

	<xsl:template match="SUBLABEL">
		<span style="text-transform:uppercase;"><xsl:apply-templates/><xsl:text> </xsl:text></span>
	</xsl:template>
	<xsl:template match="SUBPREFIX">
		<span style="font-variant:small-caps;">:<xsl:text> </xsl:text><xsl:apply-templates/><xsl:text> </xsl:text></span>
	</xsl:template>
	
	<xsl:template match="TRADEMARK">
		<span class="DEFINITION"><xsl:text> </xsl:text><xsl:apply-templates/></span>
	</xsl:template>
	
	<!--French dictionary -->
	<!-- <xsl:template match="hw">
		<font face="MS Reference Sans Serif">	
		<br />		
		<font size="3">
			<b>
			<xsl:apply-templates select="orth" />
			</b>
			<xsl:if test="@trademark[.='yes']"><xsl:text>&#x00A0;</xsl:text><i>marque d&#233;pos&#233;e</i><xsl:text>&#x00A0;</xsl:text></xsl:if>		
		</font>
		<xsl:text>&#x00A0;</xsl:text>
		<xsl:apply-templates select="phon" />
		<xsl:apply-templates select="posgroup" />
		</font>
	</xsl:template>
	
	<xsl:template match="orth">
		<xsl:param name="for_title_text"/>
		<xsl:choose>
			<xsl:when test="$for_title_text">
				<xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<b><xsl:apply-templates/></b>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template match="phon">[<font face="MS Reference Sans Serif"><xsl:apply-templates/></font>]<xsl:text>&#x00A0;</xsl:text></xsl:template>

	<xsl:template match="posgroup">
		<xsl:for-each select="posentry">
			<xsl:if test="position() > 1"><br /></xsl:if> 
			<xsl:apply-templates select="posinfo" />
			<xsl:apply-templates select="defgroup" />
			<xsl:apply-templates select="usage" />
			<xsl:apply-templates select="xref" />
			<br />
		</xsl:for-each>
	</xsl:template>

	<xsl:template match="defgroup">
		 
		<xsl:if test="count(defentry) > 1">																								
			<xsl:for-each select="defentry">
				<br />
				
				<b><xsl:number value="position()" format="1. "/>&#160;&#160;&#160;&#160;</b>
				
				<xsl:if test="sublabel">
					[<xsl:apply-templates select="sublabel" /><xsl:apply-templates select="subprefix" />]
				</xsl:if>
				
				<xsl:apply-templates select="def" />
				
				<xsl:if test="discourse | region | connotation">
					<i> (<xsl:apply-templates select="discourse" /><xsl:if test="discourse and region">; </xsl:if><xsl:if test="discourse and connotation">; </xsl:if>
					<xsl:apply-templates select="region" /><xsl:if test="region and connotation">; </xsl:if>
					<xsl:apply-templates select="connotation" />) </i>
				</xsl:if>
				
				<xsl:variable name="spaces"><xsl:text>&#x00A0;&#x00A0;</xsl:text></xsl:variable>

				<xsl:apply-templates select="exlbugroup" />
				<xsl:apply-templates select="xref" />
				<xsl:apply-templates select="usage" />
				
	 		</xsl:for-each>
		</xsl:if>
		<xsl:if test="count(defentry) = 1">
			<xsl:for-each select="defentry">
				<br />
				
				<xsl:if test="sublabel">
					[<xsl:apply-templates select="sublabel" /><xsl:apply-templates select="subprefix" />]
				</xsl:if>
				
				<xsl:apply-templates select="def" />

				<xsl:if test="discourse | region | connotation">
					<i> (<xsl:apply-templates select="discourse" /><xsl:if test="discourse and region">; </xsl:if><xsl:if test="discourse and connotation">; </xsl:if>
					<xsl:apply-templates select="region" /><xsl:if test="region and connotation">; </xsl:if>
					<xsl:apply-templates select="connotation" />) </i>
				</xsl:if>
				
				<xsl:variable name="spaces"></xsl:variable>

				<xsl:apply-templates select="exlbugroup" />
				<xsl:apply-templates select="xref" />
				<xsl:apply-templates select="usage" />

	 		</xsl:for-each>
		</xsl:if>
	</xsl:template>


	<xsl:template match="exlbugroup">
		<xsl:if test="position() = 1"><br />&#160;&#160;&#160;&#160;&#160;</xsl:if> 
		<xsl:if test="position() > 1"><xsl:text>&#x00A0;</xsl:text></xsl:if> 
		<xsl:for-each select="exentry">&#x2022;<xsl:text>&#x00A0;</xsl:text><i><xsl:apply-templates select="ex" /></i><xsl:text>&#x00A0;</xsl:text></xsl:for-each>
	</xsl:template>

	<xsl:template match="xref">
		<br />
		<xsl:choose>
			<xsl:when test="xrefdef">
				<xsl:choose>
					<xsl:when test="xreftype[text()='synonyme']">
							[Synonyme: <xsl:apply-templates select="xreforth" />] 
					</xsl:when>
					<xsl:when test="xreftype[text()='renvoi sec']">[Voir <b><xsl:apply-templates select="xreforth" /></b>]</xsl:when>
					<xsl:when test="xreftype[text()='variante graphique']">[S'&#233;crit aussi: <b><xsl:apply-templates select="xreforth" /></b>]</xsl:when>
					<xsl:when test="xreftype[text()='syntagme dÃ©veloppÃ©']">[<xsl:apply-templates select="../../../../../orth" /> = <xsl:apply-templates select="xreforth" />]</xsl:when>				
					<xsl:otherwise>[<xsl:apply-templates select="xreftype" />: <xsl:apply-templates select="xreforth" />]</xsl:otherwise>
				</xsl:choose>
			</xsl:when>
			<xsl:otherwise>
					<xsl:choose>
					<xsl:when test="xreftype[text()='synonyme']">[Synonyme: <b><xsl:apply-templates select="xreforth" /></b>]</xsl:when>
					<xsl:when test="xreftype[text()='renvoi sec']">[Voir <b><xsl:apply-templates select="xreforth" /></b>]</xsl:when>
					<xsl:when test="xreftype[text()='variante graphique']">[S'&#233;crit aussi: <b><xsl:apply-templates select="xreforth" /></b>]</xsl:when>
					<xsl:when test="xreftype[text()='syntagme dÃ©veloppÃ©']">[<xsl:apply-templates select="../../../../../orth" /> = <xsl:apply-templates select="xreforth" />]</xsl:when>				
					<xsl:otherwise>[<xsl:apply-templates select="xreftype" />: <xsl:apply-templates select="xreforth" />]</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="usage">
		<br />
		[Remarque d'usage:  <xsl:apply-templates/>]
	</xsl:template>

	<xsl:template match="discourse"><xsl:apply-templates/></xsl:template>
	<xsl:template match="region"><xsl:apply-templates/></xsl:template>
	<xsl:template match="connotation"><xsl:apply-templates/></xsl:template>
	<xsl:template match="sublabel"><xsl:apply-templates/></xsl:template>
	<xsl:template match="subprefix">: <xsl:apply-templates/></xsl:template>
	<xsl:template match="poslabel"><i> <xsl:apply-templates/> </i></xsl:template>
	<xsl:template match="posattr"><i>- <xsl:apply-templates/> </i> </xsl:template>
	<xsl:template match="singplural"><i>; <xsl:apply-templates/></i> </xsl:template>
	<xsl:template match="inflect"><i>; <xsl:apply-templates/> </i></xsl:template>-->

	<!-- Phonetics for French -->
	<xsl:template match="entity[@tag='IPA140']">x</xsl:template>
	<xsl:template match="entity[@tag='IPA101']">p</xsl:template>
	<xsl:template match="entity[@tag='IPA102']">b</xsl:template>
	<xsl:template match="entity[@tag='IPA103']">t</xsl:template>
	<xsl:template match="entity[@tag='IPA104']">d</xsl:template>
	<xsl:template match="entity[@tag='IPA109']">k</xsl:template>
	<xsl:template match="entity[@tag='IPA110']">g</xsl:template>
	<xsl:template match="entity[@tag='IPA113']">?</xsl:template>
	<xsl:template match="entity[@tag='IPA114']">m</xsl:template>
	<xsl:template match="entity[@tag='IPA116']">n</xsl:template>
	<xsl:template match="entity[@tag='IPA118']">&#x0272;</xsl:template>
	<xsl:template match="entity[@tag='IPA119']">&#x014B;</xsl:template>
	<xsl:template match="entity[@tag='IPA123']">&#x0280;</xsl:template>
	<xsl:template match="entity[@tag='IPA128']">f</xsl:template>
	<xsl:template match="entity[@tag='IPA129']">v</xsl:template>
	<xsl:template match="entity[@tag='IPA132']">s</xsl:template>
	<xsl:template match="entity[@tag='IPA133']">z</xsl:template>
	<xsl:template match="entity[@tag='IPA134']">&#x222B;</xsl:template>
	<xsl:template match="entity[@tag='IPA135']">&#x0292;</xsl:template>
	<xsl:template match="entity[@tag='IPA153']">j</xsl:template>
	<xsl:template match="entity[@tag='IPA155']">l</xsl:template>
	<xsl:template match="entity[@tag='IPA170']">w</xsl:template>
	<xsl:template match="entity[@tag='IPA171']">&#x0265;</xsl:template>
	<xsl:template match="entity[@tag='IPA301']">i</xsl:template>
	<xsl:template match="entity[@tag='IPA302']">e</xsl:template>
	<xsl:template match="entity[@tag='IPA303']">&#x03B5;</xsl:template>
	<xsl:template match="entity[@tag='IPA304']">a</xsl:template>
	<xsl:template match="entity[@tag='IPA305']">&#x0251;</xsl:template>
	<xsl:template match="entity[@tag='IPA306']">&#x0254;</xsl:template>
	<xsl:template match="entity[@tag='IPA307']">o</xsl:template>
	<xsl:template match="entity[@tag='IPA308']">u</xsl:template>
	<xsl:template match="entity[@tag='IPA309']">y</xsl:template>
	<xsl:template match="entity[@tag='IPA310']">&#x00f8;</xsl:template>
	<xsl:template match="entity[@tag='IPA311']">&#x0153;</xsl:template>
	<xsl:template match="entity[@tag='IPA311A']">&#x0152;</xsl:template>
	<xsl:template match="entity[@tag='IPA322']">&#x0259;</xsl:template>
	<xsl:template match="entity[@tag='IPA501']">'</xsl:template>
	<xsl:template match="entity[@tag='IPA506']">.</xsl:template>
	<xsl:template match="entity[@tag='IPAF736']">&#xF736;</xsl:template>
	<xsl:template match="entity[@tag='IPAF772']">&#xF772;</xsl:template>
	<xsl:template match="entity[@tag='IPAF706']">&#xF706;</xsl:template>
	<xsl:template match="entity[@tag='IPAF77C']">&#xF77C;</xsl:template>
	
	<xsl:template match="entity[@tag='cdot']">
		<xsl:param name="hide-cdots"></xsl:param>
		<xsl:if test="not ($hide-cdots)">&#x00B7;</xsl:if>
	</xsl:template>
	
	<!-- Phonetics for French -->
	<!--End French dictionary-->
	
	<xsl:template match="A"><xsl:apply-templates/></xsl:template>
	<xsl:template match="a"><xsl:apply-templates/><xsl:text>&#x00A0;</xsl:text></xsl:template>
	<xsl:template match="SUB"><SUB><xsl:apply-templates/></SUB></xsl:template>
	<xsl:template match="sub"><SUB><xsl:apply-templates/></SUB></xsl:template>
	<xsl:template match="SUP"><SUP><xsl:apply-templates/></SUP></xsl:template>
	<xsl:template match="sup"><SUP><xsl:apply-templates/></SUP></xsl:template>
	<xsl:template match="SUBIND"><SUB><xsl:apply-templates/></SUB></xsl:template>
	<xsl:template match="SUPIND"><SUP><xsl:apply-templates/></SUP></xsl:template>
	<xsl:template match="B"><B><xsl:apply-templates/></B></xsl:template>
	<xsl:template match="U"><U><xsl:apply-templates/></U></xsl:template>
	<xsl:template match="b"><B><xsl:apply-templates/></B></xsl:template>
	<xsl:template match="I"><I><xsl:apply-templates/></I></xsl:template>
	<xsl:template match="i">
		<xsl:choose>
			<xsl:when test="/DICTIONARY/HOMOGRAPH[@Variety= 'F']">
				<I><xsl:apply-templates/></I><xsl:text> </xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<I><xsl:apply-templates/></I>
			</xsl:otherwise>
		</xsl:choose>
		
	</xsl:template>
	<xsl:template match="ITAL"><I><xsl:apply-templates/></I></xsl:template>
	<xsl:template match="BR"><BR/></xsl:template>
	<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>		

	
</xsl:stylesheet>
					

