* Moved all references to //skinconfig out of the document2html.xsl
into the site2xhtml.xsl file.
* Rationalized the Table of Contents stuff by creating a "toc"
mode in the common/xslt/html/document2html.xsl. That is then
used to generate the per-page ToC and the ToC attached to the menu.
* Removed extraneous default xsl matchers on the non-common
document2html and site2xhtml XSLs. This allows matches
defined in the imported transformation sheets to match
(imported sheets have lower precedence).
* Defined a couple of <code><div id="..."></code> place holder
tags used by the document2html. Those are then skinned by the
site2xhtml sheets.
* Note: If you have your own skins that were referencing "$config" or
"//skinconfig" in the document2html.xsl then you need to make similar
changes.
* For more information see the FOR-146 issue report.
Submitted by: Rick Tessner
Issue: FOR-146
git-svn-id: https://svn.apache.org/repos/asf/xml/forrest/branches/copyless@10639 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/core/context/skins/common/xslt/html/document2html.xsl b/src/core/context/skins/common/xslt/html/document2html.xsl
index e624456..d5b4f8b 100644
--- a/src/core/context/skins/common/xslt/html/document2html.xsl
+++ b/src/core/context/skins/common/xslt/html/document2html.xsl
@@ -33,22 +33,6 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <!-- the skinconf file -->
- <xsl:variable name="config" select="//skinconfig"/>
-
- <!-- If true, a PDF link for this page will not be generated -->
- <xsl:variable name="disable-pdf-link" select="//skinconfig/disable-pdf-link"/>
- <!-- If true, a "print" link for this page will not be generated -->
- <xsl:variable name="disable-print-link" select="//skinconfig/disable-print-link"/>
- <!-- If true, an XML link for this page will not be generated -->
- <xsl:variable name="disable-xml-link" select="//skinconfig/disable-xml-link"/>
- <!-- Get the location where to generate the minitoc -->
- <xsl:variable name="minitoc-location" select="//skinconfig/toc/@location"/>
- <!-- Whether to obfuscate email links -->
- <xsl:variable name="obfuscate-mail-links" select="//skinconfig/obfuscate-mail-links"/>
- <!-- If true, an the images on all external links will not be added -->
- <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/>
-
<xsl:param name="dynamic-page" select="'false'"/>
<xsl:param name="notoc"/>
<xsl:param name="path"/>
@@ -63,14 +47,13 @@
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="filename-noext">
- <xsl:call-template name="filename-noext">
- <xsl:with-param name="path" select="$path"/>
- </xsl:call-template>
- </xsl:variable>
-
<xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
+ <xsl:template match="/">
+ <xsl:apply-templates mode="toc"/>
+ <xsl:apply-templates/>
+ </xsl:template>
+
<xsl:template match="document">
<div class="content">
<table summary="" class="title">
@@ -82,9 +65,11 @@
</h1>
</xsl:if>
</td>
- <xsl:call-template name="printlink"/>
- <xsl:call-template name="pdflink"/>
- <xsl:call-template name="xmllink"/>
+ <div id="skinconf-printlink"/>
+ <xsl:if test="$dynamic-page='false'">
+ <div id="skinconf-pdflink"/>
+ <div id="skinconf-xmllink"/>
+ </xsl:if>
</tr>
</table>
<xsl:if test="normalize-space(header/subtitle)!=''">
@@ -106,68 +91,8 @@
</div>
</xsl:template>
- <!-- Generates the "printer friendly version" link -->
- <xsl:template name="printlink">
- <xsl:if test="$disable-print-link = 'false'">
-<script type="text/javascript" language="Javascript">
-function printit() {
-if (window.print) {
- window.print() ;
-} else {
- var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
-document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
- WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
-}
-}
-</script>
-
-<script type="text/javascript" language="Javascript">
-var NS = (navigator.appName == "Netscape");
-var VERSION = parseInt(navigator.appVersion);
-if (VERSION > 3) {
- document.write('<td align="center" width="40" nowrap="nowrap">');
- document.write(' <a href="javascript:printit()" class="dida">');
- document.write(' <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
- document.write(' print</a>');
- document.write('</td>');
-}
-</script>
-
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="not(//skinconfig/disable-pdf-link) or $disable-pdf-link = 'false'">
- <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
- <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
- PDF</a>
- </td>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
-
- <!-- Generates the XML link -->
- <xsl:template name="xmllink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="$disable-xml-link = 'false'">
- <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
- <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
- xml</a>
- </td>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
<xsl:template match="body">
- <xsl:if test="//skinconfig/toc">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
@@ -237,25 +162,9 @@
<xsl:template match="link">
<xsl:apply-templates select="@id"/>
- <xsl:choose>
- <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
- <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
- <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
- <a href="{$mailto-1}.at.{$mailto-2}">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))">
- <a href="{@href}" class="external">
- <xsl:apply-templates/>
- </a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{@href}">
- <xsl:apply-templates/>
- </a>
- </xsl:otherwise>
- </xsl:choose>
+ <a href="{@href}">
+ <xsl:apply-templates/>
+ </a>
</xsl:template>
<xsl:template match="jump">
@@ -346,41 +255,6 @@
</xsl:attribute>
</xsl:template>
- <xsl:template name="minitoc">
- <xsl:param name="tocroot"/>
- <xsl:param name="depth"/>
- <xsl:if test="count($tocroot/section) >= //skinconfig/toc/@min-sections">
- <ul class="minitoc">
- <xsl:for-each select="$tocroot/section">
- <li>
- <xsl:call-template name="toclink"/>
- <xsl:if test="$depth<//skinconfig/toc/@max-depth">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth" select="$depth + 1"/>
- </xsl:call-template>
- </xsl:if>
- </li>
- </xsl:for-each>
- </ul>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="toclink">
- <xsl:variable name="tocitem" select="normalize-space(title)"/>
- <xsl:if test="string-length($tocitem)>0">
- <a>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text>
- <xsl:if test="@id">
- <xsl:value-of select="@id"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:value-of select="$tocitem"/>
- </a>
- </xsl:if>
- </xsl:template>
-
<xsl:template match="header/authors">
<xsl:for-each select="person">
<xsl:choose>
@@ -440,22 +314,59 @@
<xsl:template name="email">
<a>
- <xsl:attribute name="href">
- <xsl:choose>
- <xsl:when test="$obfuscate-mail-links='true'">
- <xsl:variable name="user" select="substring-before(@email,'@')"/>
- <xsl:variable name="host" select="substring-after(@email,'@')"/>
- <xsl:value-of select="concat('mailto:',$user,'.at.',$host)"/>
- </xsl:when>
- <xsl:otherwise>
+ <xsl:attribute name="href">
<xsl:value-of select="concat('mailto:',@email)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
+ </xsl:attribute>
<xsl:value-of select="@name"/>
</a>
</xsl:template>
+ <xsl:template name="generate-id">
+ <xsl:choose>
+ <xsl:when test="@id">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ <xsl:when test="@title">
+ <xsl:value-of select="@title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id(.)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Templates for "toc" mode. This will generate a complete
+ Table of Contents for the document. This will then be used
+ by the site2xhtml to generate a Menu ToC and a Page ToC -->
+
+ <xsl:template match="document" mode="toc">
+ <xsl:apply-templates mode="toc"/>
+ </xsl:template>
+
+ <xsl:template match="body" mode="toc">
+ <tocitems>
+ <xsl:apply-templates select="section" mode="toc">
+ <xsl:with-param name="level" select="1"/>
+ </xsl:apply-templates>
+ </tocitems>
+ </xsl:template>
+
+ <xsl:template match="section" mode="toc">
+ <xsl:param name="level"/>
+
+ <tocitem level="{$level}">
+ <xsl:attribute name="href">#<xsl:call-template name="generate-id"/></xsl:attribute>
+ <xsl:attribute name="title"><xsl:value-of select="title"/></xsl:attribute>
+ <xsl:apply-templates mode="toc">
+ <xsl:with-param name="level" select="$level+1"/>
+ </xsl:apply-templates>
+ </tocitem>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" mode="toc"/>
+
+ <!-- End of "toc" mode templates -->
+
<xsl:template match="node()|@*" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*"/>
diff --git a/src/core/context/skins/common/xslt/html/site2xhtml.xsl b/src/core/context/skins/common/xslt/html/site2xhtml.xsl
index cddc8c2..1ece9fb 100644
--- a/src/core/context/skins/common/xslt/html/site2xhtml.xsl
+++ b/src/core/context/skins/common/xslt/html/site2xhtml.xsl
@@ -37,6 +37,14 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="config" select="//skinconfig"/>
+ <!-- If true, a PDF link for this page will not be generated -->
+ <xsl:variable name="disable-pdf-link" select="//skinconfig/disable-pdf-link"/>
+ <!-- If true, a "print" link for this page will not be generated -->
+ <xsl:variable name="disable-print-link" select="//skinconfig/disable-print-link"/>
+ <!-- If true, an XML link for this page will not be generated -->
+ <xsl:variable name="disable-xml-link" select="//skinconfig/disable-xml-link"/>
+ <!-- Get the location where to generate the minitoc -->
+ <xsl:variable name="minitoc-location" select="//skinconfig/toc/@location"/>
<xsl:param name="path"/>
@@ -58,6 +66,16 @@
</xsl:call-template>
</xsl:variable>
+ <xsl:variable name="filename-noext">
+ <xsl:call-template name="filename-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Whether to obfuscate email links -->
+ <xsl:variable name="obfuscate-mail-links" select="//skinconfig/obfuscate-mail-links"/>
+ <!-- If true, an the images on all external links will not be added -->
+ <xsl:variable name="disable-external-link-image" select="//skinconfig/disable-external-link-image"/>
<xsl:variable name="skin-img-dir" select="concat(string($root), 'skin/images')"/>
<xsl:variable name="spacer" select="concat($root, 'skin/images/spacer.gif')"/>
@@ -155,6 +173,110 @@
</xsl:if>
</xsl:template>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.pdf" class="dida">
+ <img class="skin" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/><br/>
+ PDF</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the XML link -->
+ <xsl:template match="div[@id='skinconf-xmllink']">
+ <xsl:if test="$disable-xml-link = 'false'">
+ <td align="center" width="40" nowrap="nowrap"><a href="{$filename-noext}.xml" class="dida">
+ <img class="skin" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/><br/>
+ xml</a>
+ </td>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the "printer friendly version" link -->
+ <xsl:template match="div[@id='skinconf-printlink']">
+ <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+if (window.print) {
+ window.print() ;
+} else {
+ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
+}
+}
+</script>
+
+<script type="text/javascript" language="Javascript">
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write('<td align="center" width="40" nowrap="nowrap">');
+ document.write(' <a href="javascript:printit()" class="dida">');
+ document.write(' <img class="skin" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/><br />');
+ document.write(' print</a>');
+ document.write('</td>');
+}
+</script>
+
+ </xsl:if>
+ </xsl:template>
+
+ <!-- handle all obfuscating mail links and disabling external link images -->
+ <xsl:template match="a">
+ <xsl:choose>
+ <xsl:when test="$obfuscate-mail-links='true' and starts-with(@href, 'mailto:') and contains(@href, '@')">
+ <xsl:variable name="mailto-1" select="substring-before(@href,'@')"/>
+ <xsl:variable name="mailto-2" select="substring-after(@href,'@')"/>
+ <a href="{$mailto-1}.at.{$mailto-2}">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:when test="not($disable-external-link-image='true') and contains(@href, ':') and not(contains(@href, //skinconfig/group-url)) and not(contains(@href, //skinconfig/project-url))">
+ <a href="{@href}" class="external">
+ <xsl:apply-templates/>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- xsl:copy-of makes sure we copy <a href> as well as <a name>
+ or any other <a ...> forms -->
+ <xsl:copy-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="div[@id='skinconf-toc-page']">
+ <xsl:if test="$config/toc">
+ <xsl:if test="contains($minitoc-location,'page')">
+ <xsl:if test="count(//tocitems/tocitem) >= $config/toc/@min-sections">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="//tocitems"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="minitoc">
+ <xsl:param name="tocroot"/>
+ <xsl:if test="count($tocroot/tocitem) >= $config/toc/@min-sections">
+ <ul class="minitoc">
+ <xsl:for-each select="$tocroot/tocitem">
+ <li>
+ <a href="{@href}">
+ <xsl:value-of select="@title"/>
+ </a>
+ <xsl:if test="@level<//skinconfig/toc/@max-depth+1">
+ <xsl:call-template name="minitoc">
+ <xsl:with-param name="tocroot" select="."/>
+ </xsl:call-template>
+ </xsl:if>
+ </li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:template>
<xsl:template match="node()|@*" priority="-1">
<xsl:copy>
diff --git a/src/core/context/skins/forrest-css/xslt/html/document2html.xsl b/src/core/context/skins/forrest-css/xslt/html/document2html.xsl
index 022eb67..c1613a0 100644
--- a/src/core/context/skins/forrest-css/xslt/html/document2html.xsl
+++ b/src/core/context/skins/forrest-css/xslt/html/document2html.xsl
@@ -34,7 +34,7 @@
<xsl:template match="document">
<div class="content">
- <xsl:call-template name="pdflink"/>
+ <div id="skinconf-pdflink"/>
<xsl:if test="normalize-space(header/title)!=''">
<h1><xsl:value-of select="header/title"/></h1>
</xsl:if>
@@ -63,59 +63,10 @@
</xsl:template>
<xsl:template match="body">
- <xsl:if test="//skinconfig/toc/@max-depth>0 and not($notoc='true')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
- <xsl:template name="toclink">
- <xsl:variable name="tocitem" select="normalize-space(title)"/>
- <xsl:if test="string-length($tocitem)>0">
- <li>
- <a>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="$tocitem"/>
- </a>
- </li>
- </xsl:if>
- </xsl:template>
-
-
-
- <xsl:template name="minitoc">
- <xsl:param name="tocroot"/>
- <xsl:param name="depth"/>
- <ul>
- <xsl:for-each select="$tocroot/section">
- <xsl:call-template name="toclink"/>
- <xsl:if test="$depth<//skinconfig/toc/@max-depth">
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth" select="$depth + 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </ul>
- </xsl:template>
-
-
- <xsl:template name="generate-id">
- <xsl:choose>
- <xsl:when test="@id">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
<xsl:template match="@id">
<xsl:apply-imports/>
</xsl:template>
@@ -219,11 +170,4 @@
<!-- do not show title elements, they are already in other places-->
</xsl:template>
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <a href="{$filename-noext}.pdf" id="printable"><img src="{$skin-img-dir}/pdfdoc.gif"
- alt="PDF"/>PDF version</a>
- </xsl:template>
-
-
</xsl:stylesheet>
diff --git a/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl b/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
index 008bde5..2f63534 100644
--- a/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
+++ b/src/core/context/skins/forrest-css/xslt/html/site2xhtml.xsl
@@ -260,12 +260,10 @@
</a>
</xsl:template>
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <a href="{$filename-noext}.pdf" id="printable"><img src="{$skin-img-dir}/pdfdoc.gif"
+ alt="PDF"/>PDF version</a>
</xsl:template>
-
-
+
</xsl:stylesheet>
diff --git a/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl b/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
index 8d2e48c..1ac094c 100644
--- a/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
+++ b/src/core/context/skins/forrest-site/xslt/html/site2xhtml.xsl
@@ -327,11 +327,4 @@
</table>
</xsl:template>
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl b/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl
index b05daca..42b7dac 100644
--- a/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl
+++ b/src/core/context/skins/krysalis-site/xslt/html/document2html.xsl
@@ -46,7 +46,7 @@
<xsl:call-template name="printerfriendlylink"/>
<xsl:call-template name="xmllink"/>
-->
- <xsl:call-template name="pdflink"/>
+ <div id="skinconf-pdflink"/>
</tr>
</table>
</xsl:if>
@@ -76,56 +76,10 @@
</xsl:template>
<xsl:template match="body">
-
- <xsl:if test="section and //skinconfig/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'menu')">
- <toc>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- <xsl:if test="section">
- <toc2>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- </tocc>
- </xsl:for-each>
- </toc2>
- </xsl:if>
- </tocc>
- </xsl:for-each>
- </toc>
- </xsl:if>
-
- <xsl:if test="//skinconfig/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'page')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
- <xsl:template name="generate-id">
- <xsl:choose>
- <xsl:when test="@id">
- <xsl:value-of select="@id"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="generate-id(.)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
<xsl:template match="@id">
<xsl:apply-imports/>
</xsl:template>
@@ -138,110 +92,16 @@
<xsl:choose>
<xsl:when test="$level=1">
- <xsl:choose>
- <xsl:when test="//skinconfig/headings/@type='underlined'">
-
- <table class="h3" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td width="9" height="10"></td>
- <td><h3><xsl:value-of select="title"/></h3></td>
- <td></td>
- </tr>
- <tr class="heading ">
- <td class="bottom-left"></td>
- <td class="bottomborder"></td>
- <td class="bottom-right"></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:when test="//skinconfig/headings/@type='boxed'">
-
- <table class="h3 heading" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td class="top-left"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td><h3><xsl:value-of select="title"/></h3></td>
- <td></td>
- </tr>
- <tr>
- <td class=" bottom-left"></td>
- <td></td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:otherwise>
- <h3 class="h3"><xsl:value-of select="title"/></h3>
- </xsl:otherwise>
- </xsl:choose>
-
- <div class="section"><xsl:apply-templates/></div>
-
+ <div class="skinconf-heading-{$level}">
+ <h1><xsl:value-of select="title"/></h1>
+ </div>
+ <div class="section"><xsl:apply-templates/></div>
</xsl:when>
<xsl:when test="$level=2">
- <xsl:choose>
- <xsl:when test="//skinconfig/headings/@type='underlined'">
-
- <table class="h4" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td width="9" height="10"></td>
- <td><h4><xsl:value-of select="title"/></h4></td>
- <td></td>
- </tr>
- <tr class="subheading">
- <td class="bottom-left"></td>
- <td></td>
- <td class="bottom-right"></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:when test="//skinconfig/headings/@type='boxed'">
-
- <table class="h4 subheading" cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td class="top-left"></td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td></td>
- <td><h4><xsl:value-of select="title"/></h4></td>
- <td></td>
- </tr>
- <tr>
- <td class=" bottom-left"></td>
- <td></td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
-
- </xsl:when>
- <xsl:otherwise>
- <h4 class="h4"><xsl:value-of select="title"/></h4>
- </xsl:otherwise>
- </xsl:choose>
-
+ <div class="skinconf-heading-{$level}">
+ <h1><xsl:value-of select="title"/></h1>
+ </div>
<xsl:apply-templates select="*[not(self::title)]"/>
-
</xsl:when>
<!-- If a faq, answer sections will be level 3 (1=Q/A, 2=part) -->
<xsl:when test="$level=3 and $notoc='true'">
diff --git a/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl b/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
index b436e8e..f6472c8 100644
--- a/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
+++ b/src/core/context/skins/krysalis-site/xslt/html/site2xhtml.xsl
@@ -386,30 +386,30 @@
<xsl:when test="span/@class='sel'">
<div class="menupage">
<div class="menupagetitle"><xsl:value-of select="span" /></div>
- <xsl:if test="//toc/tocc">
+ <xsl:if test="//tocitems/tocitem">
<div class="menupageitemgroup">
- <xsl:for-each select = "//toc/tocc">
+ <xsl:for-each select = "//tocitems/tocitem">
<div class="menupageitem">
<xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a>
+ <xsl:when test="string-length(@title)>15">
+ <a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a>
</xsl:when>
<xsl:otherwise>
- <a href="{toca/@href}"><xsl:value-of select="toca" /></a>
+ <a href="{@href}"><xsl:value-of select="@title" /></a>
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="toc2/tocc">
+ <xsl:if test="tocitem">
<!-- nicolaken: this enables double-nested page links-->
<ul>
- <xsl:for-each select = "toc2/tocc">
+ <xsl:for-each select = "tocitem">
<xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <li><a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a></li>
+ <xsl:when test="string-length(@title)>15">
+ <li><a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a></li>
</xsl:when>
<xsl:otherwise>
- <li><a href="{toca/@href}"><xsl:value-of select="toca" /></a></li>
+ <li><a href="{@href}"><xsl:value-of select="@title" /></a></li>
</xsl:otherwise>
</xsl:choose>
@@ -434,9 +434,6 @@
</div>
</xsl:template>
- <xsl:template match="toc|toc2|tocc|toca">
- </xsl:template>
-
<xsl:template name="mainarea">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<!-- ( ================= middle NavBar ================== ) -->
@@ -463,6 +460,98 @@
</table>
</xsl:template>
+ <xsl:template match="div[@class = 'skinconf-heading-1']">
+ <xsl:choose>
+ <xsl:when test="//skinconfig/headings/@type='underlined'">
+
+ <table class="h3" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td width="9" height="10"></td>
+ <td><h3><xsl:value-of select="h1"/></h3></td>
+ <td></td>
+ </tr>
+ <tr class="heading ">
+ <td class="bottom-left"></td>
+ <td class="bottomborder"></td>
+ <td class="bottom-right"></td>
+ </tr>
+
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:when test="//skinconfig/headings/@type='boxed'">
+ <table class="h3 heading" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td class="top-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><h3><xsl:value-of select="h1"/></h3></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class=" bottom-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <h3 class="h3"><xsl:value-of select="h1"/></h3>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="div[@class = 'skinconf-heading-2']">
+ <xsl:choose>
+ <xsl:when test="//skinconfig/headings/@type='underlined'">
+ <table class="h4" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td width="9" height="10"></td>
+ <td><h4><xsl:value-of select="h1"/></h4></td>
+ <td></td>
+ </tr>
+ <tr class="subheading">
+ <td class="bottom-left"></td>
+ <td></td>
+ <td class="bottom-right"></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:when test="//skinconfig/headings/@type='boxed'">
+ <table class="h4 subheading" cellpadding="0" cellspacing="0" border="0" width="100%">
+ <tbody>
+ <tr>
+ <td class="top-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><h4><xsl:value-of select="h1"/></h4></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td class=" bottom-left"></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <h4 class="h4"><xsl:value-of select="h1"/></h4>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template name="bottomstrip">
<!-- ( ================= start Footer ================== ) -->
<table>
@@ -527,12 +616,5 @@
</xsl:if>
-->
</xsl:template>
-
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
</xsl:stylesheet>
diff --git a/src/core/context/skins/tigris-style/xslt/html/document2html.xsl b/src/core/context/skins/tigris-style/xslt/html/document2html.xsl
index a3c3b26..564ed63 100644
--- a/src/core/context/skins/tigris-style/xslt/html/document2html.xsl
+++ b/src/core/context/skins/tigris-style/xslt/html/document2html.xsl
@@ -50,10 +50,11 @@
</td>
<td id="issueid" class="tasknav">
<div align="right">
- <xsl:call-template name="pdflink"/>
- <xsl:call-template name="printlink"/>
- <xsl:call-template name="xmllink"/>
-  
+ <div id="skinconf-printlink"/>
+ <xsl:if test="$dynamic-page='false'">
+ <div id="skinconf-pdflink"/>
+ <div id="skinconf-xmllink"/>
+ </xsl:if>
</div>
</td>
</tr>
@@ -93,42 +94,7 @@
</xsl:template>
<xsl:template match="body">
-
- <xsl:if test="section and $config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'menu')">
- <toc>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- <xsl:if test="section">
- <toc2>
- <xsl:for-each select="section">
- <tocc>
- <toca>
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text><xsl:call-template name="generate-id"/>
- </xsl:attribute>
- <xsl:value-of select="title"/>
- </toca>
- </tocc>
- </xsl:for-each>
- </toc2>
- </xsl:if>
- </tocc>
- </xsl:for-each>
- </toc>
- </xsl:if>
-
- <xsl:if test="$config/toc/@max-depth>0 and not($notoc='true') and contains($minitoc-location,'page')" >
- <xsl:call-template name="minitoc">
- <xsl:with-param name="tocroot" select="."/>
- <xsl:with-param name="depth">1</xsl:with-param>
- </xsl:call-template>
- </xsl:if>
+ <div id="skinconf-toc-page"/>
<xsl:apply-templates/>
</xsl:template>
@@ -149,6 +115,7 @@
<xsl:template match="section">
<a name="{generate-id()}"/>
+
<xsl:apply-templates select="@id"/>
<xsl:variable name = "level" select = "count(ancestor::section)+1" />
@@ -273,50 +240,4 @@
<!-- do not show title elements, they are already in other places-->
</xsl:template>
- <!-- Generates the PDF link -->
- <xsl:template name="pdflink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
- <a href="{$filename-noext}.pdf"><img border="0" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/> PDF</a>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the XML link -->
- <xsl:template name="xmllink">
- <xsl:if test="$dynamic-page='false'">
- <xsl:if test="$disable-xml-link = 'false'">
- <a href="{$filename-noext}.xml"><img border="0" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/> xml</a>
- </xsl:if>
- </xsl:if>
- </xsl:template>
-
- <!-- Generates the "printer friendly version" link -->
- <xsl:template name="printlink">
- <xsl:if test="$disable-print-link = 'false'">
-<script type="text/javascript" language="Javascript">
-function printit() {
-if (window.print) {
- window.print() ;
-} else {
- var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
-document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
- WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
-}
-}
-</script>
-
-<script type="text/javascript" language="Javascript">
-var NS = (navigator.appName == "Netscape");
-var VERSION = parseInt(navigator.appVersion);
-if (VERSION > 3) {
- document.write(' <a href="javascript:printit()">');
- document.write(' <img border="0" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/>');
- document.write(' print</a>');
-}
-</script>
-
- </xsl:if>
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl b/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
index cd0243a..9db1762 100644
--- a/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
+++ b/src/core/context/skins/tigris-style/xslt/html/site2xhtml.xsl
@@ -182,6 +182,48 @@
<xsl:call-template name="breadcrumbs"/>
</xsl:template>
+ <!-- Generates the PDF link -->
+ <xsl:template match="div[@id='skinconf-pdflink']">
+ <xsl:if test="not($config/disable-pdf-link) or $disable-pdf-link = 'false'">
+ <a href="{$filename-noext}.pdf"><img border="0" src="{$skin-img-dir}/pdfdoc.gif" alt="PDF"/> PDF</a>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the XML link -->
+ <xsl:template match="div[@id='skinconf-xmllink']">
+ <xsl:if test="$disable-xml-link = 'false'">
+ <a href="{$filename-noext}.xml"><img border="0" src="{$skin-img-dir}/xmldoc.gif" alt="xml"/> xml</a>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Generates the "printer friendly version" link -->
+ <xsl:template match="div[@id='skinconf-printlink']">
+ <xsl:if test="$disable-print-link = 'false'">
+<script type="text/javascript" language="Javascript">
+function printit() {
+if (window.print) {
+ window.print() ;
+} else {
+ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
+}
+}
+</script>
+
+<script type="text/javascript" language="Javascript">
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write(' <a href="javascript:printit()">');
+ document.write(' <img border="0" src="{$skin-img-dir}/printer.gif" alt="Print this Page"/>');
+ document.write(' print</a>');
+}
+</script>
+
+ </xsl:if>
+ </xsl:template>
+
<xsl:template name="centerstrip" >
<!--
+=========+======================+
@@ -230,27 +272,30 @@
</div>
<xsl:apply-templates select="div[@class='menu']"/>
- <xsl:if test="//toc/tocc">
- <div class="label">
- <strong>Page</strong>
- </div>
- <div class="body">
- <xsl:for-each select = "//toc/tocc">
- <div>
- <xsl:choose>
- <xsl:when test="string-length(toca)>15">
- <a href="{toca/@href}" title="{toca}"><xsl:value-of select="substring(toca,0,20)" />...</a>
- </xsl:when>
- <xsl:otherwise>
- <a href="{toca/@href}"><xsl:value-of select="toca" /></a>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="toc2/tocc"><!-- discard second level --></xsl:if>
- </div>
- </xsl:for-each>
- </div>
+ <xsl:if test="$config/toc/@max-depth>0 and contains($minitoc-location,'menu')">
+ <xsl:if test="//tocitems/tocitem">
+ <div class="label">
+ <strong>Page</strong>
+ </div>
+ <div class="body">
+ <!-- Only show first level sections here -->
+ <xsl:for-each select = "//tocitems/tocitem[@level=1]">
+ <div>
+ <xsl:choose>
+ <xsl:when test="string-length(@title)>15">
+ <a href="{@href}" title="{@title}"><xsl:value-of select="substring(@title,0,20)" />...</a>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}"><xsl:value-of select="@title" /></a>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </xsl:for-each>
+ </div>
+ </xsl:if>
</xsl:if>
</div>
+
<!-- ( ================= end Menu items ================== ) -->
<!-- ( ================= Search ================== ) -->
@@ -316,9 +361,6 @@
</xsl:template>
- <xsl:template match="toc|toc2|tocc|toca">
- </xsl:template>
-
<xsl:template name="mainarea">
<xsl:apply-templates select="div[@class='content']"/>
</xsl:template>
@@ -378,12 +420,5 @@
</xsl:if>
-->
</xsl:template>
-
- <xsl:template match="node()|@*" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
</xsl:stylesheet>
diff --git a/status.xml b/status.xml
index c129c79..640be11 100644
--- a/status.xml
+++ b/status.xml
@@ -44,6 +44,25 @@
<changes>
<release version="0.6-dev" date="unreleased">
+ <action dev="DC" type="fix" context="core"
+ due-to="Rick Tessner" fixes-bug="FOR-146">
+ Moved all references to //skinconfig out of the document2html.xsl
+ into the site2xhtml.xsl file.
+ * Rationalized the Table of Contents stuff by creating a "toc"
+ mode in the common/xslt/html/document2html.xsl. That is then
+ used to generate the per-page ToC and the ToC attached to the menu.
+ * Removed extraneous default xsl matchers on the non-common
+ document2html and site2xhtml XSLs. This allows matches
+ defined in the imported transformation sheets to match
+ (imported sheets have lower precedence).
+ * Defined a couple of <code><div id="..."></code> place holder
+ tags used by the document2html. Those are then skinned by the
+ site2xhtml sheets.
+ * Note: If you have your own skins that were referencing "$config" or
+ "//skinconfig" in the document2html.xsl then you need to make similar
+ changes.
+ * For more information see the FOR-146 issue report.
+ </action>
<action dev="JJP" type="fix" context="core" >
Replace document() function to get skinconf values and use "//skinconfig".
Fix order so it can validate skinconf.