home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8"?>
-
- <xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:html="http://www.w3.org/TR/html4/loose.dtd"
- exclude-result-prefixes="html"
- version="1.0">
-
- <xsl:import href="Variables.xsl"/>
-
- <xsl:output method="html" encoding="UTF-8"/>
-
- <xsl:template match="index_entry">
- <xsl:choose>
- <xsl:when test="not(short_articles) and article_ref"><xsl:apply-templates select="headword" mode="linked"/></xsl:when>
- <xsl:otherwise><xsl:apply-templates select="headword"/></xsl:otherwise>
- </xsl:choose>
- <ul><xsl:apply-templates select="short_articles | article_ref | bboys | stats | tables | photographs | illustrations | diagrams | graphs | figures | struct_formulae | chem_formulae | maps | periodic_tables | flags | images | videos | audio | animations | multimedia | text_refs"/></ul>
- </xsl:template>
-
- <xsl:template name="text_link">
- <xsl:param name="articleId"></xsl:param>
- <xsl:param name="body"></xsl:param>
-
- <a href="{$articleURL}?ArticleId={$articleId}">
- <xsl:choose>
- <xsl:when test="$body != ''"><xsl:value-of select="$body"/></xsl:when>
- <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
- </xsl:choose>
- </a>
- </xsl:template>
-
- <xsl:template name="assembly_link">
- <xsl:param name="id"></xsl:param>
- <xsl:param name="body"></xsl:param>
-
- <a href="{$assemblyURL}?id={$id}&type=A">
- <xsl:choose>
- <xsl:when test="$body != ''"><xsl:value-of select="$body"/></xsl:when>
- <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
- </xsl:choose>
- </a>
- </xsl:template>
-
- <xsl:template name="binary_link">
- <xsl:param name="id"></xsl:param>
- <xsl:param name="body"></xsl:param>
-
- <a href="{$assemblyURL}?id={$id}&type=I">
- <xsl:choose>
- <xsl:when test="$body != ''"><xsl:value-of select="$body"/></xsl:when>
- <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
- </xsl:choose>
- </a>
- </xsl:template>
-
- <xsl:template name="index_link">
- <xsl:param name="id"></xsl:param>
- <xsl:param name="body"></xsl:param>
- <xsl:choose>
- <xsl:when test="$body != ''">
- <a href="{$topicURL}?idxStructId={$id}">&typeId=13<xsl:value-of select="$body"/></a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{$topicURL}?idxStructId={$id}"><xsl:apply-templates/></a>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="headword" mode="linked">
- <p>
- <b>
- <xsl:call-template name="text_link">
- <xsl:with-param name="tocid"><xsl:value-of select="../article_ref//text_ref/@tocid"/></xsl:with-param>
- <xsl:with-param name="articleId"><xsl:value-of select="../article_ref//text_ref/@artclid"/></xsl:with-param>
- <xsl:with-param name="hook"><xsl:value-of select="../article_ref//text_ref/@hook"/></xsl:with-param>
- </xsl:call-template>
- </b>
- </p>
- </xsl:template>
-
- <xsl:template match="headword">
- <p><b><xsl:apply-templates/></b></p>
- </xsl:template>
-
- <xsl:template match="identifier">
- (<xsl:apply-templates/>)
- </xsl:template>
-
- <xsl:template match="short_articles">
- <li>
- <xsl:choose>
- <xsl:when test="count(.//text_ref) > 1">
- SUMMARY <xsl:call-template name="multi_ref"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="text_link">
- <xsl:with-param name="articleId"><xsl:value-of select=".//text_ref/@artclid"/></xsl:with-param>
- <xsl:with-param name="tocId"><xsl:value-of select=".//text_ref/@tocid"/></xsl:with-param>
- <xsl:with-param name="body">SUMMARY</xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- </xsl:template>
-
- <xsl:template match="article_ref">a 1
- <xsl:if test="../short_articles">
- <li>
- <xsl:choose>
- <xsl:when test="count(.//text_ref) > 1">
- MAJOR TREATMENT <xsl:call-template name="multi_ref"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="text_link">
- <xsl:with-param name="articleId">
- <xsl:value-of select=".//text_ref/@artclid"/>
- </xsl:with-param>
- <xsl:with-param name="tocId">
- <xsl:value-of select=".//text_ref/@tocid"/>
- </xsl:with-param>
- <xsl:with-param name="body">
- MAJOR TREATMENT
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </li>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="stats">
- <li>
- <xsl:call-template name="text_link">
- <xsl:with-param name="articleId"><xsl:value-of select="flag/text_ref/@artclid"/></xsl:with-param>
- <xsl:with-param name="tocId"><xsl:value-of select="flag/text_ref/@tocid"/></xsl:with-param>
- <xsl:with-param name="body">STATISTICAL INFORMATION</xsl:with-param>
- </xsl:call-template>
- </li>
- </xsl:template>
-
- <xsl:template match="flag">
- <li><xsl:call-template name="ref"/></li>
- </xsl:template>
-
- <xsl:template name="ref">
-
- <xsl:choose>
- <xsl:when test="count(text_ref | assembly_ref | binary_ref | index_ref) = 0">
- <xsl:call-template name="no_ref"/>
- </xsl:when>
- <xsl:when test="count(text_ref | assembly_ref | binary_ref | index_ref) = 1">
- <xsl:apply-templates select="flag_text | umbrella_text" mode="one_ref"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="flag_text | umbrella_text"/><xsl:text disable-output-escaping='yes'> </xsl:text><xsl:call-template name="multi_ref"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="no_ref">
- <xsl:apply-templates select="flag_text | umbrella_text"/>
- </xsl:template>
-
- <!-- all refs except index ref are format "Flag (Ref 1, Ref2, ...)"
- index refs are format "Flag: See Ref 1, Ref2, ..." -->
- <xsl:template name="multi_ref">
-
- <xsl:choose>
- <xsl:when test="text_ref">
- (<xsl:apply-templates select="text_ref" mode="multi_ref"/>)
- </xsl:when>
- <xsl:when test="binary_ref">
- (<xsl:apply-templates select="binary_ref" mode="multi_ref"/>)
- </xsl:when>
- <xsl:when test="assembly_ref">
- (<xsl:apply-templates select="assembly_ref" mode="multi_ref"/>)
- </xsl:when>
-
- <xsl:when test="index_ref">: See <xsl:apply-templates select="index_ref" mode="multi_ref"/></xsl:when>
-
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text_ref" mode="multi_ref">
- <span style="font-weight: normal; font-style: italic;">in</span> <xsl:call-template name="text_link">
- <xsl:with-param name="articleId"><xsl:value-of select="@artclid"/></xsl:with-param>
- <xsl:with-param name="tocId"><xsl:value-of select="@tocid"/></xsl:with-param>
- <xsl:with-param name="hook"><xsl:value-of select="@hook"/></xsl:with-param>
- </xsl:call-template>
- <xsl:if test="position() != last()">; </xsl:if>
- </xsl:template>
-
- <xsl:template match="ref_toc_title">: <span style="font-weight: normal; font-style: normal;"><xsl:apply-templates/></span>
- </xsl:template>
-
- <xsl:template match="text_ref/ref_artcl_title"> <span style="font-weight: normal; font-style: normal;"><xsl:value-of select="."/><xsl:apply-templates select="ref_toc_title"/></span></xsl:template>
-
- <xsl:template match="binary_ref" mode="multi_ref">
- <xsl:call-template name="binary_link">
- <xsl:with-param name="id"><xsl:value-of select="@id"/></xsl:with-param>
- <xsl:with-param name="body">Image <xsl:value-of select="position()"/></xsl:with-param>
- </xsl:call-template>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:template>
-
- <xsl:template match="assembly_ref" mode="multi_ref">
- <xsl:call-template name="assembly_link">
- <xsl:with-param name="id"><xsl:value-of select="@id"/></xsl:with-param>
- <xsl:with-param name="body">Image <xsl:value-of select="position()"/></xsl:with-param>
- </xsl:call-template>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:template>
-
- <xsl:template match="index_ref" mode="multi_ref">
- <xsl:call-template name="index_link">
- <xsl:with-param name="id">
- <xsl:value-of select="@id"/>
- </xsl:with-param>
- </xsl:call-template>
- <xsl:if test="position() != last()">, </xsl:if>
- </xsl:template>
-
- <xsl:template match="umbrella">
- <xsl:choose>
- <xsl:when test="@display='horizontal'">
- <li>
- <xsl:call-template name="ref"/><xsl:text> </xsl:text>
- <xsl:apply-templates select="flag" mode="horizontal_flag"/>
- </li>
- </xsl:when>
- <xsl:otherwise>
- <li><b><i><xsl:call-template name="ref"/></i></b></li>
- <ul><xsl:apply-templates select="umbrella | flag"/></ul>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="flag" mode="horizontal_flag">
- <xsl:if test="position() > 1">, </xsl:if><xsl:call-template name="ref"/>
- </xsl:template>
-
- <xsl:template match="flag_text | umbrella_text" mode="one_ref">
- <xsl:choose>
-
- <xsl:when test="../text_ref">
- <xsl:call-template name="text_link">
- <xsl:with-param name="articleId"><xsl:value-of select="../text_ref/@artclid"/></xsl:with-param>
- <xsl:with-param name="tocid"><xsl:value-of select="../text_ref/@tocid"/></xsl:with-param>
- <xsl:with-param name="hook"><xsl:value-of select="../text_ref/@hook"/></xsl:with-param>
- <xsl:with-param name="urltitle"><xsl:value-of select="../text_ref/@urltitle"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="../assembly_ref">
- <xsl:call-template name="assembly_link">
- <xsl:with-param name="id"><xsl:value-of select="../assembly_ref/@id"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="../binary_ref">
- <xsl:call-template name="binary_link">
- <xsl:with-param name="id"><xsl:value-of select="../binary_ref/@id"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="../index_ref">
- <xsl:choose>
- <xsl:when test="ancestor::see_also">
- <xsl:call-template name="index_link">
- <xsl:with-param name="id">
- <xsl:value-of select="../index_ref/@id"/>
- </xsl:with-param>
- <xsl:with-param name="body">
- <xsl:value-of select="../index_ref"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>: See
- <xsl:call-template name="index_link">
- <xsl:with-param name="id">
- <xsl:value-of select="../index_ref/@id"/>
- </xsl:with-param>
- <xsl:with-param name="body">
- <xsl:apply-templates select="../index_ref"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
-
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match="charundef">
- <xsl:value-of select="@char"/>
- </xsl:template>
-
- <xsl:template match="charemph">
- <xsl:choose>
- <xsl:when test="@ty='i'"><i><xsl:value-of select="@char"/></i></xsl:when>
- <xsl:when test="@ty='s'"><font size="-1" class="smallText"><xsl:value-of select="@char"/></font></xsl:when>
- <xsl:when test="@ty='b'"><b><xsl:value-of select="@char"/></b></xsl:when>
- <xsl:when test="@ty='bi'"><b><i><xsl:value-of select="@char"/></i></b></xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="charfont">
- <font face="{@font}"><xsl:value-of select="@char"/></font>
- </xsl:template>
-
- </xsl:stylesheet>
-