<!-- $Id: html5-chunk-mods.xsl,v 1.1 2011-09-16 21:44:00 bobs Exp $ -->
-<!-- Fix bug: original called "generate.css" -->
-<xsl:template match="*" mode="process.root" priority="1">
- <xsl:apply-templates select="."/>
- <xsl:call-template name="generate.css.files"/>
-</xsl:template>
-
-<!-- HTML5: Modify to wrap header in HTML5 <header> element. -->
-<xsl:template name="header.navigation">
- <xsl:param name="prev" select="/foo"/>
- <xsl:param name="next" select="/foo"/>
- <xsl:param name="nav.context"/>
-
- <xsl:variable name="home" select="/*[1]"/>
- <xsl:variable name="up" select="parent::*"/>
-
- <xsl:variable name="row1" select="$navig.showtitles != 0"/>
- <xsl:variable name="row2" select="count($prev) > 0
- or (count($up) > 0
- and generate-id($up) != generate-id($home)
- and $navig.showtitles != 0)
- or count($next) > 0"/>
-
- <xsl:if test="$suppress.navigation = '0' and $suppress.header.navigation = '0'">
- <xsl:variable name="content">
- <header>
- <div class="navheader">
- <xsl:if test="$row1 or $row2">
- <table width="100%" summary="Navigation header">
- <xsl:if test="$row1">
- <tr>
- <th colspan="3" align="center">
- <xsl:apply-templates select="." mode="object.title.markup"/>
- </th>
- </tr>
- </xsl:if>
-
- <xsl:if test="$row2">
- <tr>
- <td width="20%" align="{$direction.align.start}">
- <xsl:if test="count($prev)>0">
- <a accesskey="p">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$prev"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'prev'"/>
- </xsl:call-template>
- </a>
- </xsl:if>
- <xsl:text> </xsl:text>
- </td>
- <th width="60%" align="center">
- <xsl:choose>
- <xsl:when test="count($up) > 0
- and generate-id($up) != generate-id($home)
- and $navig.showtitles != 0">
- <xsl:apply-templates select="$up" mode="object.title.markup"/>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </th>
- <td width="20%" align="{$direction.align.end}">
- <xsl:text> </xsl:text>
- <xsl:if test="count($next)>0">
- <a accesskey="n">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$next"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'next'"/>
- </xsl:call-template>
- </a>
- </xsl:if>
- </td>
- </tr>
- </xsl:if>
- </table>
- </xsl:if>
- <xsl:if test="$header.rule != 0">
- <hr/>
- </xsl:if>
- </div>
- </header>
- </xsl:variable>
-
- <!-- And fix up any style atts -->
- <xsl:call-template name="convert.styles">
- <xsl:with-param name="content" select="$content"/>
- </xsl:call-template>
-
- </xsl:if>
-</xsl:template>
-
-
-<!-- HTML5: Modify to wrap footer in HTML5 <footer> element. -->
-<xsl:template name="footer.navigation">
- <xsl:param name="prev" select="/foo"/>
- <xsl:param name="next" select="/foo"/>
- <xsl:param name="nav.context"/>
-
- <xsl:variable name="home" select="/*[1]"/>
- <xsl:variable name="up" select="parent::*"/>
-
- <xsl:variable name="row1" select="count($prev) > 0
- or count($up) > 0
- or count($next) > 0"/>
-
- <xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
- or (generate-id($home) != generate-id(.)
- or $nav.context = 'toc')
- or ($chunk.tocs.and.lots != 0
- and $nav.context != 'toc')
- or ($next and $navig.showtitles != 0)"/>
-
- <xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
- <xsl:variable name="content">
- <footer>
- <div class="navfooter">
- <xsl:if test="$footer.rule != 0">
- <hr/>
- </xsl:if>
-
- <xsl:if test="$row1 or $row2">
- <table width="100%" summary="Navigation footer">
- <xsl:if test="$row1">
- <tr>
- <td width="40%" align="{$direction.align.start}">
- <xsl:if test="count($prev)>0">
- <a accesskey="p">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$prev"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'prev'"/>
- </xsl:call-template>
- </a>
- </xsl:if>
- <xsl:text> </xsl:text>
- </td>
- <td width="20%" align="center">
- <xsl:choose>
- <xsl:when test="count($up)>0
- and generate-id($up) != generate-id($home)">
- <a accesskey="u">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$up"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'up'"/>
- </xsl:call-template>
- </a>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </td>
- <td width="40%" align="{$direction.align.end}">
- <xsl:text> </xsl:text>
- <xsl:if test="count($next)>0">
- <a accesskey="n">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$next"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'next'"/>
- </xsl:call-template>
- </a>
- </xsl:if>
- </td>
- </tr>
- </xsl:if>
-
- <xsl:if test="$row2">
- <tr>
- <td width="40%" align="{$direction.align.start}" valign="top">
- <xsl:if test="$navig.showtitles != 0">
- <xsl:apply-templates select="$prev" mode="object.title.markup"/>
- </xsl:if>
- <xsl:text> </xsl:text>
- </td>
- <td width="20%" align="center">
- <xsl:choose>
- <xsl:when test="$home != . or $nav.context = 'toc'">
- <a accesskey="h">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$home"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="navig.content">
- <xsl:with-param name="direction" select="'home'"/>
- </xsl:call-template>
- </a>
- <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
- <xsl:text> | </xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
- <a accesskey="t">
- <xsl:attribute name="href">
- <xsl:apply-templates select="/*[1]"
- mode="recursive-chunk-filename">
- <xsl:with-param name="recursive" select="true()"/>
- </xsl:apply-templates>
- <xsl:text>-toc</xsl:text>
- <xsl:value-of select="$html.ext"/>
- </xsl:attribute>
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'nav-toc'"/>
- </xsl:call-template>
- </a>
- </xsl:if>
- </td>
- <td width="40%" align="{$direction.align.end}" valign="top">
- <xsl:text> </xsl:text>
- <xsl:if test="$navig.showtitles != 0">
- <xsl:apply-templates select="$next" mode="object.title.markup"/>
- </xsl:if>
- </td>
- </tr>
- </xsl:if>
- </table>
- </xsl:if>
- </div>
- </footer>
- </xsl:variable>
-
- <!-- And fix up any style atts -->
- <xsl:call-template name="convert.styles">
- <xsl:with-param name="content" select="$content"/>
- </xsl:call-template>
- </xsl:if>
-</xsl:template>
-
-<!-- HTML5: fix styles in footnote output -->
-<xsl:template name="process.footnotes">
- <xsl:variable name="footnotes" select=".//footnote"/>
- <xsl:variable name="fcount">
- <xsl:call-template name="count.footnotes.in.this.chunk">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="footnotes" select="$footnotes"/>
- </xsl:call-template>
- </xsl:variable>
-
-<!--
- <xsl:message>
- <xsl:value-of select="name(.)"/>
- <xsl:text> fcount: </xsl:text>
- <xsl:value-of select="$fcount"/>
- </xsl:message>
--->
-
- <!-- Only bother to do this if there's at least one non-table footnote -->
- <xsl:if test="$fcount > 0">
- <div class="footnotes">
- <xsl:call-template name="footnotes.attributes"/>
- <br/>
- <hr style="width: 100; align: {$direction.align.start};"/>
- <xsl:call-template name="process.footnotes.in.this.chunk">
- <xsl:with-param name="node" select="."/>
- <xsl:with-param name="footnotes" select="$footnotes"/>
- </xsl:call-template>
- </div>
- </xsl:if>
-
- <!-- FIXME: When chunking, only the annotations actually used
- in this chunk should be referenced. I don't think it
- does any harm to reference them all, but it adds
- unnecessary bloat to each chunk. -->
- <xsl:if test="$annotation.support != 0 and //annotation">
- <div class="annotation-list">
- <div class="annotation-nocss">
- <p>The following annotations are from this essay. You are seeing
- them here because your browser doesn’t support the user-interface
- techniques used to make them appear as ‘popups’ on modern browsers.</p>
- </div>
-
- <xsl:apply-templates select="//annotation"
- mode="annotation-popup"/>
- </div>
- </xsl:if>
-</xsl:template>
-
-<!-- HTML5: link rel="home" is not permitted -->
-<xsl:template name="html.head">
- <xsl:param name="prev" select="/foo"/>
- <xsl:param name="next" select="/foo"/>
- <xsl:variable name="this" select="."/>
- <xsl:variable name="home" select="/*[1]"/>
- <xsl:variable name="up" select="parent::*"/>
-
- <head>
- <xsl:call-template name="system.head.content"/>
- <xsl:call-template name="head.content"/>
-
- <!--
- <xsl:if test="$home">
- <link rel="home">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$home"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="$home"
- mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:if>
- -->
-
- <xsl:if test="$up">
- <link rel="up">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$up"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="$up" mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:if>
-
- <xsl:if test="$prev">
- <link rel="prev">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$prev"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:if>
-
- <xsl:if test="$next">
- <link rel="next">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="object" select="$next"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:if>
-
- <xsl:if test="$html.extra.head.links != 0">
- <xsl:for-each select="//part
- |//reference
- |//preface
- |//chapter
- |//article
- |//refentry
- |//appendix[not(parent::article)]|appendix
- |//glossary[not(parent::article)]|glossary
- |//index[not(parent::article)]|index">
- <link rel="{local-name(.)}">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="context" select="$this"/>
- <xsl:with-param name="object" select="."/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:for-each>
-
- <xsl:for-each select="section|sect1|refsection|refsect1">
- <link>
- <xsl:attribute name="rel">
- <xsl:choose>
- <xsl:when test="local-name($this) = 'section'
- or local-name($this) = 'refsection'">
- <xsl:value-of select="'subsection'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'section'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="context" select="$this"/>
- <xsl:with-param name="object" select="."/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:for-each>
-
- <xsl:for-each select="sect2|sect3|sect4|sect5|refsect2|refsect3">
- <link rel="subsection">
- <xsl:attribute name="href">
- <xsl:call-template name="href.target">
- <xsl:with-param name="context" select="$this"/>
- <xsl:with-param name="object" select="."/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
- </xsl:attribute>
- </link>
- </xsl:for-each>
- </xsl:if>
-
- <!-- * if we have a legalnotice and user wants it output as a -->
- <!-- * separate page and $html.head.legalnotice.link.types is -->
- <!-- * non-empty, we generate a link or links for each value in -->
- <!-- * $html.head.legalnotice.link.types -->
- <xsl:if test="//legalnotice
- and not($generate.legalnotice.link = 0)
- and not($html.head.legalnotice.link.types = '')">
- <xsl:call-template name="make.legalnotice.head.links"/>
- </xsl:if>
-
- <xsl:call-template name="user.head.content"/>
- </head>
-</xsl:template>
-
-<!-- Add call to new root.attributes template for <html> attribute -->
+<!-- call HTML5 header and footer templates for navigation -->
<xsl:template name="chunk-element-content">
<xsl:param name="prev"/>
<xsl:param name="next"/>
<body>
<xsl:call-template name="body.attributes"/>
- <xsl:call-template name="user.header.navigation"/>
- <xsl:call-template name="header.navigation">
+ <xsl:call-template name="html5.header.navigation">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
<xsl:with-param name="nav.context" select="$nav.context"/>
<xsl:call-template name="user.footer.content"/>
- <xsl:call-template name="footer.navigation">
+ <xsl:call-template name="html5.footer.navigation">
<xsl:with-param name="prev" select="$prev"/>
<xsl:with-param name="next" select="$next"/>
<xsl:with-param name="nav.context" select="$nav.context"/>
</xsl:call-template>
- <xsl:call-template name="user.footer.navigation"/>
</body>
</html>
<xsl:value-of select="$chunk.append"/>
</xsl:template>
+<!-- Add HTML5 <header> wrapper, and convert some attributes to styles -->
+<xsl:template name="html5.header.navigation">
+ <xsl:param name="prev" select="/foo"/>
+ <xsl:param name="next" select="/foo"/>
+ <xsl:param name="nav.context"/>
+
+ <xsl:variable name="content">
+ <header>
+ <xsl:call-template name="user.header.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="header.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+ </header>
+ </xsl:variable>
+
+ <!-- And fix up any style atts -->
+ <xsl:call-template name="convert.styles">
+ <xsl:with-param name="content" select="$content"/>
+ </xsl:call-template>
+</xsl:template>
+
+<!-- Add HTML5 <footer> wrapper, and convert some attributes to styles -->
+<xsl:template name="html5.footer.navigation">
+ <xsl:param name="prev" select="/foo"/>
+ <xsl:param name="next" select="/foo"/>
+ <xsl:param name="nav.context"/>
+
+ <xsl:variable name="content">
+ <footer>
+ <xsl:call-template name="user.footer.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+
+ <xsl:call-template name="footer.navigation">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ <xsl:with-param name="nav.context" select="$nav.context"/>
+ </xsl:call-template>
+ </footer>
+ </xsl:variable>
+
+ <!-- And fix up any style atts -->
+ <xsl:call-template name="convert.styles">
+ <xsl:with-param name="content" select="$content"/>
+ </xsl:call-template>
+</xsl:template>
</xsl:stylesheet>
<xsl:param name="css.decoration" select="1"/>
<xsl:param name="make.clean.html" select="1"/>
<xsl:param name="generate.id.attributes" select="1"/>
+<xsl:variable name="div.element">section</xsl:variable>
<!--==============================================================-->
<!-- Customized templates -->
<!--==============================================================-->
+<!-- HTML5: needs special doctype -->
+<xsl:template name="user.preroot">
+ <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
+</xsl:template>
+
<!-- HTML5: Replace HTML acronum with abbr for HTML 5 -->
<xsl:template match="acronym">
<xsl:call-template name="inline.charseq">
<xsl:value-of select="concat($style.from.atts, @style)"/>
</xsl:variable>
- <!-- HTML5: <th> does not support block elements, use <td> -->
+ <!-- HTML5: reserved for element name conversion if needed -->
<xsl:variable name="element.name">
- <xsl:choose>
- <xsl:when test="local-name(.) = 'th'">td</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="local-name(.)"/>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="local-name(.)"/>
</xsl:variable>
<xsl:element name="{$element.name}">
<xsl:call-template name="convert.styles"/>
</xsl:template>
-<xsl:template name="convert.styles">
- <xsl:param name="content">
- <xsl:apply-imports/>
- </xsl:param>
- <xsl:variable name="nodes" select="exsl:node-set($content)"/>
-
- <xsl:apply-templates mode="convert.to.style" select="$nodes"/>
-</xsl:template>
-
-<!-- Remove table summary and set border="" -->
-
-<xsl:template match="segmentedlist" mode="seglist-table">
- <xsl:variable name="table-summary">
- <xsl:call-template name="pi.dbhtml_table-summary"/>
- </xsl:variable>
-
- <xsl:variable name="list-width">
- <xsl:call-template name="pi.dbhtml_list-width"/>
- </xsl:variable>
-
- <xsl:apply-templates select="title"/>
-
- <table border="">
- <xsl:if test="$list-width != ''">
- <xsl:attribute name="width">
- <xsl:value-of select="$list-width"/>
- </xsl:attribute>
- </xsl:if>
- <!--
- <xsl:if test="$table-summary != ''">
- <xsl:attribute name="summary">
- <xsl:value-of select="$table-summary"/>
- </xsl:attribute>
- </xsl:if>
- -->
- <thead>
- <tr class="segtitle">
- <xsl:call-template name="tr.attributes">
- <xsl:with-param name="row" select="segtitle[1]"/>
- <xsl:with-param name="rownum" select="1"/>
- </xsl:call-template>
- <xsl:apply-templates select="segtitle" mode="seglist-table"/>
- </tr>
- </thead>
- <tbody>
- <xsl:apply-templates select="seglistitem" mode="seglist-table"/>
- </tbody>
- </table>
-</xsl:template>
-
-<xsl:template name="graphical.admonition">
- <xsl:variable name="admon.type">
- <xsl:choose>
- <xsl:when test="local-name(.)='note'">Note</xsl:when>
- <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
- <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
- <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
- <xsl:when test="local-name(.)='important'">Important</xsl:when>
- <xsl:otherwise>Note</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="alt">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="$admon.type"/>
- </xsl:call-template>
- </xsl:variable>
-
- <div>
- <xsl:call-template name="common.html.attributes"/>
- <xsl:if test="$admon.style != ''">
- <xsl:attribute name="style">
- <xsl:value-of select="$admon.style"/>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:variable name="content">
- <table border="">
- <tr>
- <td rowspan="2" align="center" valign="top">
- <xsl:attribute name="width">
- <xsl:apply-templates select="." mode="admon.graphic.width"/>
- </xsl:attribute>
- <img alt="[{$alt}]">
- <xsl:attribute name="src">
- <xsl:call-template name="admon.graphic"/>
- </xsl:attribute>
- </img>
- </td>
- <th align="{$direction.align.start}">
- <xsl:call-template name="anchor"/>
- <xsl:if test="$admon.textlabel != 0 or title or info/title">
- <xsl:apply-templates select="." mode="object.title.markup"/>
- </xsl:if>
- </th>
- </tr>
- <tr>
- <td align="{$direction.align.start}" valign="top">
- <xsl:apply-templates/>
- </td>
- </tr>
- </table>
- </xsl:variable>
-
- <xsl:variable name="table.nodes" select="exsl:node-set($content)"/>
-
- <xsl:apply-templates select="$table.nodes" mode="convert.to.style"/>
- </div>
-</xsl:template>
-
-<!-- HTML5: needs special doctype -->
-<xsl:template name="user.preroot">
- <xsl:text disable-output-escaping="yes"><!DOCTYPE html></xsl:text>
-</xsl:template>
-
-<!-- HTML5: @type not permitted on lists -->
-<xsl:template match="itemizedlist">
- <!-- Handle spacing="compact" as multiple class attribute instead
- of the deprecated HTML compact attribute -->
- <xsl:variable name="default.class">
- <xsl:value-of select="local-name()"/>
- <xsl:if test="@spacing = 'compact'">
- <xsl:text> compact</xsl:text>
- </xsl:if>
- </xsl:variable>
-
- <div>
- <xsl:call-template name="common.html.attributes"/>
- <xsl:call-template name="id.attribute"/>
- <xsl:call-template name="anchor"/>
- <xsl:if test="title">
- <xsl:call-template name="formal.object.heading"/>
- </xsl:if>
-
- <xsl:variable name="style.value">
- <xsl:variable name="type">
- <xsl:call-template name="list.itemsymbol"/>
- </xsl:variable>
-
- <xsl:text>list-style-type: </xsl:text>
- <xsl:value-of select="$type"/>
- <xsl:text>; </xsl:text>
-
- </xsl:variable>
-
- <!-- Preserve order of PIs and comments -->
- <xsl:apply-templates
- select="*[not(self::listitem
- or self::title
- or self::titleabbrev)]
- |comment()[not(preceding-sibling::listitem)]
- |processing-instruction()[not(preceding-sibling::listitem)]"/>
-
- <ul>
- <xsl:call-template name="generate.class.attribute">
- <xsl:with-param name="class" select="$default.class"/>
- </xsl:call-template>
-
- <xsl:apply-templates
- select="listitem
- |comment()[preceding-sibling::listitem]
- |processing-instruction()[preceding-sibling::listitem]"/>
- </ul>
- </div>
-</xsl:template>
-
-<xsl:template name="process.footnotes">
- <xsl:variable name="footnotes" select=".//footnote"/>
- <xsl:variable name="table.footnotes"
- select=".//table//footnote | .//informaltable//footnote"/>
-
- <!-- Only bother to do this if there's at least one non-table footnote -->
- <xsl:if test="count($footnotes)>count($table.footnotes)">
- <div class="footnotes">
- <xsl:call-template name="footnotes.attributes"/>
- <br/>
- <hr style="width: 100; text-align: {$direction.align.start};"/>
- <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/>
- </div>
- </xsl:if>
-
- <xsl:if test="$annotation.support != 0 and //annotation">
- <div class="annotation-list">
- <div class="annotation-nocss">
- <p>The following annotations are from this essay. You are seeing
- them here because your browser doesn’t support the user-interface
- techniques used to make them appear as ‘popups’ on modern browsers.</p>
- </div>
-
- <xsl:apply-templates select="//annotation"
- mode="annotation-popup"/>
- </div>
- </xsl:if>
-</xsl:template>
-
-<xsl:template name="footnotes.attributes">
+<xsl:template match="note|important|warning|caution|tip">
+ <xsl:call-template name="convert.styles"/>
</xsl:template>
-<!-- HTML5: ouput section element for chapter -->
-<xsl:template match="chapter">
- <xsl:call-template name="id.warning"/>
-
- <section>
- <xsl:call-template name="common.html.attributes">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:call-template name="id.attribute">
- <xsl:with-param name="conditional" select="0"/>
- </xsl:call-template>
-
- <xsl:call-template name="component.separator"/>
- <xsl:call-template name="chapter.titlepage"/>
-
- <xsl:variable name="toc.params">
- <xsl:call-template name="find.path.params">
- <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="contains($toc.params, 'toc')">
- <xsl:call-template name="component.toc">
- <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
- </xsl:call-template>
- <xsl:call-template name="component.toc.separator"/>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:call-template name="process.footnotes"/>
- </section>
+<xsl:template match="funcprototype" mode="ansi-tabular">
+ <xsl:call-template name="convert.styles"/>
</xsl:template>
-<!-- HTML5: ouput section element for appendix -->
-<xsl:template match="appendix">
-
- <xsl:variable name="ischunk">
- <xsl:call-template name="chunk"/>
- </xsl:variable>
-
- <xsl:call-template name="id.warning"/>
-
- <section>
- <xsl:call-template name="common.html.attributes">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:if test="$generate.id.attributes != 0">
- <xsl:attribute name="id">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="parent::article and $ischunk = 0">
- <xsl:call-template name="section.heading">
- <xsl:with-param name="level" select="1"/>
- <xsl:with-param name="title">
- <xsl:apply-templates select="." mode="object.title.markup"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="component.separator"/>
- <xsl:call-template name="appendix.titlepage"/>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:variable name="toc.params">
- <xsl:call-template name="find.path.params">
- <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:if test="contains($toc.params, 'toc')">
- <xsl:call-template name="component.toc">
- <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
- </xsl:call-template>
- <xsl:call-template name="component.toc.separator"/>
- </xsl:if>
-
- <xsl:apply-templates/>
-
- <xsl:if test="not(parent::article) or $ischunk != 0">
- <xsl:call-template name="process.footnotes"/>
- </xsl:if>
- </section>
+<xsl:template match="funcprototype" mode="kr-tabular">
+ <xsl:call-template name="convert.styles"/>
</xsl:template>
-<!-- HTML5: ouput section element for section -->
-<xsl:template match="section">
- <xsl:variable name="depth" select="count(ancestor::section)+1"/>
-
- <xsl:call-template name="id.warning"/>
-
- <section>
- <xsl:call-template name="common.html.attributes">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:call-template name="id.attribute">
- <xsl:with-param name="conditional" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="section.titlepage"/>
-
- <xsl:variable name="toc.params">
- <xsl:call-template name="find.path.params">
- <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
- </xsl:call-template>
- </xsl:variable>
+<xsl:template name="convert.styles">
+ <xsl:param name="content">
+ <xsl:apply-imports/>
+ </xsl:param>
+ <xsl:variable name="nodes" select="exsl:node-set($content)"/>
- <xsl:if test="contains($toc.params, 'toc') and $depth <= $generate.section.toc.level">
- <xsl:call-template name="section.toc">
- <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
- </xsl:call-template>
- <xsl:call-template name="section.toc.separator"/>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:call-template name="process.chunk.footnotes"/>
- </section>
+ <xsl:apply-templates mode="convert.to.style" select="$nodes"/>
</xsl:template>
<!-- HTML5: link rel="home" is not permitted -->
<xsl:template name="root.attributes">
</xsl:template>
-<!-- HTML5: Put glossary in <section> element -->
-<xsl:template match="glossary">
-
- <xsl:variable name="language">
- <xsl:call-template name="l10n.language"/>
- </xsl:variable>
-
- <xsl:variable name="lowercase">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key">normalize.sort.input</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="uppercase">
- <xsl:call-template name="gentext">
- <xsl:with-param name="key">normalize.sort.output</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:call-template name="id.warning"/>
-
- <section>
- <xsl:apply-templates select="." mode="common.html.attributes"/>
- <xsl:if test="$generate.id.attributes != 0">
- <xsl:attribute name="id">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:call-template name="glossary.titlepage"/>
-
- <xsl:choose>
- <xsl:when test="glossdiv">
- <xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/>
- </xsl:when>
- <xsl:when test="glossentry">
- <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:choose>
- <xsl:when test="glossdiv">
- <xsl:apply-templates select="glossdiv"/>
- </xsl:when>
- <xsl:when test="glossentry">
- <dl>
- <xsl:choose>
- <xsl:when test="$glossary.sort != 0">
- <xsl:apply-templates select="glossentry">
- <xsl:sort lang="{$language}" select="normalize-space(translate(concat(@sortas, glossterm[not(parent::glossentry/@sortas) or parent::glossentry/@sortas = '']), 'AaÀàÁáÂâÃãÄäÅåĀāĂ㥹ǍǎǞǟǠǡǺǻȀȁȂȃȦȧḀḁẚẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặBbƀƁɓƂƃḂḃḄḅḆḇCcÇçĆćĈĉĊċČčƇƈɕḈḉDdĎďĐđƊɗƋƌDžDzȡɖḊḋḌḍḎḏḐḑḒḓEeÈèÉéÊêËëĒēĔĕĖėĘęĚěȄȅȆȇȨȩḔḕḖḗḘḙḚḛḜḝẸẹẺẻẼẽẾếỀềỂểỄễỆệFfƑƒḞḟGgĜĝĞğĠġĢģƓɠǤǥǦǧǴǵḠḡHhĤĥĦħȞȟɦḢḣḤḥḦḧḨḩḪḫẖIiÌìÍíÎîÏïĨĩĪīĬĭĮįİƗɨǏǐȈȉȊȋḬḭḮḯỈỉỊịJjĴĵǰʝKkĶķƘƙǨǩḰḱḲḳḴḵLlĹĺĻļĽľĿŀŁłƚLjȴɫɬɭḶḷḸḹḺḻḼḽMmɱḾḿṀṁṂṃNnÑñŃńŅņŇňƝɲƞȠNjǸǹȵɳṄṅṆṇṈṉṊṋOoÒòÓóÔôÕõÖöØøŌōŎŏŐőƟƠơǑǒǪǫǬǭǾǿȌȍȎȏȪȫȬȭȮȯȰȱṌṍṎṏṐṑṒṓỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợPpƤƥṔṕṖṗQqʠRrŔŕŖŗŘřȐȑȒȓɼɽɾṘṙṚṛṜṝṞṟSsŚśŜŝŞşŠšȘșʂṠṡṢṣṤṥṦṧṨṩTtŢţŤťŦŧƫƬƭƮʈȚțȶṪṫṬṭṮṯṰṱẗUuÙùÚúÛûÜüŨũŪūŬŭŮůŰűŲųƯưǓǔǕǖǗǘǙǚǛǜȔȕȖȗṲṳṴṵṶṷṸṹṺṻỤụỦủỨứỪừỬửỮữỰựVvƲʋṼṽṾṿWwŴŵẀẁẂẃẄẅẆẇẈẉẘXxẊẋẌẍYyÝýÿŸŶŷƳƴȲȳẎẏẙỲỳỴỵỶỷỸỹZzŹźŻżŽžƵƶȤȥʐʑẐẑẒẓẔẕẕ', 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEFFFFFFGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPQQQRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVWWWWWWWWWWWWWWWXXXXXXYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZ'))"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="glossentry"/>
- </xsl:otherwise>
- </xsl:choose>
- </dl>
- </xsl:when>
- <xsl:otherwise>
- <!-- empty glossary -->
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="not(parent::article)">
- <xsl:call-template name="process.footnotes"/>
- </xsl:if>
- </section>
-</xsl:template>
-
-<!-- HTML5: Put glossary in <section> element -->
-<xsl:template match="preface">
- <xsl:call-template name="id.warning"/>
-
- <section>
- <xsl:call-template name="common.html.attributes">
- <xsl:with-param name="inherit" select="1"/>
- </xsl:call-template>
- <xsl:if test="$generate.id.attributes != 0">
- <xsl:attribute name="id">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:call-template name="component.separator"/>
- <xsl:call-template name="preface.titlepage"/>
-
- <xsl:variable name="toc.params">
- <xsl:call-template name="find.path.params">
- <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:if test="contains($toc.params, 'toc')">
- <xsl:call-template name="component.toc">
- <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
- </xsl:call-template>
- <xsl:call-template name="component.toc.separator"/>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:call-template name="process.footnotes"/>
- </section>
-</xsl:template>
-
<!-- HTML5: uses <ul> instead of <dl> for TOC -->
<xsl:template match="question" mode="qandatoc.mode">
<xsl:variable name="firstch">
</li>
</xsl:template>
-<!-- HTML5: each dt must have a dd -->
-<xsl:template match="indexterm" mode="index-primary">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key" select="&primary;"/>
- <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
- <dt>
- <xsl:for-each select="$refs/primary">
- <xsl:if test="@id or @xml:id">
- <a name="{(@id|@xml:id)[1]}"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:value-of select="primary"/>
- <xsl:choose>
- <xsl:when test="$index.links.to.section = 1">
- <xsl:for-each select="$refs[generate-id() = generate-id(key('primary-section', concat($key, &sep;, §ion.id;))[&scope;][1])]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$refs[not(see)
- and not(secondary)][&scope;]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$refs[not(secondary)]/*[self::see]">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </dt>
- <dd>
- <xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
- <dl>
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
- mode="index-seealso">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
- mode="index-secondary">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </dl>
- </xsl:if>
- </dd>
-</xsl:template>
-
-<xsl:template match="indexterm" mode="index-secondary">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
- <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
- <dt>
- <xsl:for-each select="$refs/secondary">
- <xsl:if test="@id or @xml:id">
- <a name="{(@id|@xml:id)[1]}"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:value-of select="secondary"/>
- <xsl:choose>
- <xsl:when test="$index.links.to.section = 1">
- <xsl:for-each select="$refs[generate-id() = generate-id(key('secondary-section', concat($key, &sep;, §ion.id;))[&scope;][1])]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$refs[not(see)
- and not(tertiary)][&scope;]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$refs[not(tertiary)]/*[self::see]">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </dt>
- <dd>
- <xsl:if test="$refs/tertiary or $refs[not(tertiary)]/*[self::seealso]">
- <dl>
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &sep;, seealso))[&scope;][1])]"
- mode="index-seealso">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="$refs[tertiary and count(.|key('tertiary', concat($key, &sep;, &tertiary;))[&scope;][1]) = 1]"
- mode="index-tertiary">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(&tertiary;, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </dl>
- </xsl:if>
- </dd>
-</xsl:template>
-
-<xsl:template match="indexterm" mode="index-tertiary">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;)"/>
- <xsl:variable name="refs" select="key('tertiary', $key)[&scope;]"/>
- <dt>
- <xsl:for-each select="$refs/tertiary">
- <xsl:if test="@id or @xml:id">
- <a name="{(@id|@xml:id)[1]}"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:value-of select="tertiary"/>
- <xsl:choose>
- <xsl:when test="$index.links.to.section = 1">
- <xsl:for-each select="$refs[generate-id() = generate-id(key('tertiary-section', concat($key, &sep;, §ion.id;))[&scope;][1])]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$refs[not(see)][&scope;]">
- <xsl:apply-templates select="." mode="reference">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$refs/see">
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, see))[&scope;][1])]"
- mode="index-see">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </xsl:if>
- </dt>
- <dd>
- <xsl:if test="$refs/seealso">
- <dl>
- <xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &secondary;, &sep;, &tertiary;, &sep;, seealso))[&scope;][1])]"
- mode="index-seealso">
- <xsl:with-param name="position" select="position()"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="role" select="$role"/>
- <xsl:with-param name="type" select="$type"/>
- <xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
- </xsl:apply-templates>
- </dl>
- </xsl:if>
- </dd>
-</xsl:template>
-
-<xsl:template match="indexterm" mode="index-seealso">
- <xsl:param name="scope" select="."/>
- <xsl:param name="role" select="''"/>
- <xsl:param name="type" select="''"/>
-
- <xsl:for-each select="seealso">
- <xsl:sort select="translate(., &lowercase;, &uppercase;)"/>
- <dt>
- <xsl:text>(</xsl:text>
- <xsl:call-template name="gentext">
- <xsl:with-param name="key" select="'seealso'"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>)</xsl:text>
- </dt>
- <dd/>
- </xsl:for-each>
-</xsl:template>
-
<xsl:template match="audiodata">
<xsl:variable name="filename">
<xsl:call-template name="mediaobject.filename">
</div>
</xsl:template>
-<!-- HTML5: select videoobject and audioobject before textobject -->
-<xsl:template name="select.mediaobject.index">
- <xsl:param name="olist"
- select="imageobject|imageobjectco
- |videoobject|audioobject|textobject"/>
- <xsl:param name="count">1</xsl:param>
-
- <xsl:choose>
- <!-- Test for objects preferred by role -->
- <xsl:when test="$use.role.for.mediaobject != 0
- and $preferred.mediaobject.role != ''
- and $olist[@role = $preferred.mediaobject.role]">
-
- <!-- Get the first hit's position index -->
- <xsl:for-each select="$olist">
- <xsl:if test="@role = $preferred.mediaobject.role and
- not(preceding-sibling::*[@role = $preferred.mediaobject.role])">
- <xsl:value-of select="position()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
-
- <xsl:when test="$use.role.for.mediaobject != 0
- and $olist[@role = $stylesheet.result.type]">
- <!-- Get the first hit's position index -->
- <xsl:for-each select="$olist">
- <xsl:if test="@role = $stylesheet.result.type and
- not(preceding-sibling::*[@role = $stylesheet.result.type])">
- <xsl:value-of select="position()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <!-- Accept 'html' for $stylesheet.result.type = 'xhtml' -->
- <xsl:when test="$use.role.for.mediaobject != 0
- and $stylesheet.result.type = 'xhtml'
- and $olist[@role = 'html']">
- <!-- Get the first hit's position index -->
- <xsl:for-each select="$olist">
- <xsl:if test="@role = 'html' and
- not(preceding-sibling::*[@role = 'html'])">
- <xsl:value-of select="position()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
-
- <!-- If no selection by role, and there is only one object, use it -->
- <xsl:when test="count($olist) = 1 and $count = 1">
- <xsl:value-of select="$count"/>
- </xsl:when>
-
- <xsl:otherwise>
- <!-- Otherwise select first acceptable object -->
- <xsl:if test="$count <= count($olist)">
- <xsl:variable name="object" select="$olist[position()=$count]"/>
-
- <xsl:variable name="useobject">
- <xsl:choose>
- <!-- select videoobject or audioobject before textobject -->
- <xsl:when test="local-name($object) = 'videoobject'">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($object) = 'audioobject'">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <!-- skip textobject if also video, audio, or image out of order -->
- <xsl:when test="local-name($object) = 'textobject' and
- ../imageobject or
- ../audioobject or
- ../videoobject">
- <xsl:text>0</xsl:text>
- </xsl:when>
- <!-- The phrase is used only when contains TeX Math and output is FO -->
- <xsl:when test="local-name($object)='textobject' and $object/phrase
- and $object/@role='tex' and $stylesheet.result.type = 'fo'
- and $tex.math.in.alt != ''">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <!-- The phrase is never used -->
- <xsl:when test="local-name($object)='textobject' and $object/phrase">
- <xsl:text>0</xsl:text>
- </xsl:when>
- <xsl:when test="local-name($object)='textobject'
- and $object/ancestor::equation ">
- <!-- The first textobject is not a reasonable fallback
- for equation image -->
- <xsl:text>0</xsl:text>
- </xsl:when>
- <!-- The first textobject is a reasonable fallback -->
- <xsl:when test="local-name($object)='textobject'
- and $object[not(@role) or @role!='tex']">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <!-- don't use graphic when output is FO, TeX Math is used
- and there is math in alt element -->
- <xsl:when test="$object/ancestor::equation and
- $object/ancestor::equation/alt[@role='tex']
- and $stylesheet.result.type = 'fo'
- and $tex.math.in.alt != ''">
- <xsl:text>0</xsl:text>
- </xsl:when>
- <!-- If there's only one object, use it -->
- <xsl:when test="$count = 1 and count($olist) = 1">
- <xsl:text>1</xsl:text>
- </xsl:when>
- <!-- Otherwise, see if this one is a useable graphic -->
- <xsl:otherwise>
- <xsl:choose>
- <!-- peek inside imageobjectco to simplify the test -->
- <xsl:when test="local-name($object) = 'imageobjectco'">
- <xsl:call-template name="is.acceptable.mediaobject">
- <xsl:with-param name="object" select="$object/imageobject"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="is.acceptable.mediaobject">
- <xsl:with-param name="object" select="$object"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="$useobject='1'">
- <xsl:value-of select="$count"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="select.mediaobject.index">
- <xsl:with-param name="olist" select="$olist"/>
- <xsl:with-param name="count" select="$count + 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
<!-- HTML5: no body attributes -->
<xsl:template name="body.attributes"/>