home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2004 June / VPR0406.ISO / STARSUITE7 / EVALUATION / windows / office7 / f_0306 / main_transform.xsl
Extensible Markup Language  |  2004-01-15  |  48KB  |  1,181 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!--
  4.    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5.    | This is the transformation style sheet for Help files            |
  6.    | (main_tranform.xsl).                                             |
  7.    |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  8.    | Copyright ツゥ 2002 Sun Microsystems, Inc. All rights reserved.     |
  9.    | Use of this product is subject to license terms.                 |
  10.    |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  11.    | FPE                                                              |
  12.    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  13.    | You should not edit this file unless you know what you're doing! |
  14.    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  15.    | Revision History                                                 |
  16.    | ================                                                 |
  17.    |                                                                  |
  18.    |  27-Jul-01: Evaluation of $Program replaced by declaration       |
  19.    |             of $Prog for the same purpose                        |
  20.    |  09-Aug-01: Added evaluation of th in "How to get"-popups.       | 
  21.    |             Changed evaluation of icon/name tables within that.  |
  22.    |  09-Aug-01: Added special formatting of "Related" header         |
  23.    |             (styleclass "reltop")                                |
  24.    |  09-Aug-01: Added variable for column width of first columns of  |
  25.    |             tables with icons                                    |
  26.    |  14-Aug-01: Fixed Bug: Switches were not evaluated in document   |
  27.    |             title h1                                             |
  28.    |  14-Aug-01: Fixed Bug: System switches were falsely evaluated.   |
  29.    |             Changed the way of switch evaluation, now using modes|
  30.    |  17-AUG-01: Fixed Bug: switch as direct child of embedded were   |
  31.    |             not evaluated                                        |
  32.    |  22-Aug-01: Fixed: Axis PRECEDING no longer used (wasn't         |
  33.    |             supported by processor)                              |
  34.    |  22-Aug-01: Now empty Howtoget links are ignored                 |
  35.    |  27-Aug-01: Now the image size is evaluated (from cm to pixels)  |
  36.    |             and included in the img tags.                        |
  37.    |  28-Aug-01: Embedded Paras now check for a <p> ancestor          |
  38.    |             instead of a parent.                                 |
  39.    |  30-Aug-01: Added recursive evaluation of embedded text          |
  40.    |  02-Oct-01: ABI: Added parameter cs for use in css url           |
  41.    |  10-Oct-01: Added handling for text:tab-stop and text:s          |
  42.    |  10-Oct-01: Added handling for source file admin information     |
  43.    |  15-Oct-01: Fixed Bug: fix URL vnd.sun.star.help for internal URL| 
  44.    |             calls (embedded + popup-cut), $sm for external calls |
  45.    |  19-Oct-01: Added handling of product variable parameters        |
  46.    |  25-Oct-01: Removed insertion of hr before h2                    |
  47.    |  25-Oct-01: Added language handling                              |
  48.    |  15-Nov-01: Fixed Bug: embedded productname tags were not        |
  49.    |             replaced                                             |
  50.    |  15-Nov-01: Fixed Bug: embedde ol/ul were not evaluated due      |
  51.    |             to a typo                                            |
  52.    |  10-Dec-01: Changed transcription of "Head"s. Now they are       |
  53.    |             transformed to <h>s                                  |
  54.    |  10-Dec-01: Added OOo-switch for Product                         |
  55.    |  26-Mar-02: Added autosetting of name for hyperlink tags         |
  56.    |             (Accessibility issue)                                |
  57.    |  16-May-02: Fixed autonaming of links                            |
  58.    |  16-May-02: Added alt tag for images                             |
  59.    |  16-May-02: Changed size calculation for images                  |
  60.    |  27-Jun-02: Fixed bug, no evaluation of switches inside certain  |
  61.    |             popups                                               |
  62.    |  11-Oct-02: For accessibility reasons: Removed formatting topic  |
  63.    |             title inside table                                   |
  64.    |  27-Jan-03: Fixed bug for PRODUCT switch                         |
  65.    |  27-Jan-03: Added <help:paragraphinfo/> template                 |
  66.    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  67. //-->
  68.  
  69. <xsl:stylesheet version="1.0" 
  70.   xmlns:nu="http://www.jclark.com/xt/java/com.sun.xmlsearch.tree.NodeUtils" 
  71.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  72.   xmlns:office="http://openoffice.org/2000/office" 
  73.   xmlns:style="http://openoffice.org/2000/style"  
  74.   xmlns:text="http://openoffice.org/2000/text"  
  75.   xmlns:table="http://openoffice.org/2000/table"  
  76.   xmlns:draw="http://openoffice.org/2000/drawing" 
  77.   xmlns:fo="http://www.w3.org/1999/XSL/Format"  
  78.   xmlns:xlink="http://www.w3.org/1999/xlink" 
  79.   xmlns:dc="http://purl.org/dc/elements/1.1/"   
  80.   xmlns:meta="http://openoffice.org/2000/meta" 
  81.   xmlns:number="http://openoffice.org/2000/datastyle" 
  82.   xmlns:svg="http://www.w3.org/2000/svg" 
  83.   xmlns:chart="http://openoffice.org/2000/chart" 
  84.   xmlns:help="http://openoffice.org/2000/help">
  85.   
  86.   <!-- Generate html code -->
  87.   <xsl:output method="html"/>
  88.   
  89.   <!-- 
  90.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  91.   | STYLESHEET PARAMETER DEFINITION                                  |
  92.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  93.   | These are used to define the parameters handed over to the       |
  94.   | stylesheet processor. They are used to build the help URLs       |
  95.   | and for application and product/name evaluation.                 |
  96.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  97.   -->
  98.  
  99.     <!-- Unused parameter of mysterious origin ?-->
  100.   <xsl:param name="Device" select="'WARP'"/>
  101.   
  102.   <!-- Parameters used to construct the URL prefix -->
  103.   <xsl:param name="hp" select="''"/>
  104.   <xsl:param name="sm" select="'vnd.sun.star.help://'"/>
  105.   <xsl:param name="qm" select="'?'"/>
  106.   <xsl:param name="es" select="'='"/>
  107.   <xsl:param name="am" select="'&'"/>
  108.   <xsl:param name="cl" select="':'"/>
  109.   <xsl:param name="sl" select="'/'"/>
  110.   <xsl:param name="hm" select="'#'"/>
  111.   <xsl:param name="cs" select="''"/>
  112.   
  113.   <!-- Parameter used to identify the current application database -->
  114.   <xsl:param name="Database" select="'swriter'"/>
  115.  
  116.   <!-- Parameter used to identify the current language -->
  117.   <xsl:param name="Language" select="'de'"/>
  118.   
  119.   <!-- Parameter to identify the OS/platform used -->
  120.   <xsl:param name="System" select="'WIN'"/>
  121.  
  122.     <!-- Parameters used to output help error information -->
  123.   <xsl:param name="Id" select="'0000'"/>
  124.   <xsl:param name="Path" select="'Path'"/>
  125.  
  126.     <!-- Parameters used to assign product names -->
  127.   <xsl:param name="productname" select="'Office'"/>
  128.   <xsl:param name="productversion" select="''"/>
  129.   <xsl:param name="vendorname" select="'Webtop'"/>
  130.   <xsl:param name="vendorversion" select="''"/>
  131.   <xsl:param name="vendorshort" select="'Webtop'"/>
  132.   
  133.   <!-- 
  134.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  135.   | STYLESHEET VARIABLE DEFINITION                                   |
  136.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  137.   | These are used for repeated tasks in this stylesheet and only    |
  138.   | defined once here.                                               |
  139.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  140.   -->
  141.  
  142.   <!-- 
  143.         Variable to identify the application used for evaluation of program switches
  144.         This one is derived from the database name    
  145.     -->
  146.   <xsl:variable name="Program">
  147.     <xsl:choose>
  148.       <xsl:when test="$Database='swriter'">WRITER</xsl:when>
  149.       <xsl:when test="$Database='scalc'">CALC</xsl:when>
  150.       <xsl:when test="$Database='sdraw'">DRAW</xsl:when>
  151.       <xsl:when test="$Database='simpress'">IMPRESS</xsl:when>
  152.       <xsl:when test="$Database='sbasic'">BASIC</xsl:when>
  153.       <xsl:when test="$Database='smath'">MATH</xsl:when>
  154.       <xsl:when test="$Database='schart'">CHART</xsl:when>
  155.       <xsl:when test="$Database='portal'">PORTAL</xsl:when>
  156.       <xsl:otherwise>NONE</xsl:otherwise>
  157.     </xsl:choose>
  158.   </xsl:variable>
  159.   
  160.     <!-- 
  161.         Variable to define the language of the help document which may be different
  162.         from the one defined in the Language *parameter*! It is evaluated from a
  163.         meta tag in the xml source
  164.     -->
  165.   <xsl:variable name="lang">
  166.     <xsl:for-each select="/html/head/meta">
  167.       <xsl:if test="@name='language'">
  168.         <xsl:value-of select="@content"/>
  169.       </xsl:if>
  170.     </xsl:for-each>
  171.   </xsl:variable>
  172.   
  173.     <!-- Variables for formatting purposes. "onepixel" is the image number of a transparent 1-pixel image -->
  174.   <xsl:variable name="colwidth_1">25</xsl:variable>
  175.   <xsl:variable name="spacewidth">5</xsl:variable>
  176.   <xsl:variable name="tabwidth">15</xsl:variable>
  177.   <xsl:variable name="onepixel">67433</xsl:variable>
  178.  
  179.     <!-- Variable for distinguishing the Open Source distribution -->
  180.   <xsl:variable name="Prod">
  181.     <xsl:choose>
  182.       <xsl:when test="$productname='StarOffice'">Commercial</xsl:when>
  183.       <xsl:when test="$productname='StarSuite'">Commercial</xsl:when>
  184.       <xsl:when test="starts-with($productname,'AOL')">Commercial</xsl:when>
  185.       <xsl:otherwise>OpenSource</xsl:otherwise>
  186.     </xsl:choose>
  187.   </xsl:variable>
  188.  
  189.   <!-- 
  190.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  191.   | BASIC PROCESSING OF ELEMENTS                                     |
  192.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  193.   -->
  194.  
  195.   <!-- Copy through of all elements including their attributes -->
  196.   <xsl:template match="*|@*|comment()|processing-instruction()|text()">
  197.     <xsl:copy>
  198.       <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
  199.     </xsl:copy>
  200.   </xsl:template>
  201.  
  202.   <xsl:template match="help:*">
  203.     <xsl:element name="{name()}">
  204.       <xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
  205.     </xsl:element>
  206.   </xsl:template>
  207.  
  208.   <!-- The language of the document body is set here as an attribute of the body tag -->
  209.   <xsl:template match="body">
  210.     <xsl:element name="body">
  211.       <xsl:attribute name="lang"><xsl:value-of select="$lang"/></xsl:attribute>
  212.       <xsl:apply-templates/>
  213.     </xsl:element>
  214.   </xsl:template>
  215.  
  216.  
  217.   <!-- 
  218.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  219.   | PROCESSING OF SPECIFIC HELP ELEMENTS                             |
  220.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  221.   -->
  222.  
  223.   <xsl:template match="help:to-be-embedded">
  224.     <xsl:apply-templates/>
  225.   </xsl:template>
  226.   
  227.     <xsl:template match="help:to-popup">
  228.     <xsl:apply-templates/>
  229.   </xsl:template>
  230.   
  231.     <!-- Text for active help must only show in the content if set to visible -->
  232.   <xsl:template match="help:help-text">
  233.     <xsl:if test="@value='visible'">
  234.       <xsl:apply-templates/>
  235.     </xsl:if>
  236.   </xsl:template>
  237.  
  238.     <xsl:template match="help:paragraphinfo">
  239.     </xsl:template>
  240.  
  241.   <!-- 
  242.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  243.   | CONDITIONAL PROCESSING                                           |
  244.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  245.     | There are program, system and product switches throughout the    |
  246.     | help enabling or disabling content depending on their context    |
  247.     | which is described using the parameters/variables defined above. |
  248.     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  249.   -->
  250.  
  251.     <!-- Switches inside normal text -->
  252.   <xsl:template match="help:switch">
  253.     <xsl:choose>
  254.       <xsl:when test="@select='Program'">
  255.         <xsl:apply-templates mode="switch_prog"/>
  256.       </xsl:when>
  257.       <xsl:when test="@select='System'">
  258.         <xsl:apply-templates mode="switch_sys"/>
  259.       </xsl:when>
  260.       <xsl:when test="@select='Product'">
  261.         <xsl:apply-templates mode="switch_prod"/>
  262.       </xsl:when>
  263.       <xsl:when test="@select='PRODUCT'">
  264.         <xsl:apply-templates mode="switch_prod"/>
  265.       </xsl:when>
  266.     </xsl:choose>
  267.   </xsl:template>
  268.  
  269.     <!-- Switches inside popups -->
  270.   <xsl:template match="help:switch" mode="popup">
  271.     <xsl:choose>
  272.       <xsl:when test="@select='Program'">
  273.         <xsl:apply-templates mode="switch_prog"/>
  274.       </xsl:when>
  275.       <xsl:when test="@select='System'">
  276.         <xsl:apply-templates mode="switch_sys"/>
  277.       </xsl:when>
  278.       <xsl:when test="@select='Product'">
  279.         <xsl:apply-templates mode="switch_prod"/>
  280.       </xsl:when>
  281.     </xsl:choose>
  282.   </xsl:template>
  283.  
  284.  
  285.  
  286.     <!-- Switches inside text which is embedded from elsewhere -->
  287.   <xsl:template match="help:switch" mode="embedded">
  288.     <xsl:choose>
  289.       <xsl:when test="@select='Program'">
  290.         <xsl:apply-templates mode="switch_prog"/>
  291.       </xsl:when>
  292.       <xsl:when test="@select='System'">
  293.         <xsl:apply-templates mode="switch_sys"/>
  294.       </xsl:when>
  295.       <xsl:when test="@select='Product'">
  296.         <xsl:apply-templates mode="switch_prod"/>
  297.       </xsl:when>
  298.     </xsl:choose>
  299.   </xsl:template>
  300.  
  301.     
  302.   <xsl:template match="help:case" mode="switch_prog">
  303.     <xsl:if test="@select=$Program">
  304.       <xsl:apply-templates/>
  305.     </xsl:if>
  306.   </xsl:template>
  307.  
  308.     <xsl:template match="help:default" mode="switch_prog">
  309.     <xsl:if test="not(../help:case[@select=$Program])">
  310.       <xsl:apply-templates/>
  311.     </xsl:if>
  312.   </xsl:template>
  313.  
  314.   <xsl:template match="help:case" mode="switch_sys">
  315.     <xsl:if test="@select=$System">
  316.       <xsl:apply-templates/>
  317.     </xsl:if>
  318.   </xsl:template>
  319.  
  320.   <xsl:template match="help:default" mode="switch_sys">
  321.     <xsl:if test="not(../help:case[@select=$System])">
  322.       <xsl:apply-templates/>
  323.     </xsl:if>
  324.   </xsl:template>
  325.  
  326.   <xsl:template match="help:case" mode="switch_prod">
  327.     <xsl:if test="@select=$Prod">
  328.       <xsl:apply-templates/>
  329.     </xsl:if>
  330.   </xsl:template>
  331.  
  332.   <xsl:template match="help:default" mode="switch_prod">
  333.     <xsl:if test="not(../help:case[@select=$Prod])">
  334.       <xsl:apply-templates/>
  335.     </xsl:if>
  336.   </xsl:template>
  337.  
  338.     <!-- Switches inside the document title -->
  339.   <xsl:template match="help:switch" mode="doctitle">
  340.     <xsl:if test="@select='Program' or @select='System'">
  341.       <xsl:apply-templates mode="doctitle"/>
  342.     </xsl:if>
  343.   </xsl:template>
  344.   <xsl:template match="help:case" mode="doctitle">
  345.     <xsl:if test="@select=$Program or @select=$System">
  346.       <xsl:apply-templates mode="doctitle"/>
  347.     </xsl:if>
  348.   </xsl:template>
  349.   <xsl:template match="help:default" mode="doctitle">
  350.     <xsl:if test="../../help:switch[@select='System'] and not(../help:case[@select=$System])">
  351.       <xsl:apply-templates mode="doctitle"/>
  352.     </xsl:if>
  353.     <xsl:if test="../../help:switch[@select='Program'] and not(../help:case[@select=$Program])">
  354.       <xsl:apply-templates mode="doctitle"/>
  355.     </xsl:if>
  356.   </xsl:template>
  357.  
  358.   <!-- 
  359.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  360.   | PROCESSING OF PARAGRAPHS AND HEADINGS                            |
  361.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  362.   | This one is quite cascaded to take account of the different para |
  363.   | contexts. This includes headers as in the xml source files these |
  364.   | are only paragraphs with a special style class, viz "Head"       |
  365.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  366.   -->
  367.  
  368.     <!-- Normal Paragraphs --> 
  369.   <xsl:template match="p">
  370.  
  371.     <!-- Disregard empty paragraphs -->
  372.     <xsl:choose>
  373.       <xsl:when test=".='' and count(child::*)=0"/>
  374.       <xsl:otherwise>
  375.  
  376.         <!-- Process all headings -->
  377.         <xsl:choose>
  378.           <xsl:when test="substring(@class,1,4)='Head'">
  379.  
  380.             <!-- Head 1 should only be the document title at the top and is treated differently -->
  381.             <!-- removed table as formatting help -->
  382.             <xsl:choose>
  383.               <xsl:when test="@class='Head1'">
  384.                       <xsl:element name="h1">
  385.                         <xsl:apply-templates mode="doctitle"/>
  386.                       </xsl:element>
  387.                 <xsl:element name="br"/>
  388.               </xsl:when>
  389.  
  390.                         <!-- All other Heads are converted to HTML headings -->
  391.               <xsl:when test="@class='Head2'">
  392.                 <xsl:element name="h2">
  393.                   <xsl:apply-templates/>
  394.                 </xsl:element>
  395.               </xsl:when>
  396.  
  397.               <xsl:when test="@class='Head3'">
  398.                 <xsl:element name="h3">
  399.                   <xsl:apply-templates/>
  400.                 </xsl:element>
  401.               </xsl:when>
  402.  
  403.               <xsl:when test="@class='Head4'">
  404.                 <xsl:element name="h4">
  405.                   <xsl:apply-templates/>
  406.                 </xsl:element>
  407.               </xsl:when>
  408.  
  409.               <xsl:when test="@class='Head5'">
  410.                 <xsl:element name="h5">
  411.                   <xsl:apply-templates/>
  412.                 </xsl:element>
  413.               </xsl:when>
  414.  
  415.               <xsl:when test="@class='Head6'">
  416.                 <xsl:element name="h6">
  417.                   <xsl:apply-templates/>
  418.                 </xsl:element>
  419.               </xsl:when>
  420.  
  421.             </xsl:choose>
  422.  
  423.           </xsl:when>
  424.           
  425.                 <!-- 
  426.             All Non-Header paragraphs are converted into HTML p with corresponding style class assigned.
  427.             Valid style classes are Paragraph, ParaList, TextInTable, TableHead, PropText
  428.           -->
  429.  
  430.           <xsl:when test="@class='Paragraph' 
  431.                        or @class='ParaList' 
  432.                        or @class='TextInTable' 
  433.                        or @class='TableHead' 
  434.                        or @class='PropText'">
  435.             <xsl:element name="p">
  436.               <xsl:choose>
  437.                 <!-- By special request, turn the "Related Topics" header into an own style class -->
  438.                 <xsl:when test="child::help:embedded[@Eid='related']">
  439.                   <xsl:attribute name="class">reltop</xsl:attribute>
  440.                 </xsl:when>
  441.                 <xsl:otherwise>
  442.                   <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
  443.                 </xsl:otherwise>
  444.                 </xsl:choose>
  445.               <xsl:apply-templates/>
  446.             </xsl:element>
  447.           </xsl:when>
  448.  
  449.           <!-- all unknown paragraph styles are just converted into the standard "paragraph" style -->
  450.           <xsl:otherwise>
  451.             <xsl:element name="p">
  452.               <xsl:attribute name="class">Paragraph</xsl:attribute>
  453.               <xsl:apply-templates/>
  454.             </xsl:element>
  455.           </xsl:otherwise>
  456.  
  457.         </xsl:choose>
  458.  
  459.       </xsl:otherwise> <!-- non-empty paras-->
  460.     </xsl:choose>
  461.   </xsl:template>
  462.  
  463.   <!-- Paragraphs inside text which is embedded from somewhere else -->
  464.   <xsl:template match="p" mode="embedded">
  465.   
  466.     <!-- Disregard empty paragraphs -->
  467.     <xsl:choose>
  468.       <xsl:when test=".='' and count(child::*)=0"/>
  469.       <xsl:otherwise>
  470.         <xsl:choose>
  471.           
  472.           <xsl:when test="@class='Head1'">
  473.             <xsl:element name="h2">
  474.               <xsl:apply-templates/>
  475.             </xsl:element>
  476.           </xsl:when>
  477.           
  478.           <xsl:when test="@class='Head2'">
  479.             <xsl:element name="h2">
  480.               <xsl:apply-templates/>
  481.             </xsl:element>
  482.           </xsl:when>
  483.       
  484.           <xsl:when test="@class='Head3'">
  485.             <xsl:element name="h3">
  486.               <xsl:apply-templates/>
  487.             </xsl:element>
  488.           </xsl:when>
  489.           
  490.           <xsl:when test="@class='Head4'">
  491.             <xsl:element name="h4">
  492.               <xsl:apply-templates/>
  493.             </xsl:element>
  494.           </xsl:when>
  495.           
  496.           <xsl:when test="@class='Head5'">
  497.             <xsl:element name="h5">
  498.               <xsl:apply-templates/>
  499.             </xsl:element>
  500.           </xsl:when>
  501.           
  502.           <xsl:when test="@class='Head6'">
  503.             <xsl:element name="h6">
  504.               <xsl:apply-templates/>
  505.             </xsl:element>
  506.           </xsl:when>
  507.       
  508.               <!-- 
  509.             All Non-Header paragraphs are converted into HTML p with corresponding style class assigned.
  510.             Valid style classes are Paragraph, ParaList, TextInTable, TableHead, PropText
  511.           -->
  512.           
  513.           <xsl:when test="@class='Paragraph' 
  514.                        or @class='ParaList' 
  515.                        or @class='TextInTable' 
  516.                        or @class='TableHead' 
  517.                        or @class='PropText'">
  518.             <xsl:element name="p">
  519.               <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
  520.               <xsl:apply-templates/>
  521.             </xsl:element>
  522.           </xsl:when>
  523.         
  524.           <!-- all unknown paragraph styles are just converted into the standard "paragraph" style -->
  525.           <xsl:otherwise>
  526.             <xsl:element name="p">
  527.               <xsl:attribute name="class">Paragraph</xsl:attribute>
  528.               <xsl:apply-templates/>
  529.             </xsl:element>
  530.           </xsl:otherwise>
  531.     
  532.         </xsl:choose>
  533.       </xsl:otherwise> <!-- non-empty paragraphs -->
  534.     </xsl:choose>
  535.   </xsl:template>
  536.  
  537.   <!-- Paragraphs inside popup text (mainly the information of how to get a function) -->
  538.   <xsl:template match="p" mode="popup">
  539.     <xsl:if test="(. != '') or (count(child::*)>0)">
  540.       <xsl:element name="p">
  541.         <xsl:attribute name="class">howtogetpara</xsl:attribute>
  542.         <xsl:apply-templates/>
  543.       </xsl:element>
  544.     </xsl:if>
  545.   </xsl:template>
  546.  
  547.   <!-- 
  548.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  549.   | PROCESSING OF LISTS                                              |
  550.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  551.   -->
  552.  
  553.   <!-- Numbered lists in normal text -->
  554.   <xsl:template match="ol">
  555.     <xsl:element name="ol">    
  556.         <xsl:if test="@start">
  557.             <xsl:attribute name="start"><xsl:value-of select="@start"/></xsl:attribute>
  558.         </xsl:if>
  559.       <xsl:apply-templates/>
  560.     </xsl:element>
  561.   </xsl:template>
  562.   
  563.   <!-- Numbered lists in text embedded from somewhere else -->
  564.   <xsl:template match="ol" mode="embedded">
  565.     <xsl:element name="ol">
  566.         <xsl:if test="@start">
  567.             <xsl:attribute name="start"><xsl:value-of select="@start"/></xsl:attribute>
  568.         </xsl:if>
  569.       <xsl:apply-templates/>
  570.     </xsl:element>
  571.   </xsl:template>
  572.   
  573.   <!-- Bulleted lists in normal text -->
  574.   <xsl:template match="ul">
  575.     <xsl:element name="ul">
  576.       <xsl:apply-templates/>
  577.     </xsl:element>
  578.   </xsl:template>
  579.   
  580.   <!-- Bulleted lists in text embedded from somewhere else -->
  581.   <xsl:template match="ul" mode="embedded">
  582.     <xsl:element name="ul">
  583.       <xsl:apply-templates/>
  584.     </xsl:element>
  585.   </xsl:template>
  586.   
  587.   <!-- List items in any context -->
  588.   <xsl:template match="li">
  589.     <xsl:element name="li">
  590.       <xsl:apply-templates/>
  591.     </xsl:element>
  592.   </xsl:template>
  593.   
  594.   
  595.   <!-- 
  596.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  597.   | PROCESSING OF CHARACTER CLASSES                                  |
  598.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  599.   -->
  600.   
  601.   <!-- Process character formatting -->
  602.   <xsl:template match="span">
  603.     <!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
  604.     <xsl:choose>
  605.       <xsl:when test="substring(@class,1,7)='Tabelle'">
  606.         <xsl:apply-templates/>
  607.       </xsl:when>
  608.       <xsl:otherwise>
  609.         <!-- insert emphasized span -->
  610.         <xsl:element name="span">
  611.           <xsl:attribute name="class">emph</xsl:attribute>
  612.           <xsl:apply-templates/>
  613.         </xsl:element>
  614.       </xsl:otherwise>
  615.     </xsl:choose>
  616.   </xsl:template>
  617.   <xsl:template match="span" mode="embedded">
  618.     <!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
  619.     <xsl:choose>
  620.       <xsl:when test="substring(@class,1,7)='Tabelle'">
  621.         <xsl:apply-templates/>
  622.       </xsl:when>
  623.       <xsl:otherwise>
  624.         <!-- insert emphasized span -->
  625.         <xsl:element name="span">
  626.           <xsl:attribute name="class">emph</xsl:attribute>
  627.           <xsl:apply-templates/>
  628.         </xsl:element>
  629.       </xsl:otherwise>
  630.     </xsl:choose>
  631.   </xsl:template>
  632.   <xsl:template match="span" mode="popup">
  633.     <!-- Disregard spans with table automatic formats, starting with "Tabelle" -->
  634.     <xsl:choose>
  635.       <xsl:when test="substring(@class,1,7)='Tabelle'">
  636.         <xsl:apply-templates/>
  637.       </xsl:when>
  638.       <xsl:otherwise>
  639.         <!-- insert emphasized span -->
  640.         <xsl:element name="span">
  641.           <xsl:attribute name="class">emph</xsl:attribute>
  642.           <xsl:apply-templates/>
  643.         </xsl:element>
  644.       </xsl:otherwise>
  645.     </xsl:choose>
  646.   </xsl:template>
  647.   
  648.   <!-- 
  649.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  650.   | PROCESSING OF TABLES                                             |
  651.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  652.   -->
  653.   
  654.   <!-- Tables should be preceded and followed by a line break -->
  655.   <xsl:template match="table">
  656.     <xsl:element name="br"/>
  657.     <xsl:element name="table">
  658.       <xsl:if test="@border>0">
  659.         <xsl:attribute name="border">1</xsl:attribute>
  660.         <xsl:attribute name="class">tablebg</xsl:attribute>
  661.       </xsl:if>
  662.       <xsl:attribute name="cellspacing">0</xsl:attribute>
  663.       <xsl:attribute name="cellpadding">2</xsl:attribute>
  664.       <xsl:apply-templates/>
  665.     </xsl:element>
  666.     <xsl:element name="br"/>
  667.   </xsl:template>
  668.   <xsl:template match="table" mode="embedded">
  669.     <xsl:element name="br"/>
  670.     <xsl:element name="table">
  671.       <xsl:if test="@border>0">
  672.         <xsl:attribute name="border">1</xsl:attribute>
  673.         <xsl:attribute name="class">tablebg</xsl:attribute>
  674.       </xsl:if>
  675.       <xsl:attribute name="cellspacing">0</xsl:attribute>
  676.       <xsl:attribute name="cellpadding">2</xsl:attribute>
  677.       <xsl:apply-templates/>
  678.     </xsl:element>
  679.     <xsl:element name="br"/>
  680.   </xsl:template>
  681.   <xsl:template match="table" mode="popup">
  682.     <xsl:element name="table">
  683.       <xsl:attribute name="border">0</xsl:attribute>
  684.       <xsl:attribute name="cellspacing">0</xsl:attribute>
  685.       <xsl:attribute name="cellpadding">2</xsl:attribute>
  686.       <xsl:apply-templates mode="popup"/>
  687.     </xsl:element>
  688.   </xsl:template>
  689.   <xsl:template match="tr">
  690.     <xsl:element name="tr">
  691.       <xsl:apply-templates/>
  692.     </xsl:element>
  693.   </xsl:template>
  694.   <xsl:template match="tr" mode="popup">
  695.     <xsl:element name="tr">
  696.       <xsl:apply-templates mode="popup"/>
  697.     </xsl:element>
  698.   </xsl:template>
  699.   <xsl:template match="th">
  700.     <!-- no th for borderless tables - 24/07/01-->
  701.     <xsl:choose>
  702.       <xsl:when test="../../table[@border>0]">
  703.         <xsl:element name="th">
  704.           <xsl:attribute name="align">left</xsl:attribute>
  705.           <xsl:attribute name="valign">top</xsl:attribute>
  706.           <xsl:attribute name="class">tableheadbg</xsl:attribute>
  707.           <xsl:apply-templates/>
  708.         </xsl:element>
  709.       </xsl:when>
  710.       <xsl:otherwise>
  711.         <xsl:element name="td">
  712.           <xsl:attribute name="align">left</xsl:attribute>
  713.           <xsl:attribute name="valign">top</xsl:attribute>
  714.           <xsl:attribute name="class">tabledatabg</xsl:attribute>
  715.           <xsl:apply-templates/>
  716.         </xsl:element>
  717.       </xsl:otherwise>
  718.     </xsl:choose>
  719.   </xsl:template>
  720.   <xsl:template match="td" mode="popup">
  721.     <xsl:element name="td">
  722.       <xsl:if test="descendant::draw:image">
  723.         <xsl:attribute name="width"><xsl:value-of select="$colwidth_1"/></xsl:attribute>
  724.       </xsl:if>
  725.       <xsl:apply-templates mode="popup"/>
  726.     </xsl:element>
  727.   </xsl:template>
  728.   <xsl:template match="th" mode="popup">
  729.     <xsl:element name="td">
  730.       <xsl:if test="descendant::draw:image">
  731.         <xsl:attribute name="width"><xsl:value-of select="$colwidth_1"/></xsl:attribute>
  732.       </xsl:if>
  733.       <xsl:apply-templates mode="popup"/>
  734.     </xsl:element>
  735.   </xsl:template>
  736.   <xsl:template match="td">
  737.     <xsl:element name="td">
  738.       <xsl:attribute name="align">left</xsl:attribute>
  739.       <xsl:attribute name="valign">top</xsl:attribute>
  740.       <xsl:attribute name="class">tabledatabg</xsl:attribute>
  741.       <xsl:apply-templates/>
  742.     </xsl:element>
  743.   </xsl:template>
  744.   
  745.   <!-- 
  746.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  747.   | PROCESSING OF TEXT EMBEDDED FROM SOMEHWERE ELSE                  |
  748.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  749.   -->
  750.   
  751.   
  752.   <!-- Process embedded help text -->
  753.   <xsl:template match="help:embedded">
  754.     <xsl:variable name="Link" select="concat('vnd.sun.star.help://',$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
  755.     <xsl:variable name="EmbeddedDoc" select="document($Link)"/>
  756.     <xsl:variable name="Docpart" select="@Eid"/>
  757.     <xsl:choose>
  758.       <!-- prevent embedded paragraphs without p tag -->
  759.       <xsl:when test="not(ancestor::p)">
  760.         <xsl:element name="p">
  761.           <xsl:attribute name="class">Paragraph</xsl:attribute>
  762.           <xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
  763.         </xsl:element>
  764.       </xsl:when>
  765.       <xsl:otherwise>
  766.         <xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
  767.       </xsl:otherwise>
  768.     </xsl:choose>
  769.   </xsl:template>
  770.   <!-- Process embedded help text -->
  771.   <xsl:template match="help:embedded" mode="embedded">
  772.     <xsl:variable name="Link" select="concat($sm,$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
  773.     <xsl:variable name="EmbeddedDoc" select="document($Link)"/>
  774.     <xsl:variable name="Docpart" select="@Eid"/>
  775.     <xsl:choose>
  776.       <!-- prevent embedded paragraphs without p tag -->
  777.       <xsl:when test="not(ancestor::p)">
  778.         <xsl:element name="p">
  779.           <xsl:attribute name="class">Paragraph</xsl:attribute>
  780.           <xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
  781.         </xsl:element>
  782.       </xsl:when>
  783.       <xsl:otherwise>
  784.         <xsl:apply-templates select="$EmbeddedDoc//help:to-be-embedded[@Eid=$Docpart]" mode="embedded"/>
  785.       </xsl:otherwise>
  786.     </xsl:choose>
  787.   </xsl:template>
  788.   
  789.   <!-- 
  790.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  791.   | PROCESSING OF POPUP TEXT                                         |
  792.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  793.   -->
  794.   
  795.   <!-- Process Popup help text -->
  796.   <xsl:template match="help:popup-cut">
  797.     <xsl:variable name="ref" select="concat('vnd.sun.star.help://',$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
  798.     <xsl:variable name="popupdoc" select="document($ref)"/>
  799.     <xsl:variable name="part" select="@Eid"/>
  800.     <xsl:apply-templates select="$popupdoc//help:to-popup[@Eid=$part]"/>
  801.     <!--
  802.         <xsl:element name="hr">
  803.           <xsl:attribute name="width">50%</xsl:attribute>
  804.           <xsl:attribute name="align">center</xsl:attribute>
  805.           <xsl:attribute name="size">1</xsl:attribute>
  806.         </xsl:element>
  807. //-->
  808.   </xsl:template>
  809.   
  810.   <!-- Process help popups -->
  811.   <!-- Workaround for "How to get this function" popup is to load it in a small table into the document -->
  812.   <xsl:template match="help:popup">
  813.     <xsl:choose>
  814.       <xsl:when test="child::help:embedded[@Eid='wie']">
  815.         <xsl:variable name="Link" select="concat('vnd.sun.star.help://',$Database,'/',@Id,'?Language=',$Language,'&System=',$System)"/>
  816.         <xsl:variable name="EmbeddedDoc" select="document($Link)"/>
  817.         <xsl:variable name="Docpart" select="@Eid"/>
  818.         <xsl:if test="$EmbeddedDoc//help:to-popup[@Eid=$Docpart]!=''">
  819.           <xsl:element name="table">
  820.             <xsl:attribute name="width">100%</xsl:attribute>
  821.             <xsl:attribute name="border">0</xsl:attribute>
  822.             <xsl:attribute name="cellspacing">0</xsl:attribute>
  823.             <xsl:attribute name="cellpadding">4</xsl:attribute>
  824.             <xsl:element name="tr">
  825.               <xsl:element name="td">
  826.                 <xsl:attribute name="class">howtogetheader</xsl:attribute>
  827.                 <xsl:value-of select="."/>
  828.                 <xsl:apply-templates/>
  829.               </xsl:element>
  830.             </xsl:element>
  831.             <xsl:element name="tr">
  832.               <xsl:element name="td">
  833.                 <xsl:attribute name="class">howtogetbody</xsl:attribute>
  834.                 <xsl:apply-templates select="$EmbeddedDoc//help:to-popup[@Eid=$Docpart]" mode="popup"/>
  835.               </xsl:element>
  836.             </xsl:element>
  837.           </xsl:element>
  838.         </xsl:if>
  839.         <xsl:element name="br"/>
  840.       </xsl:when>
  841.       <xsl:otherwise>
  842.         <xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,$am,'Eid',$es,@Eid)"/>
  843.         <xsl:element name="a">
  844.           <xsl:attribute name="class">ContentLink</xsl:attribute>
  845.           <xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
  846.           <xsl:attribute name="name">    <xsl:call-template name="linkname"/></xsl:attribute>
  847.           <xsl:apply-templates/>
  848.         </xsl:element>
  849.       </xsl:otherwise>
  850.     </xsl:choose>
  851.   </xsl:template>
  852.   
  853.   
  854.   <!-- 
  855.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  856.   | PROCESSING OF ANCHORS                                            |
  857.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  858.   | These can be based on help index keywords or Help-IDs            |
  859.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  860.   -->
  861.   
  862.   <!-- Process anchor names (help index keywords) -->
  863.   <xsl:template match="help:key-word">
  864.     <xsl:element name="a">
  865.       <xsl:attribute name="name"><xsl:value-of select="@tag"/></xsl:attribute>
  866.     </xsl:element>
  867.   </xsl:template>
  868.   <xsl:template match="help:key-word" mode="doctitle">
  869.     <xsl:element name="a">
  870.       <xsl:attribute name="name"><xsl:value-of select="@tag"/></xsl:attribute>
  871.     </xsl:element>
  872.   </xsl:template>
  873.   <!-- Process anchor names (help ids) -->
  874.   <xsl:template match="help:help-id">
  875.     <xsl:element name="a">
  876.       <xsl:attribute name="name"><xsl:value-of select="@value"/></xsl:attribute>
  877.     </xsl:element>
  878.   </xsl:template>
  879.   <xsl:template match="help:help-id" mode="doctitle">
  880.     <xsl:element name="a">
  881.       <xsl:attribute name="name"><xsl:value-of select="@value"/></xsl:attribute>
  882.     </xsl:element>
  883.   </xsl:template>
  884.   
  885.   <!-- 
  886.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  887.   | PROCESSING OF LINKS                                              |
  888.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  889.   -->
  890.   
  891.   <!-- Process help links -->
  892.   <xsl:template match="help:link">
  893.     <xsl:choose>
  894.       <xsl:when test="@Eid">
  895.         <xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,'#',@Eid)"/>
  896.         <xsl:element name="a">
  897.           <xsl:attribute name="class">ContentLink</xsl:attribute>
  898.           <xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
  899.           <xsl:attribute name="name">    <xsl:call-template name="linkname"/></xsl:attribute>
  900.           <xsl:apply-templates/>
  901.         </xsl:element>
  902.       </xsl:when>
  903.       <xsl:otherwise>
  904.         <xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
  905.         <xsl:element name="a">
  906.           <xsl:attribute name="class">ContentLink</xsl:attribute>
  907.           <xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
  908.           <xsl:attribute name="name">    <xsl:call-template name="linkname"/></xsl:attribute>
  909.           <xsl:apply-templates/>
  910.         </xsl:element>
  911.       </xsl:otherwise>
  912.     </xsl:choose>
  913.   </xsl:template>
  914.   <xsl:template match="help:link" mode="embedded">
  915.     <xsl:choose>
  916.       <xsl:when test="@Eid">
  917.         <xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System,'#',@Eid)"/>
  918.         <xsl:element name="a">
  919.           <xsl:attribute name="class">ContentLink</xsl:attribute>
  920.           <xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
  921.           <xsl:attribute name="name">    <xsl:call-template name="linkname"/></xsl:attribute>
  922.           <xsl:apply-templates/>
  923.         </xsl:element>
  924.       </xsl:when>
  925.       <xsl:otherwise>
  926.         <xsl:variable name="Link" select="concat($hp,$sm,$Database,$sl,@Id,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
  927.         <xsl:element name="a">
  928.           <xsl:attribute name="class">ContentLink</xsl:attribute>
  929.           <xsl:attribute name="href"><xsl:value-of select="$Link"/></xsl:attribute>
  930.           <xsl:attribute name="name">    <xsl:call-template name="linkname"/></xsl:attribute>
  931.           <xsl:apply-templates/>
  932.         </xsl:element>
  933.       </xsl:otherwise>
  934.     </xsl:choose>
  935.   </xsl:template>
  936.   <xsl:template match="help:link" mode="doctitle">
  937.     <xsl:apply-templates/>
  938.   </xsl:template>
  939.   
  940.   <!-- 
  941.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  942.   | PROCESSING OF IMAGES                                              |
  943.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  944.   -->
  945.   
  946.   <!-- Process images -->
  947.   <xsl:template match="draw:image | office:image">
  948.     <xsl:element name="img">
  949.       <xsl:variable name="pictureLink" select="concat($hp,$sm,'picture',$sl,@xlink:href,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
  950.       <xsl:attribute name="src"><xsl:value-of select="$pictureLink"/></xsl:attribute>
  951.         <xsl:attribute name="width"><xsl:value-of select="@svg:pixelx"/></xsl:attribute>
  952.        <xsl:attribute name="height"><xsl:value-of select="@svg:pixely"/></xsl:attribute>
  953.        <xsl:attribute name="alt"><xsl:value-of select="@svg:desc"/></xsl:attribute>
  954.  
  955. <!--
  956.         Width/Height is now contained in the svg:pixelx and svg:pixely attributes
  957.       <xsl:attribute name="width"><xsl:value-of select="round(substring-before(@svg:width,'cm')*37.8)"/></xsl:attribute>
  958.       <xsl:attribute name="height"><xsl:value-of select="round(substring-before(@svg:height,'cm')*37.8)"/></xsl:attribute>
  959. //-->
  960.     </xsl:element>
  961.   </xsl:template>
  962.   <!-- Remove residues of formatting information -->
  963.   <xsl:template match="style"/>
  964.   <!-- Add CSS link to custom.css -->
  965.   <xsl:template match="help:css-file-link">
  966.     <xsl:variable name="CssStylesheet" select="concat($hp,$sm,$cs,$sl,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
  967.     <xsl:element name="link">
  968.       <xsl:attribute name="rel">STYLESHEET</xsl:attribute>
  969.       <xsl:attribute name="href"><xsl:value-of select="$CssStylesheet"/></xsl:attribute>
  970.       <xsl:attribute name="type">text/css</xsl:attribute>
  971.     </xsl:element>
  972.     <!-- Add Encoding meta tag for correct display of asian text -->
  973.     <xsl:element name="meta">
  974.       <xsl:attribute name="http-equiv">Content-type</xsl:attribute>
  975.       <xsl:attribute name="content">text/html; charset=utf-8</xsl:attribute>
  976.     </xsl:element>
  977.   </xsl:template>
  978.   
  979.   <!-- 
  980.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  981.   | ERROR HANDLING                                                   |
  982.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  983.   -->
  984.   
  985.   <!-- error handling -->
  986.   <xsl:template match="help:error-id">
  987.     <xsl:value-of select="$Id"/>
  988.   </xsl:template>
  989.   <xsl:template match="help:help-id-missing">
  990.     <xsl:value-of select="$Id"/>
  991.   </xsl:template>
  992.   <xsl:template match="help:error-module">
  993.     <xsl:value-of select="$Database"/>
  994.   </xsl:template>
  995.   <xsl:template match="help:help-mod-missing">
  996.     <xsl:value-of select="$Database"/>
  997.   </xsl:template>
  998.   <xsl:template match="help:help-org-missing">
  999.     <xsl:value-of select="$Path"/>
  1000.   </xsl:template>
  1001.   <xsl:template match="help:error-path">
  1002.     <xsl:value-of select="$Path"/>
  1003.   </xsl:template>
  1004.  
  1005.   <!-- 
  1006.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1007.   | PROCESSING OF PRODUCT INFORMATION/BRANDING                       |
  1008.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1009.   -->
  1010.   
  1011.   <!-- Branding -->
  1012.   <xsl:template match="help:productname">
  1013.     <xsl:element name="span">
  1014.       <xsl:attribute name="class">prod</xsl:attribute>
  1015.       <xsl:value-of select="$productname"/>
  1016.     </xsl:element>
  1017.   </xsl:template>
  1018.   <xsl:template match="help:productversion">
  1019.     <xsl:element name="span">
  1020.       <xsl:attribute name="class">prod</xsl:attribute>
  1021.       <xsl:value-of select="$productversion"/>
  1022.     </xsl:element>
  1023.   </xsl:template>
  1024.   <xsl:template match="help:productpath">{installpath}</xsl:template>
  1025.   <xsl:template match="help:vendorname">
  1026.     <xsl:element name="span">
  1027.       <xsl:attribute name="class">vendor</xsl:attribute>
  1028.       <xsl:value-of select="$vendorname"/>
  1029.     </xsl:element>
  1030.   </xsl:template>
  1031.   <xsl:template match="help:vendorversion">
  1032.     <xsl:element name="span">
  1033.       <xsl:attribute name="class">vendor</xsl:attribute>
  1034.       <xsl:value-of select="$vendorversion"/>
  1035.     </xsl:element>
  1036.   </xsl:template>
  1037.   <xsl:template match="help:vendorpath">{installpath}</xsl:template>
  1038.   <xsl:template match="help:vendorshort">
  1039.     <xsl:element name="span">
  1040.       <xsl:attribute name="class">vendor</xsl:attribute>
  1041.       <xsl:value-of select="$vendorshort"/>
  1042.     </xsl:element>
  1043.   </xsl:template>
  1044.   <xsl:template match="help:productname" mode="doctitle">
  1045.     <xsl:value-of select="$productname"/>
  1046.   </xsl:template>
  1047.   <xsl:template match="help:productversion" mode="doctitle">
  1048.     <xsl:value-of select="$productversion"/>
  1049.   </xsl:template>
  1050.   <xsl:template match="help:productpath" mode="doctitle">{installpath}</xsl:template>
  1051.   <xsl:template match="help:vendorname" mode="doctitle">
  1052.     <xsl:value-of select="$vendorname"/>
  1053.   </xsl:template>
  1054.   <xsl:template match="help:vendorversion" mode="doctitle">
  1055.     <xsl:value-of select="$vendorversion"/>
  1056.   </xsl:template>
  1057.   <xsl:template match="help:vendorpath" mode="doctitle">{installpath}</xsl:template>
  1058.   <xsl:template match="help:vendorshort" mode="doctitle">
  1059.     <xsl:value-of select="$vendorshort"/>
  1060.   </xsl:template>
  1061.   <xsl:template match="help:productname" mode="popup">
  1062.     <xsl:value-of select="$productname"/>
  1063.   </xsl:template>
  1064.   <xsl:template match="help:productversion" mode="popup">
  1065.     <xsl:value-of select="$productversion"/>
  1066.   </xsl:template>
  1067.   <xsl:template match="help:productpath" mode="popup">{installpath}</xsl:template>
  1068.   <xsl:template match="help:vendorname" mode="popup">
  1069.     <xsl:value-of select="$vendorname"/>
  1070.   </xsl:template>
  1071.   <xsl:template match="help:vendorversion" mode="popup">
  1072.     <xsl:value-of select="$vendorversion"/>
  1073.   </xsl:template>
  1074.   <xsl:template match="help:vendorpath" mode="popup">{installpath}</xsl:template>
  1075.   <xsl:template match="help:vendorshort" mode="popup">
  1076.     <xsl:value-of select="$vendorshort"/>
  1077.   </xsl:template>
  1078.   <xsl:template match="help:productname" mode="embedded">
  1079.     <xsl:value-of select="$productname"/>
  1080.   </xsl:template>
  1081.   <xsl:template match="help:productversion" mode="embedded">
  1082.     <xsl:value-of select="$productversion"/>
  1083.   </xsl:template>
  1084.   <xsl:template match="help:productpath" mode="embedded">{installpath}</xsl:template>
  1085.   <xsl:template match="help:vendorname" mode="embedded">
  1086.     <xsl:value-of select="$vendorname"/>
  1087.   </xsl:template>
  1088.   <xsl:template match="help:vendorversion" mode="embedded">
  1089.     <xsl:value-of select="$vendorversion"/>
  1090.   </xsl:template>
  1091.   <xsl:template match="help:vendorpath" mode="embedded">{installpath}</xsl:template>
  1092.   <xsl:template match="help:vendorshort" mode="embedded">
  1093.     <xsl:value-of select="$vendorshort"/>
  1094.   </xsl:template>
  1095.   
  1096.    <!-- 
  1097.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1098.   | ADDITIONAL STUFF                                                 |
  1099.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1100.   -->
  1101.    
  1102.   <!-- admin info -->
  1103.   <xsl:template match="referenznumber"/>
  1104.   <!-- spacing -->
  1105.   <xsl:template match="text:s">
  1106.     <!-- not currentyl working -->
  1107.     <xsl:apply-templates/>
  1108.   </xsl:template>
  1109.   <xsl:template match="text:tab-stop">
  1110.     <xsl:call-template name="spacer">
  1111.       <xsl:with-param name="width">
  1112.         <xsl:value-of select="$tabwidth"/>
  1113.       </xsl:with-param>
  1114.     </xsl:call-template>
  1115.     <xsl:apply-templates/>
  1116.   </xsl:template>
  1117.    
  1118.   <xsl:template name="loop">
  1119.     <xsl:param name="ct">1</xsl:param>
  1120.     <xsl:param name="cur">1</xsl:param>
  1121.     <xsl:param name="wdth">1</xsl:param>
  1122.     <xsl:call-template name="spacer">
  1123.       <xsl:with-param name="width">
  1124.         <xsl:value-of select="$wdth"/>
  1125.       </xsl:with-param>
  1126.     </xsl:call-template>
  1127.     <xsl:if test="$cur < $ct">
  1128.       <xsl:call-template name="loop">
  1129.         <xsl:with-param name="ct">
  1130.           <xsl:value-of select="$ct"/>
  1131.         </xsl:with-param>
  1132.         <xsl:with-param name="cur">
  1133.           <xsl:value-of select="$cur+1"/>
  1134.         </xsl:with-param>
  1135.         <xsl:with-param name="wdth">
  1136.           <xsl:value-of select="$wdth"/>
  1137.         </xsl:with-param>
  1138.       </xsl:call-template>
  1139.     </xsl:if>
  1140.   </xsl:template>
  1141.   
  1142.   <xsl:template name="spacer">
  1143.     <xsl:param name="width">1</xsl:param>
  1144.     <xsl:element name="img">
  1145.       <xsl:variable name="pictureLink" select="concat($hp,$sm,'picture',$sl,$onepixel,$qm,'Language',$es,$Language,$am,'System',$es,$System)"/>
  1146.       <xsl:attribute name="src"><xsl:value-of select="$pictureLink"/></xsl:attribute>
  1147.       <xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute>
  1148.       <xsl:attribute name="height">1</xsl:attribute>
  1149.     </xsl:element>
  1150.   </xsl:template>
  1151.   
  1152.   <xsl:template name="linkname">
  1153.       <xsl:call-template name="string-replace">
  1154.           <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
  1155.           <xsl:with-param name="from">%PRODUCTNAME</xsl:with-param>
  1156.           <xsl:with-param name="to"><xsl:value-of select="$productname"/></xsl:with-param>
  1157.       </xsl:call-template>
  1158.   </xsl:template>
  1159.  
  1160.     <xsl:template name="string-replace" >
  1161.      <xsl:param name="string"/>
  1162.      <xsl:param name="from"/>
  1163.      <xsl:param name="to"/>
  1164.      <xsl:choose>
  1165.        <xsl:when test="contains($string,$from)">
  1166.          <xsl:value-of select="substring-before($string,$from)"/>
  1167.          <xsl:value-of select="$to"/>
  1168.          <xsl:call-template name="string-replace">
  1169.          <xsl:with-param name="string" 
  1170.              select="substring-after($string,$from)"/>
  1171.          <xsl:with-param name="from" select="$from"/>
  1172.          <xsl:with-param name="to" select="$to"/>
  1173.          </xsl:call-template>
  1174.        </xsl:when>
  1175.        <xsl:otherwise>
  1176.          <xsl:value-of select="$string"/>
  1177.        </xsl:otherwise>
  1178.      </xsl:choose>
  1179.    </xsl:template>
  1180.  
  1181. </xsl:stylesheet>