HtmlHelp

Miloslav Hertl [GISoft] Hertl na gisoft.cz
Pátek Říjen 24 13:24:13 CEST 2003


Děkuji za rady.
Bohužel mi vše nefunguje. Vložil jsem template do svého
mh_profile-htmlhelp.xsl 
a od té chvíle se z XML nevygeneruje žádný Html soubor. (Mezi generováním je

nutné vymazat dříve vygenerované Html, jinak se nic nepozná.)
To stejné (vložil jsem template) jsem udělal pro odpověď 
http://www.linux.cz/lists/archive/docbook/650.html
a uspěl jsem. Dělám něco špatně? Moje XSL a JS je na konci zprávy
Děkuji za odpověď
M.Hertl

>> 1) Mohl by nekdo poradit jak zajistit aby se obsah, ktery se vzdy
generuje
>> od pocatku strany (pro chapter i sections), presunul na konec? Tj. napr.
aby
>> text kapitoly pripadne sekce  byl vlozen pred obsah. Zaroven bych
potreboval
>> pred obsah vlozit oddeleni od predchazejiciho textu napr. <hr/>.
>
>Musíte upravit odpovídající šablonu. Napo. pro kapitolu z puvodní:
>
><xsl:template match="chapter">
>...
>
>udělejte:
>
><xsl:template match="chapter">
>   <div class="{name(.)}">
>     <xsl:call-template name="language.attribute"/>
>     <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:apply-templates/>
>     <xsl:call-template name="process.footnotes"/>
>     <hr/>
>     <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:if>
>   </div>
></xsl:template>


============================================================================
=========
mh_profile-htmlhelp.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
                xmlns:exsl="http://exslt.org/common"
                xmlns:set="http://exslt.org/sets"
	
version="1.0"
                exclude-result-prefixes="doc exsl set">

<!-- ********************************************************************
     $Id: profile-htmlhelp.xsl,v 1.1 2002/06/12 13:21:54 kosek Exp $
     ********************************************************************

     This file is used by htmlhelp.xsl if you want to generate source
     files for HTML Help.  It is based on the XSL DocBook Stylesheet
     distribution (especially on JavaHelp code) from Norman Walsh.

     ********************************************************************
-->

<xsl:import href="../html/chunk.xsl"/>
<xsl:include href="profile-htmlhelp-common.xsl"/>

<!--
##########################################################################
-->
<!--
##########################################################################
-->
<!--
##########################################################################
-->
<xsl:template name="body.attributes">
<!--  <xsl:attribute name="oncontextmenu">return false</xsl:attribute>
      <xsl:attribute name="ondragstart">return false</xsl:attribute>
      <xsl:attribute name="onselectstart">return false</xsl:attribute> -->
  <xsl:attribute name="scroll">no</xsl:attribute>
</xsl:template>

<!--
##########################################################################
-->
<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 $up != $home
                                        and $navig.showtitles != 0)
                                    or count($next) > 0"/>
  <xsl:variable name="row3" select="($prev and $navig.showtitles != 0)
                                    or ($home != . 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.header.navigation =
'0'">
    <div class="navheader" id="nsr">
      <xsl:if test="$row1 or $row2">
        <table width="100%" summary="Navigation header">
          <xsl:if test="$row1">
            <tr>
              <th colspan="3" align="center" class="nav1">
                <xsl:apply-templates select="." mode="object.title.markup"/>
              </th>
            </tr>
          </xsl:if>

          <xsl:if test="$row2">
            <tr>
              <td width="20%" align="left">
                <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" class="nav2">
                <xsl:choose>
                  <xsl:when test="count($up) > 0
                                  and $up != $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="right">
                <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="$row3">
          <table width="100%" summary="Navigation chapter names">
            <tr>
            <td width="40%" align="left" 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="count($up)>0">
                  <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="right" 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>
           </table>
         </xsl:if>


        </table>
      </xsl:if>
      <xsl:if test="$header.rule != 0">
        <hr/>
      </xsl:if>
    </div>

    <xsl:text disable-output-escaping="yes">
    <div id="mainbody">
    </xsl:text>
  </xsl:if>
</xsl:template>

<!--
##########################################################################
-->
<xsl:template name="user.head.content">
  <xsl:param name="node" select="."/>
  <link rel="stylesheet" media="screen" type="text/css"
href="./images/nsr_screen.css"/>
  <link rel="stylesheet" media="print" type="text/css"
href="./images/nsr_print.css"/>
  <script type="text/javascript" language="JavaScript"
src="./images/nsr.js"></script>
</xsl:template>

<!--
##########################################################################
-->
<xsl:template name="user.header.content">
<!--   <div id="mainbody"> -->
  <xsl:param name="node" select="."/>
</xsl:template>

<!--
##########################################################################
-->
<xsl:template name="user.footer.content">
  <xsl:param name="node" select="."/>
  <hr/>
  <p class="Copyright"> © Copyright 1999-<script type="text/javascript"

	language="javascript">Date=new
Date();document.write(Date.getYear());</script>
	 GISoft. Všechna práva vyhrazena.</p>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  <xsl:text disable-output-escaping="yes"></div>
  </xsl:text>
</xsl:template>

<!--
##########################################################################
-->
<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:template>

<!--
##########################################################################
-->
<xsl:template match="chapter|appendix" mode="insert.title.markup">
   <xsl:param name="purpose"/>
   <xsl:param name="xrefstyle"/>
   <xsl:param name="title"/>

   <xsl:choose>
     <xsl:when test="$purpose = 'xref'">
         <xsl:copy-of select="$title"/>
     </xsl:when>
     <xsl:otherwise>
       <xsl:copy-of select="$title"/>
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<!--
##########################################################################
-->

<!--
##########################################################################
-->


<!--
##########################################################################
-->
<!--
##########################################################################
-->
<!--
##########################################################################
-->

<xsl:param name="css.decoration" select="1"></xsl:param>
<xsl:param name="html.stylesheet">./images/styles.css</xsl:param>

<xsl:param name="chapter.autolabel" select="0"></xsl:param>

<xsl:param name="default.encoding" select="'windows-1250'"></xsl:param>
<xsl:param name="chunker.output.encoding"
select="'windows-1250'"></xsl:param>
<xsl:param name="htmlhelp.encoding" select="'windows-1250'"></xsl:param>
<xsl:param name="saxon.character.representation"
select="'native'"></xsl:param>

<xsl:param name="chunker.output.indent" select="'yes'"></xsl:param>
<xsl:param name="chunk.first.sections" select="1"></xsl:param>
<xsl:param name="chunk.section.depth" select="5"></xsl:param>

<xsl:param name="toc.max.depth">8</xsl:param>
<xsl:param name="toc.section.depth">0</xsl:param>
<xsl:param name="generate.section.toc.level" select="8"></xsl:param>
<xsl:param name="bridgehead.in.toc" select="0"></xsl:param> <!-- zaclen do
TOC bridgehead -->

<xsl:param name="html.cellpadding" select="'4'"></xsl:param>
<xsl:param name="cellpadding" select="'4'"></xsl:param>

<xsl:param name="qanda.defaultlabel">nonumber</xsl:param>
<xsl:param name="qanda.inherit.numeration" select="0"></xsl:param>

<xsl:param name="navig.graphics" select="0"></xsl:param>
<xsl:param name="navig.showtitles" select="1"></xsl:param>
<xsl:param name="suppress.footer.navigation">1</xsl:param>
<xsl:param name="suppress.header.navigation">0</xsl:param>
<xsl:param name="suppress.navigation" select="0"></xsl:param>
<xsl:param name="admon.graphics" select="1"></xsl:param>
<xsl:param name="admon.graphics.path">./images/</xsl:param>
<xsl:param name="admon.textlabel" select="0"></xsl:param>


<!-- Tlacitko pro skok na domovskou stranku -->
<xsl:param name="htmlhelp.button.home">1</xsl:param>
<xsl:param name="htmlhelp.button.home.url">http://www.gisoft.cz</xsl:param>

<xsl:param name="htmlhelp.button.zoom" select="1"></xsl:param>
<xsl:param name="htmlhelp.chm"
select="'HtmlHelpOutputName.chm'"></xsl:param>
<xsl:param name="htmlhelp.button.next" select="0"></xsl:param>
<xsl:param name="htmlhelp.button.prev" select="0"></xsl:param>
<xsl:param name="htmlhelp.hhc.section.depth" select="5"></xsl:param>
<xsl:param name="htmlhelp.button.options" select="0"></xsl:param>
<xsl:param name="htmlhelp.show.advanced.search" select="1"></xsl:param>
<xsl:param name="table.borders.with.css" select="1"></xsl:param>
<xsl:param name="base.dir" select="'.\_htmlH\'"/>
<xsl:param name="use.id.as.filename" select="1"></xsl:param>
<xsl:param name="htmlhelp.use.hhk" select="1"></xsl:param>
<xsl:param name="htmlhelp.hhc.show.root" select="0"></xsl:param>

<xsl:param name="admon.style">
  <xsl:text>margin-left: 0 cm; margin-right: 0cm;</xsl:text>
</xsl:param>

</xsl:stylesheet>

=========================================================
nsr.js
window.onload= resizeSplitWndw;
window.onresize= resizeSplitWndw;
window.onbeforeprint= set_to_print;
window.onafterprint= reset_form;

function resizeSplitWndw(){

var onsr= document.all.item("nsr");
var omainbody= document.all.item("mainbody");

if (omainbody ==null) return;
if (onsr != null){
document.all.mainbody.style.overflow= "auto";
document.all.nsr.style.width= document.body.offsetWidth;
document.all.mainbody.style.width= document.body.offsetWidth-4;
document.all.mainbody.style.top= document.all.nsr.offsetHeight;
if (document.body.offsetHeight > document.all.nsr.offsetHeight)
document.all.mainbody.style.height= document.body.offsetHeight -
document.all.nsr.offsetHeight;
else document.all.mainbody.style.height=0;
}
}

function set_to_print(){

var i;
if (window.mainbody)document.all.mainbody.style.height = "auto";

for (i=0; i < document.all.length; i++){
if (document.all[i].tagName == "BODY") {
document.all[i].scroll = "auto";
}
if (document.all[i].tagName == "A") {
document.all[i].outerHTML = "<a href=''>" + document.all[i].innerHTML +
"</a>";
}
}
}

function reset_form(){

document.location.reload();
}


Další informace o konferenci Docbook