From: <bob...@us...> - 2011-09-22 10:32:13
|
Revision: 9081 http://docbook.svn.sourceforge.net/docbook/?rev=9081&view=rev Author: bobstayton Date: 2011-09-22 10:32:04 +0000 (Thu, 22 Sep 2011) Log Message: ----------- Check in beta2 epub3 development files. Added Paths: ----------- trunk/xsl/xhtml5/ trunk/xsl/xhtml5/chunk.xsl trunk/xsl/xhtml5/chunkfast.xsl trunk/xsl/xhtml5/docbook.css.xml trunk/xsl/xhtml5/docbook.xsl trunk/xsl/xhtml5/html5-chunk-mods.xsl trunk/xsl/xhtml5/html5-element-mods.xsl trunk/xsl/xhtml5/onechunk.xsl trunk/xsl/xhtml5/profile-chunk.xsl trunk/xsl/xhtml5/profile-docbook.xsl trunk/xsl/xhtml5/xhtml-docbook.xsl trunk/xsl/xhtml5/xhtml-profile-docbook.xsl Added: trunk/xsl/xhtml5/chunk.xsl =================================================================== --- trunk/xsl/xhtml5/chunk.xsl (rev 0) +++ trunk/xsl/xhtml5/chunk.xsl 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="exsl" + version="1.0"> + +<!-- $Id: chunk.xsl,v 1.1 2011-09-16 21:43:59 bobs Exp $ --> + +<!-- This is the main driver stylesheet file. It imports or +includes all the components that it needs. --> + +<!-- Import the module that customizes docbook elements --> +<!-- Put any customizations of element content in this module. --> +<xsl:import href="docbook.xsl"/> + +<xsl:import href="../xhtml/chunk-common.xsl"/> + +<xsl:include href="../xhtml/chunk-code.xsl"/> + +<!-- The following module has templates that override the stock + xhtml templates for HTML5 output. + It contains match templates with priority="1" attributes, + and named templates. These override any templates that + handle chunking behavior --> +<xsl:include href="html5-chunk-mods.xsl"/> + +</xsl:stylesheet> Added: trunk/xsl/xhtml5/chunkfast.xsl =================================================================== --- trunk/xsl/xhtml5/chunkfast.xsl (rev 0) +++ trunk/xsl/xhtml5/chunkfast.xsl 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="ASCII"?> +<!--This file was created automatically by html2xhtml--> +<!--from the HTML stylesheets.--> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="cf exsl"> + +<!-- ******************************************************************** + $Id: chunkfast.xsl,v 1.1 2011-09-16 21:44:00 bobs Exp $ + ******************************************************************** + + This file is part of the XSL DocBook Stylesheet distribution. + See ../README or http://docbook.sf.net/release/xsl/current/ for + copyright and other information. + + ******************************************************************** --> + +<!-- ==================================================================== --> + +<xsl:import href="chunk.xsl"/> +<xsl:param name="chunk.fast" select="1"/> + +<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/> + +<!-- ==================================================================== --> + +<xsl:template name="process-chunk-element"> + <xsl:choose> + <xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0"> + <xsl:variable name="genid" select="generate-id()"/> + + <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/> + + <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/> + <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/> + + <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/> + <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/> + + <xsl:choose> + <xsl:when test="$onechunk != 0 and parent::*"> + <xsl:apply-imports/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="process-chunk"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$onechunk != 0 and not(parent::*)"> + <xsl:call-template name="chunk-all-sections"/> + </xsl:when> + <xsl:when test="$onechunk != 0"> + <xsl:apply-imports/> + </xsl:when> + <xsl:when test="$chunk.first.sections = 0"> + <xsl:call-template name="chunk-first-section-with-parent"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="chunk-all-sections"/> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> Added: trunk/xsl/xhtml5/docbook.css.xml =================================================================== --- trunk/xsl/xhtml5/docbook.css.xml (rev 0) +++ trunk/xsl/xhtml5/docbook.css.xml 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,104 @@ +<?xml version="1.0"?> +<style> + +/********************************/ +/* start of styles in block.xsl */ + +.formalpara-title { + font-weight: bold; +} + +div.blockquote-title { + font-weight: bold; + margin-top: 1em; + margin-bottom: 1em; +} + +span.msgmain-title { + font-weight: bold; +} + +span.msgsub-title { + font-weight: bold; +} + +span.msgrel-title { + font-weight: bold; +} + +div.msglevel, div.msgorig, div.msgaud { + margin-top: 1em; + margin-bottom: 1em; +} + +span.msglevel-title, span.msgorig-title, span.msgaud-title { + font-weight: bold; +} + +div.msgexplan { + margin-top: 1em; + margin-bottom: 1em; +} + +span.msgexplan-title { + font-weight: bold; +} + +/* end of styles in block.xsl */ +/********************************/ + +/********************************/ +/* start of styles in autotoc.xsl */ + + +/* end of styles in autotoc.xsl */ +/********************************/ + +/********************************/ +/* start of styles in formal.xsl */ + +div.figure-title { + font-weight: bold; +} + +div.example-title { + font-weight: bold; +} + +div.equation-title { + font-weight: bold; +} + +div.table-title { + font-weight: bold; +} + +div.sidebar-title { + font-weight: bold; +} + + +/* end of styles in formal.xsl */ +/********************************/ + +/********************************/ +/* start of styles in verbatim.xsl */ + +div.programlisting { + white-space: pre; + font-family: monospace; +} + +div.screen { + white-space: pre; + font-family: monospace; +} + +div.synopsis { + white-space: pre; + font-family: monospace; +} + +/* end of styles in verbatim.xsl */ +/********************************/ +</style> Added: trunk/xsl/xhtml5/docbook.xsl =================================================================== --- trunk/xsl/xhtml5/docbook.xsl (rev 0) +++ trunk/xsl/xhtml5/docbook.xsl 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE xsl:stylesheet [ +]> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table" + xmlns:xtbl="xalan://com.nwalsh.xalan.Table" + xmlns:lxslt="http://xml.apache.org/xslt" + xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table" + exclude-result-prefixes="exsl stbl xtbl lxslt ptbl" + version="1.0"> + +<!-- $Id: docbook.xsl,v 1.2 2011-09-18 17:47:28 bobs Exp $ --> +<xsl:import href="xhtml-docbook.xsl"/> +<xsl:include href="html5-element-mods.xsl"/> + +<xsl:output method="xml" encoding="UTF-8" /> + +</xsl:stylesheet> Added: trunk/xsl/xhtml5/html5-chunk-mods.xsl =================================================================== --- trunk/xsl/xhtml5/html5-chunk-mods.xsl (rev 0) +++ trunk/xsl/xhtml5/html5-chunk-mods.xsl 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,497 @@ +<?xml version="1.0" encoding="utf-8"?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns="http://www.w3.org/1999/xhtml" + exclude-result-prefixes="exsl" + version="1.0"> + +<!-- $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 --> +<xsl:template name="chunk-element-content"> + <xsl:param name="prev"/> + <xsl:param name="next"/> + <xsl:param name="nav.context"/> + <xsl:param name="content"> + <xsl:apply-imports/> + </xsl:param> + + <xsl:call-template name="user.preroot"/> + + <html> + <xsl:call-template name="root.attributes"/> + <xsl:call-template name="html.head"> + <xsl:with-param name="prev" select="$prev"/> + <xsl:with-param name="next" select="$next"/> + </xsl:call-template> + + <body> + <xsl:call-template name="body.attributes"/> + <xsl:call-template name="user.header.navigation"/> + + <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> + + <xsl:call-template name="user.header.content"/> + + <xsl:copy-of select="$content"/> + + <xsl:call-template name="user.footer.content"/> + + <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> + + <xsl:call-template name="user.footer.navigation"/> + </body> + </html> + <xsl:value-of select="$chunk.append"/> +</xsl:template> + + +</xsl:stylesheet> Added: trunk/xsl/xhtml5/html5-element-mods.xsl =================================================================== --- trunk/xsl/xhtml5/html5-element-mods.xsl (rev 0) +++ trunk/xsl/xhtml5/html5-element-mods.xsl 2011-09-22 10:32:04 UTC (rev 9081) @@ -0,0 +1,1067 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE xsl:stylesheet [ +<!ENTITY % common.entities SYSTEM "../common/entities.ent"> +%common.entities; +]> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" + xmlns="http://www.w3.org/1999/xhtml" + xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table" + xmlns:xtbl="xalan://com.nwalsh.xalan.Table" + xmlns:lxslt="http://xml.apache.org/xslt" + xmlns:ptbl="http://nwalsh.com/xslt/ext/xsltproc/python/Table" + exclude-result-prefixes="exsl stbl xtbl lxslt ptbl" + version="1.0"> + +<!-- $Id: html5-element-mods.xsl,v 1.2 2011-09-18 17:47:28 bobs Exp $ --> + +<!--==============================================================--> +<!-- DocBook XSL Parameter settings --> +<!--==============================================================--> +<!-- Set these to blank so can output special HTML5 empty DOCTYPE --> +<xsl:param name="chunker.output.doctype-system" select="''"/> +<xsl:param name="chunker.output.doctype-public" select="''"/> + +<xsl:param name="table.borders.with.css" select="1"/> +<xsl:param name="html.ext">.xhtml</xsl:param> +<xsl:param name="toc.list.type">ul</xsl:param> +<xsl:param name="css.decoration" select="1"/> +<xsl:param name="make.clean.html" select="1"/> +<xsl:param name="generate.id.attributes" select="1"/> + +<!--==============================================================--> +<!-- Customized templates --> +<!--==============================================================--> + +<!-- HTML5: Replace HTML acronum with abbr for HTML 5 --> +<xsl:template match="acronym"> + <xsl:call-template name="inline.charseq"> + <xsl:with-param name="wrapper-name">abbr</xsl:with-param> + </xsl:call-template> +</xsl:template> + +<!-- HTML5: replace border="0" with border="" --> +<!-- HTML5: No @summary allowed --> +<!-- HTML5: replace many table atts with CSS styles --> +<xsl:template match="tgroup" name="tgroup"> + <xsl:if test="not(@cols) or @cols = '' or string(number(@cols)) = 'NaN'"> + <xsl:message terminate="yes"> + <xsl:text>Error: CALS tables must specify the number of columns.</xsl:text> + </xsl:message> + </xsl:if> + + <xsl:variable name="summary"> + <xsl:call-template name="pi.dbhtml_table-summary"/> + </xsl:variable> + + <xsl:variable name="cellspacing"> + <xsl:call-template name="pi.dbhtml_cellspacing"/> + </xsl:variable> + + <xsl:variable name="cellpadding"> + <xsl:call-template name="pi.dbhtml_cellpadding"/> + </xsl:variable> + + <!-- First generate colgroup with attributes --> + <xsl:variable name="colgroup.with.attributes"> + <colgroup> + <xsl:call-template name="generate.colgroup"> + <xsl:with-param name="cols" select="@cols"/> + </xsl:call-template> + </colgroup> + </xsl:variable> + + <!-- then modify colgroup attributes with extension --> + <xsl:variable name="colgroup.with.extension"> + <xsl:choose> + <xsl:when test="$use.extensions != 0 + and $tablecolumns.extension != 0"> + <xsl:choose> + <xsl:when test="function-available('stbl:adjustColumnWidths')"> + <xsl:copy-of select="stbl:adjustColumnWidths($colgroup.with.attributes)"/> + </xsl:when> + <xsl:when test="function-available('xtbl:adjustColumnWidths')"> + <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup.with.attributes)"/> + </xsl:when> + <xsl:when test="function-available('ptbl:adjustColumnWidths')"> + <xsl:copy-of select="ptbl:adjustColumnWidths($colgroup.with.attributes)"/> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>No adjustColumnWidths function available.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="$colgroup.with.attributes"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- Now convert to @style --> + <xsl:variable name="colgroup"> + <xsl:call-template name="colgroup.with.style"> + <xsl:with-param name="colgroup" select="colgroup.with.extension"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="explicit.table.width"> + <xsl:call-template name="pi.dbhtml_table-width"> + <xsl:with-param name="node" select=".."/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="table.width.candidate"> + <xsl:choose> + <xsl:when test="$explicit.table.width != ''"> + <xsl:value-of select="$explicit.table.width"/> + </xsl:when> + <xsl:when test="$default.table.width = ''"> + <xsl:text>100%</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$default.table.width"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + + <xsl:variable name="table.width"> + <xsl:if test="$default.table.width != '' + or $explicit.table.width != ''"> + <xsl:choose> + <xsl:when test="contains($table.width.candidate, '%')"> + <xsl:value-of select="$table.width.candidate"/> + </xsl:when> + <xsl:when test="$use.extensions != 0 + and $tablecolumns.extension != 0"> + <xsl:choose> + <xsl:when test="function-available('stbl:convertLength')"> + <xsl:value-of select="stbl:convertLength($table.width.candidate)"/> + </xsl:when> + <xsl:when test="function-available('xtbl:convertLength')"> + <xsl:value-of select="xtbl:convertLength($table.width.candidate)"/> + </xsl:when> + <xsl:otherwise> + <xsl:message terminate="yes"> + <xsl:text>No convertLength function available.</xsl:text> + </xsl:message> + </xsl:otherwise> + </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$table.width.candidate"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> + </xsl:variable> + + <!-- assemble a table @style --> + <xsl:variable name="table.style"> + + <xsl:if test="$cellspacing != '' or $html.cellspacing != ''"> + <xsl:text>cellspacing: </xsl:text> + <xsl:choose> + <xsl:when test="$cellspacing != ''"> + <xsl:value-of select="$cellspacing"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$html.cellspacing"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>; </xsl:text> + </xsl:if> + + <xsl:if test="$cellpadding != '' or $html.cellpadding != ''"> + <xsl:text>cellpadding: </xsl:text> + <xsl:choose> + <xsl:when test="$cellpadding != ''"> + <xsl:value-of select="$cellpadding"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$html.cellpadding"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>; </xsl:text> + </xsl:if> + + <xsl:choose> + <xsl:when test="string-length($table.width) != 0"> + <xsl:text>width: </xsl:text> + <xsl:value-of select="$table.width"/> + <xsl:text>; </xsl:text> + </xsl:when> + <xsl:when test="../@pgwide=1 or local-name(.) = 'entrytbl'"> + <xsl:text>width: 100%; </xsl:text> + </xsl:when> + <xsl:otherwise> + </xsl:otherwise> + </xsl:choose> + + <xsl:choose> + <xsl:when test="../@frame='all' or (not(../@frame) and $default.table.frame='all')"> + <xsl:text>border-collapse: collapse; </xsl:text> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'top'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'bottom'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'left'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'right'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="../@frame='topbot' or (not(../@frame) and $default.table.frame='topbot')"> + <xsl:text>border-collapse: collapse;</xsl:text> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'top'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'bottom'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="../@frame='top' or (not(../@frame) and $default.table.frame='top')"> + <xsl:text>border-collapse: collapse;</xsl:text> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'top'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="../@frame='bottom' or (not(../@frame) and $default.table.frame='bottom')"> + <xsl:text>border-collapse: collapse;</xsl:text> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'bottom'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="../@frame='sides' or (not(../@frame) and $default.table.frame='sides')"> + <xsl:text>border-collapse: collapse;</xsl:text> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'left'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + <xsl:call-template name="border"> + <xsl:with-param name="side" select="'right'"/> + <xsl:with-param name="style" select="$table.frame.border.style"/> + <xsl:with-param name="color" select="$table.frame.border.color"/> + <xsl:with-param name="thickness" select="$table.frame.border.thickness"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="../@frame='none'"> + <xsl:text>border: none;</xsl:text> + </xsl:when> + <xsl:otherwise> + <xsl:text>border-collapse: collapse;</xsl:text> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <table> + <!-- HTML5: no table summary allowed --> + <xsl:if test="string-length($table.style) != 0"> + <xsl:attribute name="style"> + <xsl:value-of select="$table.style"/> + </xsl:attribute> + </xsl:if> + + + <xsl:copy-of select="$colgroup"/> + + <xsl:apply-templates select="thead"/> + <xsl:apply-templates select="tfoot"/> + <xsl:apply-templates select="tbody"/> + + <xsl:if test=".//footnote|../title//footnote"> + <tbody class="footnotes"> + <tr> + <td colspan="{@cols}"> + <xsl:apply-templates select=".//footnote|../title//footnote" mode="table.footnote.mode"/> + </td> + </tr> + </tbody> + </xsl:if> + </table> +</xsl:template> + +<!-- HTML5: convert col attributes to col CSS styles --> +<xsl:template name="colgroup.with.style"> + <xsl:param name="colgroup"/> + + <xsl:variable name="colgroup.nodeset" select="exsl:node-set($colgroup)"/> + <xsl:apply-templates select="$colgroup.nodeset" mode="convert.to.style"/> +</xsl:template> + +<xsl:template match="colgroup" mode="convert.to.style"> + <xsl:copy> + <xsl:copy-of select="@*"/> + <xsl:apply-templates mode="convert.to.style"/> + </xsl:copy> +</xsl:template> + +<!-- HTML5: converts obsolete HTML attributes to CSS styles --> +<xsl:template match="*" mode="convert.to.style"> + + <xsl:variable name="style.from.atts"> + <xsl:for-each select="@*"> + + <xsl:choose> + <xsl:when test="local-name() = 'width'"> + <xsl:text>width: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + + <xsl:when test="local-name() = 'align'"> + <xsl:text>align: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + + <xsl:when test="local-name() = 'valign'"> + <xsl:text>vertical-align: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + + <xsl:when test="local-name() = 'border'"> + <xsl:text>border: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + + <xsl:when test="local-name() = 'cellspacing'"> + <xsl:text>border-spacing: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + + <xsl:when test="local-name() = 'cellpadding'"> + <xsl:text>padding: </xsl:text> + <xsl:value-of select="."/> + <xsl:text>; </xsl:text> + </xsl:when> + </xsl:choose> + </xsl:for-each> + </xsl:variable> + + <!-- merge existing styles with these new styles --> + <xsl:variable name="style"> + <xsl:value-of select="concat($style.from.atts, @style)"/> + </xsl:variable> + + <!-- HTML5: <th> does not support block elements, use <td> --> + <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:variable> + + <xsl:element name="{$element.name}"> + <xsl:if test="string-length($style) != 0"> + <xsl:attribute name="style"> + <xsl:value-of select="$style"/> + </xsl:attribute> + </xsl:if> + <!-- Also skip disallowed summary attributes --> + <xsl:copy-of select="@*[local-name(.) != 'width' and + local-name(.) != 'summary' and + local-name(.) != 'border' and + local-name(.) != 'cellspacing' and + local-name(.) != 'cellpadding' and + local-name(.) != 'style' and + local-name(.) != 'align' and + local-name(.) != 'valign']"/> + <xsl:apply-templates mode="convert.to.style"/> + </xsl:element> +</xsl:template> + +<!-- HTML5: convert some attributes to CSS style attribute --> +<xsl:template match="entry|entrytbl"> + <xsl:param name="col"> + <xsl:choose> + <xsl:when test="@revisionflag"> + <xsl:number from="row"/> + </xsl:when> + <xsl:otherwise>1</xsl:otherwise> + </xsl:choose> + </xsl:param> + + <xsl:param name="spans"/> + + + <!-- Process with stock template --> + <xsl:variable name="cell"> + <xsl:call-template name="entry"> + <xsl:with-param name="col" select="$col"/> + <xsl:with-param name="spans" select="$spans"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="cell.nodes" select="exsl:node-set($cell)"/> + + <xsl:apply-templates select="$cell.nodes" mode="convert.to.style"/> + +</xsl:template> + +<xsl:template match="mediaobject|inlinemediaobject"> + <xsl:call-template name="convert.styles"/> +</xsl:template> + +<xsl:template match="calloutlist|revhistory|footnote|figure|co"> + <xsl:call-template name="convert.styles"/> +</xsl:template> + +<xsl:template match="revhistory" mode="titlepage.mode"> + <xsl:call-template name="convert.styles"/> +</xsl:template> + +<xsl:template match="simplelist"> + <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> + + +<!-- 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"> + <div> + <xsl:call-template name="common.html.attributes"/> + <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: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; 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> + +<!-- 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: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="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> + +<!-- 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> + +<!-- 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="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: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:template> + +<!-- HTML5: link rel="home" is not permitted --> +<!-- Add support for attributes on <html> element --> +<xsl:template match="*" mode="process.root"> + <xsl:variable name="doc" select="self::*"/> + + <xsl:call-template name="user.preroot"/> + <xsl:call-template name="root.messages"/> + + <html> + <xsl:call-template name="root.attributes"/> + <head> + <xsl:call-template name="system.head.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + <xsl:call-template name="head.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + <xsl:call-template name="user.head.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + </head> + <body> + <xsl:call-template name="body.attributes"/> + <xsl:call-template name="user.header.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + <xsl:apply-templates select="."/> + <xsl:call-template name="user.footer.content"> + <xsl:with-param name="node" select="$doc"/> + </xsl:call-template> + </body> + </html> + <xsl:value-of select="$html.append"/> + + <!-- Generate any css files only once, not once per chunk --> + <xsl:call-template name="generate.css.files"/> +</xsl:template> + +<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> + ... [truncated message content] |