hhc.xsl revision 66e48875fca2df6669dab4f2690ee36c6913c0ff
66e48875fca2df6669dab4f2690ee36c6913c0ffnd Copyright 2003-2004 The Apache Software Foundation
66e48875fca2df6669dab4f2690ee36c6913c0ffnd Licensed under the Apache License, Version 2.0 (the "License");
66e48875fca2df6669dab4f2690ee36c6913c0ffnd you may not use this file except in compliance with the License.
66e48875fca2df6669dab4f2690ee36c6913c0ffnd You may obtain a copy of the License at
66e48875fca2df6669dab4f2690ee36c6913c0ffnd Unless required by applicable law or agreed to in writing, software
66e48875fca2df6669dab4f2690ee36c6913c0ffnd distributed under the License is distributed on an "AS IS" BASIS,
66e48875fca2df6669dab4f2690ee36c6913c0ffnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66e48875fca2df6669dab4f2690ee36c6913c0ffnd See the License for the specific language governing permissions and
66e48875fca2df6669dab4f2690ee36c6913c0ffnd limitations under the License.
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- WARNING! Do not touch anything, especially the whitespaces [1] -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- unless you know, what you're doing. The HTML help compiler parses -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- the TOC file not really as html instead of line by line and takes -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- care of whitespace indentations etc. -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- [1] Covered by the &lf; and &tab; entities. -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- You have been warned. -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- create nodeset for referencing later -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="not-exists" select="document('')/xsl:stylesheet/xsl:template
66e48875fca2df6669dab4f2690ee36c6913c0ffnd [@name='data']/not-exists/file" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- documents not converted (yet?). -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- example: <file>developer/API.xml</file> -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- Constants used for case translation -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- document() works relative to the xsl (!) file -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- icons -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="icon.document.not-translated" select="'12'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:variable name="icon.commondirective" select="'19'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- this should not happen. this icon is only displayed within the
66e48875fca2df6669dab4f2690ee36c6913c0ffnd toc view of the help workshop (it's a question mark): -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- for module-translatename -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- <sitemap> -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- Create CHM contents file (toc) from sitemap -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- The file is an html style text file (see warning on top) -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- html head -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text><title>Apache HTTP Server Documentation</title></xsl:text>
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- toc properties first -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text><object type="text/site properties"></xsl:text>&lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- XXX: that magic value is still obfuscated. Research needed ... -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text><param name="Window Styles" value="0x800027"></xsl:text>&lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <!-- index page on top. -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="normalize-space($message[@id='apachehttpserver'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <!-- iterate over the categories in document order -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="name" select="normalize-space(title)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &ul.start; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &li.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- /sitemap -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- document entry, if not href attribute, assume it means "sitemap" -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='sitemap'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- now try to index the sections of the document -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd&li.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- category/page, mode="index" -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- display all section headings of one page -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat(substring-before($href.offline, '.html'), '.xml')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(document(concat($basedir, $xml))/*/@metafile)
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /metafile" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:when test="$metafile/variants/variant[.=$doclang] and not
66e48875fca2df6669dab4f2690ee36c6913c0ffnd ($metafile/variants/variant[.=$doclang]
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /@htmlonly = 'yes')">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd substring-before($xml, '.xml'), $xml-ext)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:variable name="current" select="document($xmlfile)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:if test="count($current/*/*[local-name()='section' or
66e48875fca2df6669dab4f2690ee36c6913c0ffnd local-name()='category']) > 1">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &lf;&tab;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &ul.start; &lf;&tab;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:for-each select="$current/*/*[local-name()='section' or
66e48875fca2df6669dab4f2690ee36c6913c0ffnd local-name()='category']">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="name" select="normalize-space(title)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat(substring-before($xml, '.xml'),
66e48875fca2df6669dab4f2690ee36c6913c0ffnd '.html#', @id)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="indent" select="'				'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &li.end; &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &ul.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- /category/page, "index" -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- process all listed module files -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- create a module name translation list for sorting -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(concat($basedir,'mod/',.))/modulesynopsis" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- put core and mpm_common on top -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(concat($basedir, 'mod/', modulefile[starts-with(.,
66e48875fca2df6669dab4f2690ee36c6913c0ffnd 'core.xml')]/text()))/modulesynopsis" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(concat($basedir, 'mod/', modulefile[starts-with(.,
66e48875fca2df6669dab4f2690ee36c6913c0ffnd 'mpm_common.xml')]/text()))/modulesynopsis" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- remaining MPMs -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:sort select="substring-before(substring-after($translist, concat('- ',
66e48875fca2df6669dab4f2690ee36c6913c0ffnd document(concat($basedir, 'mod/', .))/modulesynopsis/name, ' ')), ' -')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(concat($basedir, 'mod/', .))/modulesynopsis" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:if test="$current/status='MPM' and not($current/name='mpm_common')">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd substring-after($translist, concat('- ', $current/name, ' ')),
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- normal modules -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:sort select="substring-before(substring-after($translist, concat('- ',
66e48875fca2df6669dab4f2690ee36c6913c0ffnd document(concat($basedir, 'mod/', .))/modulesynopsis/name, ' ')), ' -')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="document(concat($basedir, 'mod/', .))/modulesynopsis" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:if test="not($current/status='MPM') and not($current/status='Core')">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- create entry (and initiate subsection entries) of an mpm -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='apachecore'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='apachempmcommon'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='apachempm'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat('mod/', $current/name, '.html')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd&li.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- create entry (and initiate subsection entries) of a module -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='apachemodule'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat('mod/', $current/name, '.html')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd&li.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- sections-and-directives -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- process sections and directives of a module file -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd count($current/directivesynopsis) > 0">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &ul.start; &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <!-- sections -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="name" select="normalize-space(title)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat('mod/', $current/name, '.html#', @id)" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="indent" select="'				'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &li.end; &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <!-- directives within the current document -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:for-each select="$current/directivesynopsis[not(@location)]">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /@replace-space-with">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /@replace-space-with" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='directive'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat('mod/', $current/name, '.html#',
66e48875fca2df6669dab4f2690ee36c6913c0ffnd translate(name, $uppercase, $lowercase))" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="indent" select="'				'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &li.end; &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <!-- directives described elsewhere -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:for-each select="$current/directivesynopsis[@location]">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /@replace-space-with">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /@replace-space-with" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="normalize-space($message[@id='directive'])" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat('mod/', @location, '.html#',
66e48875fca2df6669dab4f2690ee36c6913c0ffnd translate(name, $uppercase, $lowercase))" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="indent" select="'				'" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="icon" select="$icon.commondirective" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &li.end; &lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd &ul.end; &lf;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- /sections-and-directives -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- object -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- display an <object> and do some magic to select the right content -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- xml file is expected to have the same basename -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd select="concat(substring-before($href.offline, '.html'), '.xml')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text><object type="text/sitemap"></xsl:text>&lf;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd (not($xml = $not-exists) and
66e48875fca2df6669dab4f2690ee36c6913c0ffnd (document(document(concat($basedir, $xml))
66e48875fca2df6669dab4f2690ee36c6913c0ffnd /*/@metafile)
66e48875fca2df6669dab4f2690ee36c6913c0ffnd [.=$doclang and not(@htmlonly='yes')]))">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- /object -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- folder -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:text><object type="text/sitemap"></xsl:text>&lf;&tab;&tab;
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- /folder -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- change uri reference to work offline (/ -> /index.html) -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:when test="contains($href, '#') and '/' = substring($href,
66e48875fca2df6669dab4f2690ee36c6913c0ffnd string-length(substring-before($href, '#')), 1)">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<xsl:when test="substring($href, string-length($href), 1) = '/'">
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- escape special characters for being valid within an attribute -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="text" select="substring-before($text, '&')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="text" select="substring-after($text, '&')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- accompanying template of filter.attval -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd<!-- ==================================================================== -->
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="substring-before($text, '<')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="text" select="substring-after($text, '<')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="substring-before($text, '>')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="text" select="substring-after($text, '>')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:value-of select="substring-before($text, '"')" />
66e48875fca2df6669dab4f2690ee36c6913c0ffnd <xsl:with-param name="text" select="substring-after($text, '"')" />