home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 May / Gamestar_62_2004-05_dvd.iso / Programy / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252953_hhp.xsl < prev    next >
Extensible Markup Language  |  2003-04-21  |  17KB  |  367 lines

  1. <?xml version="1.0"?><!--
  2. /* ====================================================================
  3.  * The Apache Software License, Version 1.1
  4.  *
  5.  * Copyright (c) 2003 The Apache Software Foundation.  All rights
  6.  * reserved.
  7.  *
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  *
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  *
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in
  17.  *    the documentation and/or other materials provided with the
  18.  *    distribution.
  19.  *
  20.  * 3. The end-user documentation included with the redistribution,
  21.  *    if any, must include the following acknowledgment:
  22.  *       "This product includes software developed by the
  23.  *        Apache Software Foundation (http://www.apache.org/)."
  24.  *    Alternately, this acknowledgment may appear in the software itself,
  25.  *    if and wherever such third-party acknowledgments normally appear.
  26.  *
  27.  * 4. The names "Apache" and "Apache Software Foundation" must
  28.  *    not be used to endorse or promote products derived from this
  29.  *    software without prior written permission. For written
  30.  *    permission, please contact apache@apache.org.
  31.  *
  32.  * 5. Products derived from this software may not be called "Apache",
  33.  *    nor may "Apache" appear in their name, without prior written
  34.  *    permission of the Apache Software Foundation.
  35.  *
  36.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  37.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  38.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  40.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  41.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  42.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  43.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  44.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  45.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  46.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  47.  * SUCH DAMAGE.
  48.  * ====================================================================
  49.  *
  50.  * This software consists of voluntary contributions made by many
  51.  * individuals on behalf of the Apache Software Foundation.  For more
  52.  * information on the Apache Software Foundation, please see
  53.  * <http://www.apache.org/>.
  54.  */ -->
  55. <!DOCTYPE xsl:stylesheet [
  56.     <!ENTITY lf SYSTEM "../xsl/util/lf.xml">
  57. ]>
  58. <xsl:stylesheet version="1.0"
  59.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  60.                   xmlns="">
  61.  
  62. <!-- create nodeset for referencing later                                 -->
  63. <xsl:variable name="htmlhelp.def" select="document('')/xsl:stylesheet
  64.                                         /xsl:template[@name='htmlhelp.def']" />
  65.  
  66. <!-- ==================================================================== -->
  67. <!-- <sitemap>                                                            -->
  68. <!-- Create CHM project file from sitemap                                 -->
  69. <!-- The file is an *.ini format text file                                -->
  70. <!-- ==================================================================== -->
  71. <xsl:template match="/sitemap">
  72.  
  73. <!-- static information                                               -->
  74. <!-- **************************************************************** -->
  75. <xsl:text>[OPTIONS]</xsl:text>&lf;
  76. <xsl:text>Binary TOC=No</xsl:text>&lf;
  77. <xsl:text>Compatibility=1.0</xsl:text>&lf;
  78.  
  79. <!-- resulting filename -->
  80. <xsl:text>Compiled file=..\manual.</xsl:text>
  81. <xsl:value-of select="$messages/@lang" />
  82. <xsl:text>.chm</xsl:text>&lf;
  83.  
  84. <xsl:text>Contents file=toc.hhc</xsl:text>&lf;
  85. <xsl:text>Default Window=Main</xsl:text>&lf;
  86. <xsl:text>Default topic=index.html</xsl:text>&lf;
  87.  
  88. <!-- compiler related -->
  89. <xsl:text>Display compile progress=Yes</xsl:text>&lf;
  90. <xsl:text>Enhanced decompilation=Yes</xsl:text>&lf;
  91.  
  92. <!-- search related -->
  93. <xsl:text>Full-text search=Yes</xsl:text>&lf;
  94. <xsl:text>Language=</xsl:text>
  95. <xsl:value-of select="$hhp-lang" />&lf;
  96.  
  97. <!-- title of the help file -->
  98. <xsl:text>Title=</xsl:text>
  99. <xsl:value-of select="$messages/message[@name='apachehttpserver']"/>&lf;&lf;
  100.  
  101. <!-- main window definition -->
  102. <xsl:text>[WINDOWS]</xsl:text>&lf;
  103. <xsl:text>Main=</xsl:text>
  104.  
  105. <!-- title -->
  106. <xsl:text>"</xsl:text>
  107. <xsl:value-of select="$messages/message[@name='apachehttpserver']"/>
  108. <xsl:text>",</xsl:text>
  109.  
  110. <!-- toc file -->
  111. <xsl:text>"toc.hhc",</xsl:text>
  112.  
  113. <!-- index file (currently none) -->
  114. <xsl:text>,</xsl:text>
  115.  
  116. <!-- default file (startup) -->
  117. <xsl:text>"index.html",</xsl:text>
  118.  
  119. <!-- Home button file -->
  120. <xsl:text>"index.html",</xsl:text>
  121.  
  122. <!-- Jump 1 url, text -->
  123. <xsl:text>,,</xsl:text>
  124.  
  125. <!-- Jump 2 url, text -->
  126. <xsl:text>,,</xsl:text>
  127.  
  128. <!-- navigation pane style (0x1e357e) -->
  129. <xsl:call-template name="helper.number2hex">
  130.     <xsl:with-param name="number" select="sum($htmlhelp.def/navigation/style
  131.                                               [@selected='yes'])" />
  132. </xsl:call-template>
  133. <xsl:text>,</xsl:text>
  134.  
  135. <!-- navigation pane initial width (px) -->
  136. <xsl:text>180,</xsl:text>
  137.  
  138. <!-- button mask -->
  139. <xsl:call-template name="helper.number2hex">
  140.     <xsl:with-param name="number" select="sum($htmlhelp.def/buttons/button
  141.                                               [@visible='yes'])" />
  142. </xsl:call-template>
  143. <xsl:text>,</xsl:text>
  144.  
  145. <!-- Initial Position [Left, Top, Right, Bottom] -->
  146. <xsl:text>[0,0,600,380],</xsl:text>
  147.  
  148. <!-- window style -->
  149. <xsl:call-template name="helper.number2hex">
  150.     <xsl:with-param name="result" select="'0000'" /> <!-- << 16 -->
  151.     <xsl:with-param name="number" select="sum($htmlhelp.def/windowstyle/style
  152.                                               [@selected='yes'])" />
  153. </xsl:call-template>
  154. <xsl:text>,</xsl:text>
  155.  
  156. <!-- extended style -->
  157. <xsl:text>,</xsl:text>
  158.  
  159. <!-- flag: navigation pane initial closed (=1) -->
  160. <xsl:text>,</xsl:text>
  161.  
  162. <!-- unknown, default pane, unknown, unknown -->
  163. <xsl:text>,,,0</xsl:text>&lf;&lf;
  164.  
  165. <!-- file list                                                        -->
  166. <!-- **************************************************************** -->
  167. <xsl:text>[FILES]</xsl:text>&lf;
  168.  
  169. <!-- not automatically sucked in. (because only @import()ed) -->
  170. <xsl:text>style\css\manual.css</xsl:text>&lf;
  171. <xsl:text>style\css\manual-loose-100pc.css</xsl:text>&lf;
  172.  
  173. <!-- include project file itself for easier recompiling -->
  174. <xsl:text>manual.hhp</xsl:text>&lf;
  175.  
  176. <!-- and now all sitemap-listed files -->
  177. <xsl:for-each select="category">
  178.     <xsl:apply-templates select="page[@href]" />
  179.     <xsl:apply-templates select="modulefilelist/modulefile"/>
  180. </xsl:for-each>&lf;
  181. </xsl:template>
  182. <!-- /sitemap -->
  183.  
  184.  
  185. <!-- ==================================================================== -->
  186. <!-- files referenced in sitemap                                          -->
  187. <!-- ==================================================================== -->
  188. <xsl:template match="category/page">
  189. <xsl:call-template name="helper.back-slash">
  190.     <xsl:with-param name="file">
  191.         <xsl:choose>
  192.         <xsl:when test="contains(@href, '#') and substring(@href,
  193.                         string-length(substring-before(@href, '#')), 1) = '/'">
  194.             <xsl:value-of select="substring-before(@href, '#')" />
  195.             <xsl:text>index.html</xsl:text>
  196.         </xsl:when>
  197.         <xsl:when test="substring(@href, string-length(@href), 1) = '/'">
  198.             <xsl:value-of select="@href"/>
  199.             <xsl:text>index.html</xsl:text>
  200.         </xsl:when>
  201.         <xsl:otherwise>
  202.             <xsl:value-of select="@href"/>
  203.         </xsl:otherwise>
  204.         </xsl:choose>
  205.     </xsl:with-param>
  206. </xsl:call-template>&lf;
  207. </xsl:template>
  208. <!-- /page[@href] -->
  209.  
  210.  
  211. <!-- ==================================================================== -->
  212. <!-- list module files                                                    -->
  213. <!-- ==================================================================== -->
  214. <xsl:template match="category/modulefilelist/modulefile">
  215. <xsl:text>mod\</xsl:text>
  216. <xsl:value-of select="substring-before(normalize-space(.), '.xml')" />
  217. <xsl:text>.html</xsl:text>&lf;
  218. </xsl:template>
  219. <!-- /modulefilelist/modulefile -->
  220.  
  221.  
  222. <!-- ==================================================================== -->
  223. <!-- turn slashes back                                                    -->
  224. <!-- ==================================================================== -->
  225. <xsl:template name="helper.back-slash">
  226. <xsl:param name="file" />
  227.  
  228. <xsl:choose>
  229. <xsl:when test="contains($file, '/')">
  230.     <xsl:value-of select="substring-before($file, '/')" />
  231.     <xsl:text>\</xsl:text>
  232.  
  233.     <xsl:call-template name="helper.back-slash">
  234.         <xsl:with-param name="file" select="substring-after($file, '/')" />
  235.     </xsl:call-template>
  236. </xsl:when>
  237. <xsl:otherwise>
  238.     <xsl:value-of select="$file" />
  239. </xsl:otherwise>
  240. </xsl:choose>
  241. </xsl:template>
  242. <!-- /helper.back-slash -->
  243.  
  244.  
  245. <!-- ==================================================================== -->
  246. <!-- convert number to its hexadecimal representation.                    -->
  247. <!-- I could not find a built-in function, so write our own ... *sigh*    -->
  248. <!-- ==================================================================== -->
  249. <xsl:template name="helper.number2hex">
  250. <xsl:param name="number" />
  251. <xsl:param name="result" />
  252.  
  253. <xsl:choose>
  254. <xsl:when test="number($number) > 0">
  255.     <xsl:call-template name="helper.number2hex">
  256.         <xsl:with-param name="number" select="floor(number($number) div 16)" />
  257.         <xsl:with-param name="result"
  258.             select="concat(substring('0123456789abcdef',
  259.                                      (number($number) mod 16) + 1, 1),
  260.                            $result)" />
  261.     </xsl:call-template>
  262. </xsl:when>
  263. <xsl:otherwise>
  264.     <!-- if zero, don't print anything. hh.exe (the viewer) seems to -->
  265.     <!-- prefer an empty value -->
  266.     <xsl:if test="string-length(translate($result, '0', '')) > 0">
  267.         <xsl:text>0x</xsl:text>
  268.         <xsl:value-of select="$result" />
  269.     </xsl:if>
  270. </xsl:otherwise>
  271. </xsl:choose>
  272. </xsl:template>
  273. <!-- /helper.number2hex -->
  274.  
  275.  
  276. <!-- ==================================================================== -->
  277. <!-- some of the values are derived from htmlhelp.h                       -->
  278. <!-- do NOT call this template, it's referenced automagically via         -->
  279. <!-- document() function and acts as simple data container.               -->
  280. <!--                                                                      -->
  281. <!-- Hints: 'ni' means 'not implemented' (by the help viewer)             -->
  282. <!--        'ns' means 'not useful for standalone help file'              -->
  283. <!-- ==================================================================== -->
  284. <xsl:template name="htmlhelp.def">
  285. <navigation>
  286.     <style               >        1</style> <!-- auto hide nav. pane   <<  0 -->
  287.     <style               >        2</style> <!-- ns: topmost window    <<  1 -->
  288.     <style               >        4</style> <!-- ns: no title bar      <<  2 -->
  289.     <style               >        8</style> <!-- ns: no win. style     <<  3 -->
  290.     <style               >       16</style> <!-- ns: no ext. style     <<  4 -->
  291.     <style selected="yes">       32</style> <!-- use tri-pane win.     <<  5 -->
  292.     <style               >       64</style> <!-- no toolbar text       <<  6 -->
  293.     <style               >      128</style> <!-- ns: send WM_QUIT      <<  7 -->
  294.     <style selected="yes">      256</style> <!-- toc auto sync         <<  8 -->
  295.     <style               >      512</style> <!-- ns: send track. not.  <<  9 -->
  296.     <style selected="yes">     1024</style> <!-- search tab            << 10 -->
  297.     <style               >     2048</style> <!-- ni(?): history tab    << 11 -->
  298.     <style selected="yes">     4096</style> <!-- favorites tab         << 12 -->
  299.     <style               >     8192</style> <!-- ni(?): title sync     << 13 -->
  300.     <style               >    16384</style> <!-- nav. only             << 14 -->
  301.     <style               >    32768</style> <!-- no toolbar            << 15 -->
  302.     <style selected="yes">    65536</style> <!-- show menu             << 16 -->
  303.     <style selected="yes">   131072</style> <!-- advanced search       << 17 -->
  304.     <style selected="yes">   262144</style> <!-- safe user's win. size << 18 -->
  305.     <style               >   524288</style> <!-- custom tab 1          << 19 -->
  306.     <style               >  1048576</style> <!-- custom tab 2          << 20 -->
  307.     <style               >  2097152</style> <!-- custom tab 3          << 21 -->
  308.     <style               >  4194304</style> <!-- custom tab 4          << 22 -->
  309.     <style               >  8388608</style> <!-- custom tab 5          << 23 -->
  310.     <style               > 16777216</style> <!-- custom tab 6          << 24 -->
  311.     <style               > 33554432</style> <!-- custom tab 7          << 25 -->
  312.     <style               > 67108864</style> <!-- custom tab 8          << 26 -->
  313.     <style               >134217728</style> <!-- custom tab 9          << 27 -->
  314.     <style               >268435456</style> <!-- window has margin (?) << 28 -->
  315. </navigation>
  316.  
  317. <buttons>
  318.     <button visible="yes">      2</button> <!-- expand/contract   <<  1 -->
  319.     <button visible="yes">      4</button> <!-- back              <<  2 -->
  320.     <button visible="yes">      8</button> <!-- forward           <<  3 -->
  321.     <button visible="yes">     16</button> <!-- Stop              <<  4 -->
  322.     <button              >     32</button> <!-- Refresh           <<  5 -->
  323.     <button visible="yes">     64</button> <!-- Home              <<  6 -->
  324.     <button              >    128</button> <!-- ni: browse fwd    <<  7 -->
  325.     <button              >    256</button> <!-- ni: browse back   <<  8 -->
  326.     <button              >    512</button> <!-- ni: notes         <<  9 -->
  327.     <button              >   1024</button> <!-- ni: contents      << 10 -->
  328.     <button visible="yes">   2048</button> <!-- Sync TOC          << 11 -->
  329.     <button visible="yes">   4096</button> <!-- Options           << 12 -->
  330.     <button visible="yes">   8192</button> <!-- Print             << 13 -->
  331.     <button              >  16384</button> <!-- ni: index         << 14 -->
  332.     <button              >  32768</button> <!-- ni: search        << 15 -->
  333.     <button              >  65536</button> <!-- ni: history       << 16 -->
  334.     <button              > 131072</button> <!-- ni: favorites     << 17 -->
  335.     <button              > 262144</button> <!-- Jump 1            << 18 -->
  336.     <button              > 524288</button> <!-- Jump 2            << 19 -->
  337.     <button visible="yes">1048576</button> <!-- (Font) Zoom       << 20 -->
  338.     <!-- the following work only with binary toc, which unfortunately   -->
  339.     <!-- seems to eat the different icons ...                           -->
  340.     <button              >2097152</button> <!-- TOC next          << 21 -->
  341.     <button              >4194304</button> <!-- TOC prev          << 22 -->
  342. </buttons>
  343.  
  344. <windowstyle>
  345.     <!-- all the stuff is additionally shifted << 16 (by the caller) -->
  346.     <style selected="yes">    1</style> <!-- maximize box     <<  0 -->
  347.     <style selected="yes">    2</style> <!-- minimize box     <<  1 -->
  348.     <style selected="yes">    4</style> <!-- thick frame      <<  2 -->
  349.     <style selected="yes">    8</style> <!-- system menu      <<  3 -->
  350.     <style               >   16</style> <!-- horiz. scroll    <<  4 -->
  351.     <style               >   32</style> <!-- vertic. scroll   <<  5 -->
  352.     <style selected="yes">   64</style> <!-- dialog frame     <<  6 -->
  353.     <style selected="yes">  128</style> <!-- border           <<  7 -->
  354.     <style selected="yes">  256</style> <!-- maximize         <<  8 -->
  355.     <style               >  512</style> <!-- clip child win.  <<  9 -->
  356.     <style               > 1024</style> <!-- clip sibl. win.  << 10 -->
  357.     <style               > 2048</style> <!-- disabled         << 11 -->
  358.     <style selected="yes"> 4096</style> <!-- visible          << 12 -->
  359.     <style selected="yes"> 8192</style> <!-- minimize         << 13 -->
  360.     <style               >16384</style> <!-- child window     << 14 -->
  361.     <style               >32768</style> <!-- pop-up           << 15 -->
  362. </windowstyle>
  363. </xsl:template>
  364. <!-- /htmlhelp.def -->
  365.  
  366. </xsl:stylesheet>
  367.