home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _50824C50305B42CF804A166DFB363974 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-20  |  62.2 KB  |  1,643 lines

  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!--  topic2html.xsl 1.03; 2002 May 7
  3.  | DITA topic to HTML; "single topic to single web page"-level view
  4.  |
  5.  | Copyright IBM Corporation, 2002
  6.  | This file is part of the DITA package on IBM's developerWorks site.
  7.  | See license.txt for disclaimers.
  8.  *-->
  9.  
  10. <xsl:transform version="1.0"
  11.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  12.  
  13.  
  14. <!-- OTHER STYLESHEET INCLUDES/IMPORTS -->
  15. <xsl:include href="rel-links.xsl"/>
  16. <xsl:include href="domains.xsl"/>
  17.  
  18.  
  19. <!-- OUTPUT METHOD -->
  20.  
  21. <!-- XHTML output with XML syntax) -->
  22. <xsl:output method="xml"
  23.             encoding="iso-8859-1"
  24.             indent="no"
  25.             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  26.             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
  27. />
  28.  
  29. <!-- HTML output with HTML 4.0 syntax) -->
  30. <!--xsl:output method="html"
  31.             encoding="iso-8859-1"
  32.             indent="no"
  33.             doctype-system="http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"
  34.             doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
  35. /-->
  36.  
  37.  
  38. <!-- USER SPECIFIC DECLARED VALUES  (change as needed) -->
  39.  
  40. <!-- copyright string for placing into meta of each generated HTML topic -->
  41. <xsl:variable name="copyright">Copyright IBM Corp. 1994, 2002</xsl:variable>
  42.  
  43.  
  44. <!-- "GLOBAL" DECLARATIONS -->
  45.  
  46. <xsl:variable name="newline">
  47. </xsl:variable>
  48.  
  49. <!-- Filler for A-name anchors  - was  -->
  50. <xsl:variable name="afill"></xsl:variable>
  51.  
  52.  
  53. <!-- DEFAULT VALUES FOR EXTERNALLY MODIFIABLE PARAMETERS -->
  54.  
  55. <!-- /CSS = user's CSS filename parameter ('')-->
  56. <xsl:param name="default-css" select="'common.css'"/>
  57. <xsl:param name="CSS" select="''"/>
  58.  
  59. <!-- /CSSPATH = default CSS path parameter (null)-->
  60. <xsl:param name="CSSPATH" select="''"/>
  61.  
  62. <!-- /IP = default image path parameter (null)-->
  63. <xsl:param name="IP" select="''"/>
  64.  
  65. <!-- /ARTLBL = default "output artwork filenames" processing parameter ('no')-->
  66. <xsl:param name="ARTLBL" select="'no'"/><!-- "no" and "yes" are valid values; non-'yes' is ignored -->
  67.  
  68. <!-- /DRAFT = default "hide draft & cleanup content" processing parameter ('no' = hide them)-->
  69. <xsl:param name="DRAFT" select="'no'"/><!-- "no" and "yes" are valid values; non-'yes' is ignored -->
  70.  
  71. <!-- /INDEXSHOW = default "hide index entries" processing parameter ('no' = hide them)-->
  72. <xsl:param name="INDEXSHOW" select="'no'"/><!-- "no" and "yes" are valid values; non-'yes' is ignored -->
  73.  
  74. <!-- /OUTEXT = default "output extension" processing parameter ('html')-->
  75. <xsl:param name="OUTEXT" select="'html'"/><!-- "htm" and "html" are valid values -->
  76.  
  77. <!-- /WORKDIR = the working directory that contains the document being transformed.
  78.      Needed as a directory prefix for the @conref and @href "document()" function calls.
  79.      default is '../doc/')-->
  80. <xsl:param name="WORKDIR" select="'../docs/'"/>
  81.  
  82. <!-- /FILENAME = the file name (file name and extension only - no path) of the document being transformed.
  83.      Needed to help with debugging.
  84.      default is 'myfile.xml')-->
  85. <xsl:param name="FILENAME" select="'myfile.xml'"/>
  86.  
  87. <!-- /DBG = Debug mode - enables XSL debugging xsl-messages.
  88.      Needed to help with debugging.
  89.      default is 'no')-->
  90. <xsl:param name="DBG" select="'no'"/><!-- "no" and "yes" are valid values; non-'yes' is ignored -->
  91.  
  92. <!-- /Lang = default language parameter  -->
  93. <xsl:param name="Lang" select="'en-US'"/>
  94.  
  95.  
  96.  
  97. <!-- NULL PROCESSORS (for things whose content will be used by reference or excluded) -->
  98.  
  99. <!-- section title for now is pulled due to need for resolution of possible multiple title methods -->
  100. <xsl:template match="*[contains(@class,' topic/section ')]/*[contains(@class,' topic/title ')]"/>
  101.  
  102. <!-- fig and table titles can be relocated, therefore must be pulled; can't fall through -->
  103. <xsl:template match="*[contains(@class,' topic/table ')]/*[contains(@class,' topic/title ')]"/>
  104. <xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]"/>
  105. <xsl:template match="*[contains(@class,' topic/table ')]/*[contains(@class,' topic/desc ')]"/>
  106. <xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/desc ')]"/>
  107.  
  108. <!-- these elements are never processed in a conventional presentation. can be overridden. -->
  109. <xsl:template match="*[contains(@class,' topic/titlealts ')]"/>
  110. <xsl:template match="*[contains(@class,' topic/searchtitle ')]"/>
  111. <xsl:template match="*[contains(@class,' topic/navtitle ')]"/>
  112. <xsl:template match="*[contains(@class,' topic/shortdesc ')]"/>
  113. <xsl:template match="*[contains(@class,' topic/no-topic-nesting ')]"/>
  114.  
  115. <xsl:template match="*[contains(@class,' topic/prolog ')]"/>
  116. <xsl:template match="*[contains(@class,' topic/metadata ')]"/>
  117. <xsl:template match="*[contains(@class,' topic/author ')]"/>
  118. <xsl:template match="*[contains(@class,' topic/source ')]"/>
  119. <xsl:template match="*[contains(@class,' topic/publisher ')]"/>
  120. <xsl:template match="*[contains(@class,' topic/copyright ')]"/>
  121. <xsl:template match="*[contains(@class,' topic/copyryear ')]"/>
  122. <xsl:template match="*[contains(@class,' topic/copyrholder ')]"/>
  123. <xsl:template match="*[contains(@class,' topic/critdates ')]"/>
  124. <xsl:template match="*[contains(@class,' topic/created ')]"/>
  125. <xsl:template match="*[contains(@class,' topic/revised ')]"/>
  126. <xsl:template match="*[contains(@class,' topic/permissions ')]"/>
  127. <xsl:template match="*[contains(@class,' topic/category ')]"/>
  128. <xsl:template match="*[contains(@class,' topic/audience ')]"/>
  129. <xsl:template match="*[contains(@class,' topic/keywords ')]"/>
  130. <xsl:template match="*[contains(@class,' topic/prodinfo ')]"/>
  131. <xsl:template match="*[contains(@class,' topic/prodname ')]"/>
  132. <xsl:template match="*[contains(@class,' topic/vrmlist ')]"/>
  133. <xsl:template match="*[contains(@class,' topic/vrm ')]"/>
  134. <xsl:template match="*[contains(@class,' topic/brand ')]"/>
  135. <xsl:template match="*[contains(@class,' topic/series ')]"/>
  136. <xsl:template match="*[contains(@class,' topic/platform ')]"/>
  137. <xsl:template match="*[contains(@class,' topic/prognum ')]"/>
  138. <xsl:template match="*[contains(@class,' topic/featnum ')]"/>
  139. <xsl:template match="*[contains(@class,' topic/component ')]"/>
  140. <xsl:template match="*[contains(@class,' topic/othermeta ')]"/>
  141. <xsl:template match="*[contains(@class,' topic/resourceid ')]"/>
  142.  
  143. <!-- handled by related-links.xsl: related-links, link, linkpool, linklist,
  144.      title and desc in linklist, and xref -->
  145.  
  146.  
  147.  
  148. <!-- ROOT RULE (just fall through) -->
  149.  
  150. <xsl:template match="/">
  151.   <xsl:apply-templates/>
  152. </xsl:template>
  153.  
  154.  
  155.  
  156.  
  157. <!-- This first template rule generates the outer-level shell for a delivery context. -->
  158. <!-- In an override stylesheet, the same call to "chapter-setup" must be issued to
  159.      maintain the consistency of overall look'n'feel of the output HTML. -->
  160.  
  161. <xsl:template match="*[contains(@class,' topic/topic ')]" name="toptopic">
  162.   <xsl:comment>Common DITA topic to HTML application by IBM Corp., 2001, 2002</xsl:comment>
  163.   <xsl:call-template name="chapter-setup"/>
  164. </xsl:template>
  165.  
  166.  
  167. <!-- =============== start of contextual topic titles ================= -->
  168.  
  169. <!-- NESTED TOPIC CONTEXTS (child topics get a div wrapper and fall through) -->
  170. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]" priority="2">
  171.   <div class="nested1">
  172.     <xsl:apply-templates select="@id"/>
  173.     <xsl:call-template name="gen-toc-id"/>
  174.     <xsl:apply-templates/>
  175.   </div>
  176. </xsl:template>
  177.  
  178. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]" priority="3">
  179.   <div class="nested2">
  180.     <xsl:apply-templates select="@id"/>
  181.     <xsl:call-template name="gen-toc-id"/>
  182.     <xsl:apply-templates/>
  183.   </div>
  184. </xsl:template>
  185.  
  186. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]" priority="4">
  187.   <div class="nested3">
  188.     <xsl:apply-templates select="@id"/>
  189.     <xsl:call-template name="gen-toc-id"/>
  190.     <xsl:apply-templates/>
  191.   </div>
  192. </xsl:template>
  193.  
  194. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]" priority="5">
  195.   <div class="nested4">
  196.     <xsl:apply-templates select="@id"/>
  197.     <xsl:call-template name="gen-toc-id"/>
  198.     <xsl:apply-templates/>
  199.   </div>
  200. </xsl:template>
  201.  
  202. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]" priority="6">
  203.   <div class="nested5">
  204.     <xsl:apply-templates select="@id"/>
  205.     <xsl:call-template name="gen-toc-id"/>
  206.     <xsl:apply-templates/>
  207.   </div>
  208. </xsl:template>
  209.  
  210.  
  211.  
  212. <!-- NESTED TOPIC TITLES (sensitive to nesting depth, but are still processed for contained markup) -->
  213.  
  214. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="2">
  215.   <h1 class="topictitle1"><xsl:call-template name="get-title"/></h1>
  216.   <xsl:call-template name="gen-ptoc"/>
  217. </xsl:template>
  218.  
  219. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="3">
  220.   <h2 class="topictitle2"><xsl:call-template name="get-title"/></h2>
  221. </xsl:template>
  222.  
  223. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="4">
  224.   <h3 class="topictitle3"><xsl:call-template name="get-title"/></h3>
  225. </xsl:template>
  226.  
  227. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="5">
  228.   <h4 class="topictitle4"><xsl:call-template name="get-title"/></h4>
  229. </xsl:template>
  230.  
  231. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="6">
  232.   <h5 class="topictitle5"><xsl:call-template name="get-title"/></h5>
  233. </xsl:template>
  234.  
  235. <xsl:template match="*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]" priority="7">
  236.   <h6 class="topictitle6"><xsl:call-template name="get-title"/></h6>
  237. </xsl:template>
  238.  
  239. <!-- =============== end of contextual topic titles ================= -->
  240.  
  241.  
  242.  
  243. <xsl:template match="*[contains(@class,' topic/shortdesc ')]" mode="outofline">
  244.   <p style="padding: 3pt; background: #e0e0e0">
  245.     <xsl:call-template name="setclass"/>
  246.     <xsl:apply-templates/>
  247.   </p>
  248. </xsl:template>
  249.  
  250.  
  251. <xsl:template match="*[contains(@class,' topic/body ')]" name="topbody">
  252.   <div>
  253.     <xsl:call-template name="setclass"/>
  254.     <xsl:apply-templates select="@id"/>
  255.     <!-- here, you can generate a toc based on what's a child of body -->
  256.     <!--xsl:call-template  name="gen-sect-ptoc"/-->
  257.     <xsl:apply-templates select="parent::*/shortdesc" mode="outofline"/>
  258.     <xsl:apply-templates/>
  259.   </div>
  260. </xsl:template>
  261.  
  262.  
  263. <xsl:template match="*[contains(@class,' topic/section ')]">
  264.   <div>
  265.     <xsl:call-template name="setclass"/>
  266.     <xsl:apply-templates select="@id"/>
  267.     <xsl:call-template name="gen-toc-id"/>
  268.     <xsl:call-template name="sect-heading">
  269.        <xsl:with-param name="deftitle"></xsl:with-param>
  270.     </xsl:call-template>
  271.     <xsl:apply-templates/>
  272.     <xsl:if test="$link-top-section='yes'">
  273.       <p align="left"><a href="#TOP">
  274.         <xsl:call-template name="getString">
  275.           <xsl:with-param name="stringName" select="'Return to Top'"/>
  276.         </xsl:call-template>
  277.       </a></p>
  278.     </xsl:if>
  279.   </div>
  280. </xsl:template>
  281.  
  282.  
  283. <xsl:template match="*[contains(@class,' topic/example ')]">
  284.   <div>
  285.     <xsl:call-template name="setclass"/>
  286.     <xsl:apply-templates select="@id"/>
  287.     <xsl:call-template name="gen-toc-id"/>
  288.     <xsl:call-template name="sect-heading">
  289.       <xsl:with-param name="deftitle">
  290.         <xsl:call-template name="getString">
  291.           <xsl:with-param name="stringName" select="'Example'"/>
  292.         </xsl:call-template>
  293.       </xsl:with-param>
  294.     </xsl:call-template>
  295.     <xsl:apply-templates/>
  296.     <xsl:if test="$link-top-section='yes'">
  297.       <p align="left"><a href="#TOP">
  298.         <xsl:call-template name="getString">
  299.           <xsl:with-param name="stringName" select="'Return to Top'"/>
  300.         </xsl:call-template>
  301.       </a></p>
  302.     </xsl:if>
  303.   </div>
  304. </xsl:template>
  305.  
  306.  
  307. <xsl:template match="*[contains(@class,' topic/p ')]">
  308. <xsl:apply-templates select="@id"/>
  309.  <xsl:choose>
  310.   <xsl:when test="descendant::*[contains(@class,' topic/pre ')]"><div><xsl:call-template name="setclass"/><xsl:apply-templates /></div></xsl:when>
  311.   <xsl:when test="descendant::*[contains(@class,' topic/ul ')]"><div><xsl:call-template name="setclass"/><xsl:apply-templates /></div></xsl:when>
  312.   <xsl:when test="descendant::*[contains(@class,' topic/ol ')]"><div><xsl:call-template name="setclass"/><xsl:apply-templates /></div></xsl:when>
  313.   <xsl:otherwise><p><xsl:call-template name="setclass"/><xsl:apply-templates /></p></xsl:otherwise>
  314.  </xsl:choose>
  315. </xsl:template>
  316.  
  317.  
  318. <xsl:template match="*[contains(@class,' topic/note ')]">
  319.   <p>
  320.     <xsl:call-template name="setclass"/>
  321.     <xsl:apply-templates select="@id"/>
  322.     <xsl:choose>
  323.       <xsl:when test="@type='note'"><b>
  324.         <xsl:call-template name="getString">
  325.           <xsl:with-param name="stringName" select="'Note'"/>
  326.         </xsl:call-template><xsl:text>: </xsl:text></b>
  327.       </xsl:when>
  328.       <xsl:when test="@type='tip'"><b>
  329.         <xsl:call-template name="getString">
  330.           <xsl:with-param name="stringName" select="'Tip'"/>
  331.         </xsl:call-template><xsl:text>: </xsl:text></b>
  332.       </xsl:when>
  333.       <xsl:when test="@type='fastpath'"><b>
  334.         <xsl:call-template name="getString">
  335.           <xsl:with-param name="stringName" select="'Fastpath'"/>
  336.         </xsl:call-template><xsl:text>: </xsl:text></b>
  337.       </xsl:when>
  338.       <xsl:when test="@type='restriction'"><b>
  339.         <xsl:call-template name="getString">
  340.           <xsl:with-param name="stringName" select="'Restriction'"/>
  341.         </xsl:call-template><xsl:text>: </xsl:text></b>
  342.       </xsl:when>
  343.       <xsl:when test="@type='important'"><b>
  344.         <xsl:call-template name="getString">
  345.           <xsl:with-param name="stringName" select="'Important'"/>
  346.         </xsl:call-template><xsl:text>: </xsl:text></b>
  347.       </xsl:when>
  348.       <xsl:when test="@type='remember'"><b>
  349.         <xsl:call-template name="getString">
  350.           <xsl:with-param name="stringName" select="'Remember'"/>
  351.         </xsl:call-template><xsl:text>: </xsl:text></b>
  352.       </xsl:when>
  353.       <xsl:when test="@type='attention'"><b>
  354.         <xsl:call-template name="getString">
  355.           <xsl:with-param name="stringName" select="'Attention'"/>
  356.         </xsl:call-template><xsl:text>: </xsl:text></b>
  357.       </xsl:when>
  358.       <xsl:when test="@type='caution'"><b>
  359.         <xsl:call-template name="getString">
  360.           <xsl:with-param name="stringName" select="'Caution'"/>
  361.         </xsl:call-template><xsl:text>: </xsl:text></b>
  362.       </xsl:when>
  363.       <xsl:when test="@type='danger'"><b>
  364.         <xsl:call-template name="getString">
  365.           <xsl:with-param name="stringName" select="'Danger'"/>
  366.         </xsl:call-template><xsl:text>: </xsl:text></b>
  367.       </xsl:when>
  368.       <xsl:when test="@type='other'">
  369.         <xsl:choose>
  370.           <xsl:when test="@othertype">
  371.           <!-- othertype is a key that should look up external, translateable text. -->
  372.           <b>
  373.            <xsl:value-of select="@othertype"/><xsl:text>: </xsl:text>
  374.           </b>
  375.           </xsl:when>
  376.           <xsl:otherwise>
  377.             <!-- nop -->
  378.           </xsl:otherwise>
  379.         </xsl:choose>
  380.       </xsl:when>
  381.       <xsl:otherwise>
  382.           <!-- nop -->
  383.       </xsl:otherwise>
  384.     </xsl:choose>
  385.     <xsl:apply-templates />
  386.   </p>
  387. </xsl:template>
  388.  
  389.  
  390. <xsl:template match="*[contains(@class,' topic/lq ')]">
  391.   <blockquote>
  392.     <xsl:call-template name="setclass"/>
  393.     <xsl:apply-templates select="@id"/>
  394.     <xsl:apply-templates/>
  395.     <xsl:choose>
  396.       <xsl:when test="@href">
  397.         <br class="br"/><div style="text-align:right"><a href="{@href}"><cite><xsl:value-of select="@reftitle"/></cite></a></div>
  398.       </xsl:when>
  399.       <xsl:when test="@reftitle">
  400.         <br class="br"/><div style="text-align:right"><cite><xsl:value-of select="@reftitle"/></cite></div>
  401.       </xsl:when>
  402.       <xsl:otherwise><!--nop--></xsl:otherwise>
  403.     </xsl:choose>
  404.   </blockquote>
  405. </xsl:template>
  406.  
  407.  
  408. <xsl:template match="*[contains(@class,' topic/q ')]">
  409.   <!-- for HTML 4 aware browsers, use HTML's q element with CSS lang properties -->
  410.   <xsl:text>"</xsl:text><xsl:apply-templates/><xsl:text>"</xsl:text>
  411. </xsl:template>
  412.  
  413.  
  414. <xsl:template match="*[contains(@class,' topic/ul ')]">
  415.   <ul>
  416.     <xsl:call-template name="setclass"/>
  417.     <xsl:apply-templates select="@compact"/>
  418.     <xsl:apply-templates select="@id"/>
  419.     <xsl:apply-templates/>
  420.   </ul>
  421. </xsl:template>
  422.  
  423. <xsl:template match="*[contains(@class,' topic/ol ')]">
  424.   <ol>
  425.     <xsl:call-template name="setclass"/>
  426.     <xsl:apply-templates select="@compact"/>
  427.     <xsl:apply-templates select="@id"/>
  428.     <xsl:apply-templates/>
  429.   </ol>
  430. </xsl:template>
  431.  
  432. <xsl:template match="*[contains(@class,' topic/li ')]">
  433.   <li>
  434.     <xsl:call-template name="setclass"/>
  435.     <xsl:apply-templates select="@id"/>
  436.     <xsl:apply-templates/>
  437.   </li>
  438. </xsl:template>
  439.  
  440.  
  441. <xsl:template match="*[contains(@class,' topic/itemgroup ')]">
  442.   <span>
  443.     <xsl:call-template name="setclass"/>
  444.     <xsl:apply-templates select="@id"/>
  445.     <xsl:apply-templates/>
  446.   </span>
  447. </xsl:template>
  448.  
  449.  
  450. <xsl:template match="*[contains(@class,' topic/dl ')]">
  451.   <dl>
  452.     <xsl:call-template name="setclass"/>
  453.     <xsl:apply-templates select="@compact"/>
  454.     <xsl:apply-templates select="@id"/>
  455.  
  456.     <xsl:apply-templates/>
  457.   </dl>
  458. </xsl:template>
  459.  
  460.  
  461. <xsl:template match="*[contains(@class, ' topic/dlhead ')]">
  462.   <xsl:apply-templates/>
  463. </xsl:template>
  464.  
  465.  
  466. <xsl:template match="*[contains(@class,' topic/dthd ')]">
  467.   <dt>
  468.     <xsl:call-template name="setclass"/>
  469.     <xsl:apply-templates select="@id"/>
  470.     <b><xsl:apply-templates/></b>
  471.   </dt>
  472. </xsl:template>
  473.  
  474.  
  475. <xsl:template match="*[contains(@class,' topic/ddhd ')]">
  476.   <dd>
  477.     <xsl:call-template name="setclass"/>
  478.     <xsl:apply-templates select="@id"/>
  479.     <b><xsl:apply-templates/></b>
  480.   </dd>
  481. </xsl:template>
  482.  
  483.  
  484. <xsl:template match="*[contains(@class,' topic/dlentry ')]">
  485.   <xsl:if test="@id">
  486.   <xsl:call-template name="output-message">
  487.     <xsl:with-param name="msg">The ID attribute on DLENTRY will be ignored. Move that ID to a DT tag.</xsl:with-param>
  488.     <xsl:with-param name="msgnum">002</xsl:with-param>
  489.     <xsl:with-param name="msgsev">W</xsl:with-param>
  490.   </xsl:call-template>
  491.   </xsl:if>
  492.   <xsl:apply-templates/>
  493. </xsl:template>
  494.  
  495.  
  496.  
  497. <xsl:template match="*[contains(@class,' topic/dt ')]">
  498.   <dt>
  499.     <xsl:call-template name="setclass"/>
  500.     <xsl:apply-templates select="@id"/>
  501.     <xsl:choose>
  502.       <xsl:when test="*"> <!-- tagged content - do not default to bold -->
  503.         <xsl:apply-templates/>
  504.       </xsl:when>
  505.       <xsl:otherwise>
  506.         <b><xsl:apply-templates/></b> <!-- text only - bold it -->
  507.       </xsl:otherwise>
  508.     </xsl:choose>
  509.   </dt>
  510. </xsl:template>
  511.  
  512.  
  513. <xsl:template match="*[contains(@class,' topic/dd ')]">
  514.   <dd>
  515.     <xsl:call-template name="setclass"/>
  516.     <xsl:apply-templates select="@id"/>
  517.     <xsl:apply-templates/>
  518.   </dd>
  519. </xsl:template>
  520.  
  521.  
  522. <xsl:template match="*[contains(@class,' topic/fig ')]">
  523.   <xsl:if test="contains(@frame,'top')"><hr class="hr"/></xsl:if>
  524.   <div>
  525.     <xsl:call-template name="setclass"/>
  526.     <xsl:choose>
  527.       <xsl:when test="@frame='all'">
  528.         <xsl:attribute name="class">figborder</xsl:attribute>
  529.       </xsl:when>
  530.       <xsl:when test="@frame='sides'">
  531.         <!-- sides-only borders using CSS -->
  532.       </xsl:when>
  533.       <xsl:otherwise>
  534.         <!-- CSS for any remaining frame treatments -->
  535.       </xsl:otherwise>
  536.     </xsl:choose>
  537.     <xsl:if test="$fmt-fig-lbl-loc='over'"><xsl:call-template name="place-fig-lbl"/></xsl:if>
  538.       <xsl:apply-templates select="@id"/>
  539.       <xsl:apply-templates/>
  540.     <xsl:if test="$fmt-fig-lbl-loc='under'"><xsl:call-template name="place-fig-lbl"/></xsl:if>
  541.   </div>
  542.   <xsl:if test="contains(@frame,'bot')"><hr class="hr"/></xsl:if>
  543. </xsl:template>
  544.  
  545.  
  546. <xsl:template match="*[contains(@class,' topic/figgroup ')]">
  547.   <span>
  548.     <xsl:call-template name="setclass"/>
  549.     <xsl:apply-templates select="@id"/>
  550.     <xsl:apply-templates/>
  551.   </span>
  552. </xsl:template>
  553.  
  554.  
  555. <xsl:template match="*[contains(@class,' topic/pre ')]">
  556.   <xsl:if test="contains(@frame,'top')"><hr class="hr"/></xsl:if>
  557.   <xsl:call-template name="gen-att-label"/>
  558.   <pre>
  559.     <xsl:call-template name="setclass"/>
  560.     <xsl:apply-templates select="@id"/>
  561.     <xsl:if test="@scale">
  562.       <xsl:attribute name="style">font-size: <xsl:value-of select="@scale"/>%;</xsl:attribute>
  563.     </xsl:if>
  564.     <xsl:apply-templates/>
  565.   </pre>
  566.   <xsl:if test="contains(@frame,'bot')"><hr class="hr"/></xsl:if>
  567. </xsl:template>
  568.  
  569.  
  570. <xsl:template match="*[contains(@class,' topic/lines ')]">
  571.   <pre style="font-family: sans-serif;">
  572.     <xsl:call-template name="setclass"/>
  573.     <xsl:apply-templates select="@id"/>
  574.     <xsl:apply-templates/>
  575.   </pre>
  576. </xsl:template>
  577.  
  578.  
  579. <xsl:template match="*[contains(@class,' topic/term ')]">
  580.   <span>
  581.     <xsl:call-template name="setclass"/>
  582.     <xsl:apply-templates select="@id"/>
  583.     <xsl:apply-templates/>
  584.   </span>
  585. </xsl:template>
  586.  
  587.  
  588. <xsl:template match="*[contains(@class,' topic/ph ')]">
  589.   <span>
  590.     <xsl:call-template name="setclass"/>
  591.     <xsl:apply-templates select="@id"/>
  592.     <xsl:apply-templates/>
  593.   </span>
  594. </xsl:template>
  595.  
  596.  
  597. <xsl:template match="*[contains(@class,' topic/tm ')]">
  598.   <span>
  599.     <xsl:call-template name="setclass"/>
  600.     <xsl:apply-templates select="@id"/>
  601.     <xsl:apply-templates/>
  602.     <sup>
  603.     <xsl:choose>
  604.       <xsl:when test="@tmtype='tm'">(TM)</xsl:when>
  605.       <xsl:when test="@tmtype='reg'">(R)</xsl:when>
  606.       <xsl:when test="@tmtype='service'">(SM)</xsl:when>
  607.       <xsl:otherwise>
  608.         <xsl:call-template name="output-message">
  609.           <xsl:with-param name="msg">Invalid trademark attribute.</xsl:with-param>
  610.           <xsl:with-param name="msgnum">003</xsl:with-param>
  611.           <xsl:with-param name="msgsev">W</xsl:with-param>
  612.         </xsl:call-template>
  613.       </xsl:otherwise>
  614.     </xsl:choose>
  615.     </sup>
  616.   </span>
  617. </xsl:template>
  618.  
  619.  
  620. <xsl:template match="*[contains(@class,' topic/boolean ')]">
  621.   <span style="color:green">
  622.     <xsl:call-template name="setclass"/>
  623.     <xsl:apply-templates select="@id"/>
  624.     <xsl:value-of select="name()"/><xsl:text>: </xsl:text><xsl:value-of select="@state"/>
  625.   </span>
  626. </xsl:template>
  627.  
  628.  
  629. <xsl:template match="*[contains(@class,' topic/state ')]">
  630.   <span style="color:red">
  631.     <xsl:call-template name="setclass"/>
  632.     <xsl:apply-templates select="@id"/>
  633.     <xsl:value-of select="name()"/><xsl:text>: </xsl:text><xsl:value-of select="@name"/><xsl:text>=</xsl:text><xsl:value-of select="@value"/>
  634.   </span>
  635. </xsl:template>
  636.  
  637.  
  638. <xsl:template match="*[contains(@class,' topic/image ')]">
  639.   <!-- build any pre break indicated by style -->
  640.   <xsl:choose>
  641.     <xsl:when test="parent::fig[contains(@frame,'top ')]">
  642.       <!-- NOP if there is already a break implied by a parent property -->
  643.     </xsl:when>
  644.     <xsl:otherwise>
  645.       <xsl:if test="not(@placement='inline')"><br clear="all"/></xsl:if>
  646.     </xsl:otherwise>
  647.   </xsl:choose>
  648.   <!-- now invoke the actual content and its alt text -->
  649.   <xsl:element name="img">
  650.     <xsl:call-template name="setclass"/>
  651.     <xsl:attribute name="src">
  652.      <xsl:value-of select="$IP"/>
  653.        <xsl:choose>
  654.          <xsl:when test="@href">
  655.            <xsl:value-of select="@href"/>
  656.          </xsl:when>
  657.          <xsl:otherwise>
  658.            <!-- no action -->
  659.          </xsl:otherwise>
  660.        </xsl:choose>
  661.      </xsl:attribute>
  662.     <xsl:if test="@height"><xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute></xsl:if>
  663.     <xsl:if test="@width"><xsl:attribute name="width"><xsl:value-of select="@width"/></xsl:attribute></xsl:if>
  664.     <xsl:choose>
  665.       <xsl:when test="@alt">
  666.         <xsl:attribute name="alt"><xsl:value-of select="@alt"/></xsl:attribute>
  667.       </xsl:when>
  668.       <xsl:otherwise>
  669.         <xsl:attribute name="alt"><xsl:value-of select="textalt|*[contains(@class,' topic/textalt')]"/></xsl:attribute>
  670.       </xsl:otherwise>
  671.     </xsl:choose>
  672.     <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:if>
  673.   </xsl:element>
  674.   <!-- build any post break indicated by style -->
  675.   <xsl:if test="not(@placement='inline')"><br clear="all"/></xsl:if>
  676.   <!-- build optional echo of the image name for review -->
  677.   <xsl:if test="$ARTLBL='yes'">
  678.      <br class="br"/><b>[<xsl:value-of select="$IP"/> <xsl:value-of select="@href"/>]</b>
  679.   </xsl:if>
  680. </xsl:template>
  681.  
  682.  
  683. <xsl:template match="*[contains(@class,' topic/object ')]">
  684.   <!-- copy through for HTML -->
  685.   <xsl:copy>
  686.     <xsl:copy-of select="@*" />
  687.     <xsl:apply-templates />
  688.   </xsl:copy>
  689. </xsl:template>
  690.  
  691.  
  692. <xsl:template match="*[contains(@class,' topic/param ')]">
  693.   <!-- copy through for HTML -->
  694.   <xsl:copy>
  695.     <xsl:copy-of select="@*" />
  696.     <xsl:apply-templates />
  697.   </xsl:copy>
  698. </xsl:template>
  699.  
  700.  
  701. <xsl:template match="*[contains(@class,' topic/simpletable ')]">
  702.   <table border="1">
  703.     <xsl:call-template name="setclass"/>
  704.     <xsl:apply-templates select="@id"/>
  705.     <xsl:apply-templates/>
  706.   </table>
  707. </xsl:template>
  708.  
  709.  
  710. <xsl:template match="*[contains(@class,' topic/sthead ')]">
  711.   <tr>
  712.     <xsl:call-template name="setclass"/>
  713.     <xsl:apply-templates/>
  714.   </tr>
  715. </xsl:template>
  716.  
  717.  
  718. <xsl:template match="*[contains(@class,' topic/strow ')]">
  719.   <tr>
  720.     <xsl:call-template name="setclass"/>
  721.     <xsl:apply-templates/>
  722.   </tr>
  723. </xsl:template>
  724.  
  725.  
  726. <xsl:template match="*[contains(@class,' topic/sthead ')]/*[contains(@class,' topic/stentry ')]" priority="2">
  727.   <th align="left" valign="bottom">
  728.     <xsl:call-template name="setclass"/>
  729.     <xsl:apply-templates/>
  730.   </th>
  731. </xsl:template>
  732.  
  733.  
  734. <xsl:template match="*[contains(@class,' topic/stentry ')]">
  735.   <td align="left" valign="top">
  736.     <xsl:call-template name="setclass"/>
  737.     <xsl:variable name="localkeycol">
  738.       <xsl:choose>
  739.         <xsl:when test="ancestor::simpletable/@keycol">
  740.           <xsl:value-of select="ancestor::simpletable/@keycol"/>
  741.         </xsl:when>
  742.         <xsl:otherwise>0</xsl:otherwise>
  743.       </xsl:choose>
  744.     </xsl:variable>
  745.     <xsl:choose>
  746.       <xsl:when test="$localkeycol=position()"><b><xsl:apply-templates/></b></xsl:when>
  747.       <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  748.     </xsl:choose>
  749.   </td>
  750. </xsl:template>
  751.  
  752.  
  753. <xsl:template match="*[contains(@class,' topic/draft-comment ')]">
  754.   <xsl:if test="$DRAFT='yes'">
  755.     <xsl:apply-templates select="@id"/>
  756.     <div style="background-color: #FF99FF; color:#CC3333; border: 1pt black solid;">
  757.       <xsl:call-template name="setclass"/>
  758.       <b>Review comment<xsl:if test="@author"> [from <xsl:value-of select="@author"/>]</xsl:if><xsl:if test="@disposition"> (<xsl:value-of select="@disposition"/>)</xsl:if><xsl:if test="@time"> {<xsl:value-of select="@time"/>}</xsl:if><xsl:text>: </xsl:text></b>
  759.       <xsl:apply-templates/>
  760.     </div>
  761.   </xsl:if>
  762. </xsl:template>
  763.  
  764.  
  765. <xsl:template match="*[contains(@class,' topic/required-cleanup ')]">
  766.   <xsl:if test="$DRAFT='yes'">
  767.     <xsl:call-template name="output-message">
  768.       <xsl:with-param name="msg">Required cleanup area found.</xsl:with-param>
  769.       <xsl:with-param name="msgnum">001</xsl:with-param>
  770.       <xsl:with-param name="msgsev">W</xsl:with-param>
  771.     </xsl:call-template>
  772.     <xsl:apply-templates select="@id"/>
  773.     <span style="background-color: #FFFF99; color:#CC3333">
  774.     <xsl:call-template name="setclass"/>
  775.     <xsl:apply-templates select="@id"/>
  776.     <b>Required Cleanup! <xsl:if test="@remap">[<xsl:value-of select="@remap"/>] </xsl:if></b>
  777.     <xsl:apply-templates/>
  778.     </span>
  779.   </xsl:if>
  780. </xsl:template>
  781.  
  782.  
  783. <xsl:template match="*[contains(@class,' topic/fn ')]">
  784.   <xsl:apply-templates select="@id"/>
  785.   <xsl:variable name="fnid"><xsl:number from="/" level="any"/></xsl:variable>
  786.   <xsl:variable name="callout"><xsl:value-of select="@callout"/></xsl:variable>
  787.   <xsl:variable name="convergedcallout">
  788.     <xsl:choose>
  789.       <xsl:when test="string-length($callout)>'0'"><xsl:value-of select="$callout"/></xsl:when>
  790.       <xsl:otherwise><xsl:value-of select="$fnid"/></xsl:otherwise>
  791.     </xsl:choose>
  792.   </xsl:variable>
  793.     <!-- <xsl:variable name="fnbody"><xsl:apply-templates/></xsl:variable> -->
  794.     <!-- <a name="fnsrc_{$fnid}" href="#fntarg_{$fnid}" OnClick='alert ("{$fnbody}")'> -->
  795.   <a name="fnsrc_{$fnid}" href="#fntarg_{$fnid}">
  796.     <sup><xsl:value-of select="$convergedcallout"/></sup>
  797.   </a>
  798. </xsl:template>
  799.  
  800.  
  801. <xsl:template match="*[contains(@class,' topic/cite ')]">
  802. <cite>
  803.   <xsl:call-template name="setclass"/>
  804.   <xsl:apply-templates select="@id"/>
  805.   <xsl:apply-templates/>
  806. </cite>
  807. </xsl:template>
  808.  
  809.  
  810. <xsl:template match="*[contains(@class,' topic/indextermref ')]"/>
  811.  
  812.  
  813. <xsl:template match="*[contains(@class,' topic/indexterm ')]">
  814.   <xsl:if test="$INDEXSHOW='yes'">
  815.     <span style="margin: 1pt; background-color: #ffddff; border: 1pt black solid;">
  816.       <xsl:call-template name="setclass"/>
  817.       <xsl:apply-templates/>
  818.     </span>
  819.   </xsl:if>
  820. </xsl:template>
  821.  
  822.  
  823. <xsl:template match="*[contains(@class,' topic/keyword ')]">
  824.   <xsl:apply-templates select="@id"/>
  825.   <xsl:apply-templates/>
  826. </xsl:template>
  827.  
  828.  
  829. <!--  CALS (OASIS) TABLE  -->
  830.  
  831. <xsl:template match="*[contains(@class,' topic/tgroup ')]">
  832.   <xsl:apply-templates/>
  833. </xsl:template>
  834.  
  835. <xsl:template match="*[contains(@class,' topic/spanspec ')]"/>
  836.  
  837. <xsl:template match="*[contains(@class,' topic/colspec ')]"></xsl:template>
  838.  
  839.  
  840. <xsl:template match="*[contains(@class,' topic/table ')]">
  841.   <xsl:if test="$fmt-tbl-lbl-loc='over'"><xsl:call-template name="place-tbl-lbl"/></xsl:if>
  842.   <xsl:if test="contains(@frame,'top')"><hr class="hr"/></xsl:if>
  843.  
  844.   <xsl:apply-templates select="@id"/>
  845.   <table>
  846.     <xsl:call-template name="setclass"/>
  847.     <!-- apply longdesc processing here if outputting HTML 4 -->
  848.     <xsl:if test="@frame">
  849.       <xsl:variable name="frameval" select="@frame"/>
  850.       <xsl:choose>
  851.         <xsl:when test="$frameval='none'">
  852.           <xsl:attribute name="border">0</xsl:attribute>
  853.         </xsl:when>
  854.         <xsl:when test="contains($frameval,'top')">
  855.           <!-- any HTML table frame controls for this condition? -->
  856.         </xsl:when>
  857.         <xsl:when test="contains($frameval,'bot')">
  858.           <!-- any HTML table frame controls for this condition? -->
  859.         </xsl:when>
  860.         <xsl:otherwise>
  861.           <xsl:attribute name="border">1</xsl:attribute>
  862.         </xsl:otherwise>
  863.       </xsl:choose>
  864.     </xsl:if>
  865.     <xsl:if test="not(@frame)">
  866.       <xsl:attribute name="border">1</xsl:attribute>
  867.     </xsl:if>
  868.     <xsl:call-template name="tblatts"/>
  869.     <xsl:call-template name="place-tbl-width"/> <!-- pick up global definition -->
  870.       <xsl:apply-templates/>
  871.     <xsl:apply-templates select="*[contains(@class,' topic/tfoot ')]" mode="outofline"/>
  872.   </table>
  873.   <br clear="all"/>
  874.   <br clear="all"/>
  875.   <xsl:if test="contains(@frame,'bot')"><hr class="hr"/></xsl:if>
  876.   <xsl:if test="$fmt-tbl-lbl-loc='under'"><xsl:call-template name="place-tbl-lbl"/></xsl:if>
  877. </xsl:template>
  878.  
  879. <xsl:template match="*[contains(@class,' topic/row ')]">
  880.   <tr>
  881.   <xsl:call-template name="setclass"/>
  882.     <xsl:call-template name="tblatts"/>
  883.     <xsl:apply-templates/>
  884.   </tr>
  885. </xsl:template>
  886.  
  887. <xsl:template match="*[contains(@class,' topic/thead ')]">
  888.   <xsl:apply-templates/>
  889. </xsl:template>
  890.  
  891. <xsl:template match="*[contains(@class,' topic/tfoot ')]" mode="outofline">
  892.   <xsl:apply-templates/>
  893. </xsl:template>
  894.  
  895. <xsl:template match="*[contains(@class,' topic/tbody ')]">
  896.   <xsl:apply-templates/>
  897. </xsl:template>
  898.  
  899. <xsl:template match="*[contains(@class,' topic/thead ')]/*/*[contains(@class,' topic/entry ')]" name="thdr">
  900.   <th>
  901.     <xsl:call-template name="setclass"/>
  902.     <xsl:call-template name="tblatts-nocolst"/>
  903.     <xsl:call-template name="fillit"/>
  904.   </th>
  905. </xsl:template>
  906.  
  907. <xsl:template match="*[contains(@class,' topic/tfoot ')]/*/*[contains(@class,' topic/entry ')]" name="tftr">
  908.   <td>
  909.     <xsl:call-template name="setclass"/>
  910.     <xsl:call-template name="tblatts-nocolst"/>
  911.     <xsl:value-of select="./tft/c"/>
  912.   </td>
  913. </xsl:template>
  914.  
  915. <xsl:template match="*[contains(@class,' topic/tbody ')]/*/*[contains(@class,' topic/entry ')]" name="tbod">
  916.   <td>
  917.     <xsl:call-template name="setclass"/>
  918.     <xsl:call-template name="tblatts-nocolst"/>
  919.     <xsl:call-template name="fillit"/>
  920.   </td>
  921. </xsl:template>
  922.  
  923. <xsl:template match="*[contains(@class,' topic/tnote ')]">
  924.   <tr>
  925.     <xsl:call-template name="setclass"/>
  926.     <xsl:call-template name="tblatts"/>
  927.     <td>
  928.       <xsl:call-template name="tblatts-nocolst"/>
  929.       <p><b>
  930.         <xsl:call-template name="getString">
  931.           <xsl:with-param name="stringName" select="'Note'"/>
  932.         </xsl:call-template><xsl:text>: </xsl:text>
  933.       </b><xsl:apply-templates/></p>
  934.     </td>
  935.   </tr>
  936. </xsl:template>
  937.  
  938. <!-- named templates for CALS table -->
  939.  
  940. <!-- generate   filler if the cell is evidently empty -->
  941. <xsl:template name="fillit">
  942.   <xsl:choose>
  943.     <xsl:when test="not(text()[normalize-space(.)] | *)"> </xsl:when>
  944.     <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  945.   </xsl:choose>
  946. </xsl:template>
  947.  
  948. <!-- process the generic table attributes (convert CALS properties to HTML properties) -->
  949. <xsl:template name="tblatts">
  950.   <xsl:choose>
  951.     <xsl:when test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign"/></xsl:attribute></xsl:when>
  952.     <xsl:otherwise><xsl:attribute name="valign">top</xsl:attribute></xsl:otherwise>
  953.   </xsl:choose>
  954.   <xsl:choose>
  955.     <xsl:when test="@align"><xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:when>
  956.     <xsl:otherwise><xsl:attribute name="align">left</xsl:attribute></xsl:otherwise>
  957.   </xsl:choose>
  958.   <xsl:if test="@colsep">
  959.     <xsl:if test="@colsep='1'"><xsl:attribute name="cellpadding">10</xsl:attribute></xsl:if>
  960.   </xsl:if>
  961.   <xsl:if test="@morerows">
  962.     <xsl:attribute name="rowspan"><xsl:value-of select="@morerows+1"/></xsl:attribute>
  963.   </xsl:if>
  964.   <xsl:if test="@colname">
  965.     <xsl:attribute name="colstart"><xsl:value-of select="ancestor::tgroup/colspec[@colname=current()/@colname]/@colnum"/></xsl:attribute>
  966.   </xsl:if>
  967.   <xsl:if test="@namest">
  968.     <xsl:variable name="colst" select="substring-after(@namest,'col')"/>
  969.     <xsl:variable name="colend" select="substring-after(@nameend,'col')"/>
  970.     <xsl:attribute name="colspan"><xsl:value-of select="$colend - $colst + 1"/></xsl:attribute>
  971.   </xsl:if>
  972. </xsl:template>
  973.  
  974.  
  975. <!-- process the generic table attributes (convert CALS properties to HTML properties) -->
  976. <xsl:template name="tblatts-nocolst">
  977.   <xsl:choose>
  978.     <xsl:when test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign"/></xsl:attribute></xsl:when>
  979.     <xsl:otherwise><xsl:attribute name="valign">top</xsl:attribute></xsl:otherwise>
  980.   </xsl:choose>
  981.   <xsl:choose>
  982.     <xsl:when test="@align"><xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:when>
  983.     <xsl:otherwise><xsl:attribute name="align">left</xsl:attribute></xsl:otherwise>
  984.   </xsl:choose>
  985.   <xsl:if test="@colsep">
  986.     <xsl:if test="@colsep='1'"><xsl:attribute name="cellpadding">10</xsl:attribute></xsl:if>
  987.   </xsl:if>
  988.   <xsl:if test="@morerows">
  989.     <xsl:attribute name="rowspan"><xsl:value-of select="@morerows+1"/></xsl:attribute>
  990.   </xsl:if>
  991.   <xsl:if test="@colname">
  992.     <!--xsl:attribute name="colstart"><xsl:value-of select="ancestor::tgroup/colspec[@colname=current()/@colname]/@colnum"/></xsl:attribute-->
  993.   </xsl:if>
  994.   <xsl:if test="@namest">
  995.     <xsl:variable name="colst" select="substring-after(@namest,'col')"/>
  996.     <xsl:variable name="colend" select="substring-after(@nameend,'col')"/>
  997.     <xsl:attribute name="colspan"><xsl:value-of select="$colend - $colst + 1"/></xsl:attribute>
  998.   </xsl:if>
  999. </xsl:template>
  1000.  
  1001. <!-- end of table section -->
  1002.  
  1003.  
  1004. <!-- =================== end of element rules ====================== -->
  1005.  
  1006.  
  1007.  
  1008.  
  1009. <!-- =================== start of processors  ====================== -->
  1010.  
  1011.  
  1012. <!--  COMMON ATTRIBUTE PROCESSORS  -->
  1013.  
  1014. <!-- If the element has an ID, copy it through as an anchor. -->
  1015. <xsl:template match="@id">
  1016.   <a>
  1017.     <xsl:attribute name="name">
  1018.       <xsl:if test="ancestor::*[contains(@class,' topic/body ')]">
  1019.        <xsl:value-of select="ancestor::*[contains(@class,' topic/body ')]/parent::*/@id"/><xsl:text>__</xsl:text>
  1020.       </xsl:if>
  1021.       <xsl:value-of select="."/>
  1022.     </xsl:attribute>
  1023.   <xsl:value-of select="$afill"/>
  1024.   </a>
  1025. </xsl:template>
  1026.  
  1027.  
  1028. <!-- Generate an ID to use for generated toc. -->
  1029. <xsl:template name="gen-toc-id">
  1030.   <a name="{generate-id()}"> </a>
  1031.  
  1032. </xsl:template>
  1033.  
  1034.  
  1035. <!-- Create the class attribute for an element when the DITA element has an outputclass attribute. -->
  1036. <xsl:template name="setclass">
  1037.   <xsl:if test="@outputclass">
  1038.      <xsl:attribute name="class"><xsl:value-of select="@outputclass"/></xsl:attribute>
  1039.   </xsl:if>
  1040. </xsl:template>
  1041.  
  1042.  
  1043. <!-- If the element has a compact=yes attribute, assert it in HTML form. -->
  1044. <!-- (assumes that no compaction is default) -->
  1045. <xsl:template match="@compact">
  1046.   <xsl:if test="@compact = 'yes'">
  1047.    <xsl:attribute name="compact">compact</xsl:attribute>
  1048.   </xsl:if>
  1049. </xsl:template>
  1050.  
  1051.  
  1052. <!--  CONREF (content fetched by id from conrefed element)  -->
  1053.  
  1054. <xsl:template match="*[@conref]" priority="10">
  1055.   <!--get element local name, parent topic's domains, and then file name, topic id, element id from conref value-->
  1056.   <xsl:variable name="element">
  1057.     <xsl:value-of select="local-name(.)"/>
  1058.   </xsl:variable>
  1059.   <xsl:variable name="domains">
  1060.     <xsl:value-of select="ancestor::*[contains(@class, ' topic/body ')]/parent::*/@domains"/>
  1061.   </xsl:variable>
  1062.   <xsl:variable name="file">
  1063.     <xsl:choose>
  1064.        <xsl:when test="contains(@conref,'#')"><xsl:value-of select="$WORKDIR"/><xsl:value-of select="substring-before(@conref,'#')"/></xsl:when>
  1065.        <xsl:otherwise><xsl:value-of select="$WORKDIR"/><xsl:value-of select="@conref"/></xsl:otherwise>
  1066.     </xsl:choose>
  1067.   </xsl:variable>
  1068.  
  1069.   <xsl:variable name="topicid">
  1070.     <xsl:choose>
  1071.        <xsl:when test="contains(@conref,'#') and contains(substring-after(@conref,'#'),'/')"><xsl:value-of select="substring-before(substring-after(@conref,'#'),'/')"/></xsl:when>
  1072.        <xsl:when test="contains(@conref,'#')"><xsl:value-of select="substring-after(@conref,'#')"/></xsl:when>
  1073.        <xsl:otherwise>none</xsl:otherwise>
  1074.     </xsl:choose>
  1075.   </xsl:variable>
  1076.  
  1077.   <xsl:variable name="elemid">
  1078.     <xsl:choose>
  1079.      <xsl:when test="contains(@conref,'#') and contains(substring-after(@conref,'#'),'/')"><xsl:value-of select="substring-after(substring-after(@conref,'#'),'/')"/></xsl:when>
  1080.      <xsl:otherwise>none</xsl:otherwise>
  1081.     </xsl:choose>
  1082.   </xsl:variable>
  1083.  
  1084.   <xsl:variable name="topicpos">
  1085.     <xsl:choose>
  1086.        <xsl:when test="starts-with(@conref,'#')">samefile</xsl:when>
  1087.        <xsl:when test="contains(@conref,'#')">otherfile</xsl:when>
  1088.        <xsl:otherwise>firstinfile</xsl:otherwise>
  1089.     </xsl:choose>
  1090.   </xsl:variable>
  1091.  
  1092.   <xsl:variable name="DBG">no</xsl:variable>
  1093.   <xsl:if test="$DBG='yes'">
  1094.     <xsl:call-template name="output-message">
  1095.       <xsl:with-param name="msg">Conref trace: </xsl:with-param>
  1096.       <xsl:with-param name="msgnum">006</xsl:with-param>
  1097.       <xsl:with-param name="msgsev">I</xsl:with-param>
  1098.     </xsl:call-template>
  1099.     <xsl:message> Element: <xsl:value-of select="name()"/>:<xsl:value-of select="$element"/></xsl:message>
  1100.     <xsl:message> Domains: <xsl:value-of select="$domains"/></xsl:message>
  1101.     <xsl:message> Working dir: <xsl:value-of select="$WORKDIR"/></xsl:message>
  1102.     <xsl:message> File: <xsl:value-of select="$file"/></xsl:message>
  1103.     <xsl:message> Topicid: <xsl:value-of select="$topicid"/></xsl:message>
  1104.     <xsl:message> Elemid: <xsl:value-of select="$elemid"/></xsl:message>
  1105.     <xsl:message> Topic location: <xsl:value-of select="$topicpos"/></xsl:message>
  1106.   </xsl:if>
  1107.  
  1108.   <xsl:choose>
  1109.      <xsl:when test="contains(substring-after(@conref,'#'),'/')"><!--targetting an element inside a topic-->
  1110.        <xsl:choose>
  1111.           <xsl:when test="$topicpos='samefile'">
  1112.             <xsl:apply-templates select="//*[contains(@class, ' topic/topic ')][@id=$topicid][@domains=$domains]/*[contains(@class, ' topic/body ')]//*[local-name()=$element][@id=$elemid]"/>
  1113.           </xsl:when>
  1114.           <xsl:when test="$topicpos='otherfile'">
  1115.             <xsl:apply-templates select="document($file)//*[contains(@class, ' topic/topic ')][@id=$topicid][@domains=$domains]/*[contains(@class, ' topic/body ')]//*[local-name()=$element][@id=$elemid]"/>
  1116.           </xsl:when>
  1117.           <xsl:otherwise/><!-- error msg -->
  1118.        </xsl:choose>
  1119.      </xsl:when>
  1120.      <xsl:otherwise><!--assume targetting a topic-->
  1121.        <xsl:choose>
  1122.           <xsl:when test="$topicpos='samefile'">
  1123.             <xsl:apply-templates select="//*[contains(@class, ' topic/topic ')][@id=$topicid][@domains=$domains][local-name()=$element]"/>
  1124.           </xsl:when>
  1125.           <xsl:when test="$topicpos='otherfile'">
  1126.             <xsl:apply-templates select="document($file)//*[contains(@class, ' topic/topic ')][@id=$topicid][@domains=$domains][local-name()=$element]"/>
  1127.           </xsl:when>
  1128.           <xsl:when test="$topicpos='firstinfile'">
  1129.             <xsl:apply-templates select="document($file)//*[contains(@class, ' topic/topic ')][1][@domains=$domains][local-name()=$element]"/>
  1130.           </xsl:when>
  1131.           <xsl:otherwise/><!-- error msg -->
  1132.        </xsl:choose>
  1133.      </xsl:otherwise>
  1134.   </xsl:choose>
  1135. </xsl:template>
  1136.  
  1137.  
  1138. <!-- SCRIPT SUPPORT -->
  1139.  
  1140. <xsl:template name="script-sample">
  1141. <script language="JavaScript">
  1142. <xsl:comment>
  1143.   // define JavaScript within here; use CDATA sections as appropriate
  1144.   self.focus();
  1145.   function popwin(popupitem)
  1146.   {
  1147.          var PopUpWin=window.open(popupitem,"PopUpWin","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width=500,height=200");
  1148.          PopUpWin.focus();
  1149.   }
  1150. //</xsl:comment>
  1151. </script>
  1152. </xsl:template>
  1153.  
  1154.  
  1155.  
  1156. <!--  NAMED TEMPLATES (call by name, only)  -->
  1157.  
  1158. <xsl:template name="gen-att-label">
  1159. <xsl:if test="@spectitle"><div style="margin-bottom: 0;"><b><xsl:value-of select="@spectitle"/></b></div></xsl:if>
  1160. </xsl:template>
  1161.  
  1162.  
  1163. <!-- named templates that can be used anywhere -->
  1164.  
  1165. <!-- this replaces newlines with the BR element, forcing non-concatenation even in flow contexts -->
  1166. <xsl:template name="br-replace">
  1167.   <xsl:param name="word"/>
  1168. <!-- capture an actual newline within the xsl:text element -->
  1169.   <xsl:variable name="cr"><xsl:text>
  1170. </xsl:text></xsl:variable>
  1171.   <xsl:choose>
  1172.     <xsl:when test="contains($word,$cr)">
  1173.        <xsl:value-of select="substring-before($word,$cr)"/>
  1174.        <br class="br"/>
  1175.        <xsl:call-template name="br-replace">
  1176.          <xsl:with-param name="word" select="substring-after($word,$cr)"/>
  1177.        </xsl:call-template>
  1178.     </xsl:when>
  1179.     <xsl:otherwise>
  1180.       <xsl:value-of select="$word"/>
  1181.     </xsl:otherwise>
  1182.   </xsl:choose>
  1183. </xsl:template>
  1184.  
  1185. <!-- diagnostic: call this to generate a path-like view of an element's ancestry! -->
  1186. <xsl:template name="breadcrumbs">
  1187. <xsl:variable name="full-path">
  1188.   <xsl:for-each select="ancestor-or-self::*">
  1189.     <xsl:value-of select="concat('/',name())"/>
  1190.   </xsl:for-each>
  1191. </xsl:variable>
  1192. <p><b><xsl:value-of select="$full-path"/></b></p>
  1193. </xsl:template>
  1194.  
  1195.  
  1196. <!-- the following named templates generate inline content for the delivery context -->
  1197.  
  1198.  
  1199. <!-- named templates for labels and titles related to topic structures -->
  1200.  
  1201. <xsl:template name="get-title"><!-- get fully-processed title content by whatever mechanism -->
  1202.   <xsl:choose>
  1203.    <xsl:when test="@classif">
  1204.      <xsl:value-of select="//classdef[@classname=current()/@classif]/title"/>
  1205.    </xsl:when>
  1206.    <xsl:when test="@spectitle">
  1207.      <xsl:value-of select="@spectitle"/>
  1208.    </xsl:when>
  1209.    <xsl:otherwise>
  1210.     <xsl:apply-templates/> <!-- select="title|*[contains(@class,' topic/title ')]"/-->
  1211.    </xsl:otherwise>
  1212.   </xsl:choose>
  1213. </xsl:template>
  1214.  
  1215.  
  1216. <xsl:template name="get-sect-heading">
  1217.      <xsl:choose>
  1218.       <xsl:when test="@classif">
  1219.         <xsl:value-of select="//classdef[@classname=current()/@classif]/title"/>
  1220.       </xsl:when>
  1221.       <xsl:when test="@spectitle">
  1222.         <xsl:value-of select="@spectitle"/>
  1223.       </xsl:when>
  1224.       <xsl:otherwise>
  1225.         <xsl:apply-templates select="title"/>
  1226.       </xsl:otherwise>
  1227.      </xsl:choose>
  1228. </xsl:template>
  1229.  
  1230.  
  1231. <xsl:template name="sect-heading">
  1232.   <xsl:param name="deftitle" select="."/> <!-- get param by reference -->
  1233.   <xsl:variable name="heading">
  1234.      <xsl:choose>
  1235.       <xsl:when test="*[contains(@class,' topic/title ')]">
  1236.         <xsl:value-of select="*[contains(@class,' topic/title ')]"/>
  1237.         <xsl:if test="*[contains(@class,' topic/title ')][2]">
  1238.          <xsl:call-template name="output-message">
  1239.            <xsl:with-param name="msg">More than one title element in a section. Using the first one for the section's title.</xsl:with-param>
  1240.            <xsl:with-param name="msgnum">007</xsl:with-param>
  1241.            <xsl:with-param name="msgsev">W</xsl:with-param>
  1242.          </xsl:call-template>
  1243.       </xsl:if>
  1244.       </xsl:when>
  1245.       <xsl:when test="@spectitle">
  1246.         <xsl:value-of select="@spectitle"/>
  1247.       </xsl:when>
  1248.       <xsl:otherwise/>
  1249.      </xsl:choose>
  1250.   </xsl:variable>
  1251.  
  1252.   <!-- based on graceful defaults, build an appropriate section-level heading -->
  1253.   <xsl:choose>
  1254.     <xsl:when test="not($heading='')">
  1255.       <xsl:if test="normalize-space($heading)=''">
  1256.         <!-- hack: a title with whitespace ALWAYS overrides as null -->
  1257.         <xsl:comment>no heading</xsl:comment>
  1258.       </xsl:if>
  1259.       <p class="sectiontitle"><b><xsl:call-template name="proc-ing"/><xsl:value-of select="$heading"/></b></p>
  1260.     </xsl:when>
  1261.     <xsl:when test="$deftitle">
  1262.       <p class="sectiontitle"><b><xsl:value-of select="$deftitle"/></b></p>
  1263.     </xsl:when>
  1264.     <xsl:otherwise><br /><!-- no heading title, output section starting with a break --></xsl:otherwise>
  1265.   </xsl:choose>
  1266. </xsl:template>
  1267.  
  1268.  
  1269.  
  1270.  
  1271. <!-- render any contained footnotes as endnotes.  Links back to reference point -->
  1272. <xsl:template name="gen-endnotes">
  1273.   <xsl:if test="//fn">
  1274.    <hr class="hr"/>
  1275.    <div>
  1276.    <h3 class="sectiontitle">
  1277.       <xsl:call-template name="getString">
  1278.         <xsl:with-param name="stringName" select="'End Notes'"/>
  1279.       </xsl:call-template>
  1280.     </h3>
  1281.     <xsl:for-each select="//fn">
  1282.      <p>
  1283.        <xsl:variable name="fnid"><xsl:number from="/" level="any"/></xsl:variable>
  1284.        <xsl:variable name="callout"><xsl:value-of select="@callout"/></xsl:variable>
  1285.        <xsl:variable name="convergedcallout">
  1286.          <xsl:choose>
  1287.            <xsl:when test="string-length($callout)>'0'"><xsl:value-of select="$callout"/></xsl:when>
  1288.            <xsl:otherwise><xsl:value-of select="$fnid"/></xsl:otherwise>
  1289.          </xsl:choose>
  1290.        </xsl:variable>
  1291.        <a name="fntarg_{$fnid}" href="#fnsrc_{$fnid}">
  1292.          <sup><xsl:value-of select="$convergedcallout"/></sup>
  1293.        </a><xsl:text>  </xsl:text>
  1294.        <xsl:apply-templates/>
  1295.      </p>
  1296.     </xsl:for-each>
  1297.   </div>
  1298.   </xsl:if>
  1299. </xsl:template>
  1300.  
  1301.  
  1302. <!-- listing of topics from calling context only; can be expanded for nesting -->
  1303. <xsl:template name="gen-toc">
  1304.   <div>
  1305.   <h3 class="sectiontitle">
  1306.     <!--xsl:value-of select="$deftxt-toc"/-->
  1307.       <xsl:call-template name="getString">
  1308.         <xsl:with-param name="stringName" select="'Contents'"/>
  1309.       </xsl:call-template>
  1310.   </h3>
  1311.    <ul>
  1312.     <xsl:for-each select="//topic/title">
  1313.      <li>
  1314. <!-- this directive provides a "depth" indicator without doing recursive nesting -->
  1315. <xsl:value-of select="substring('------',1,count(ancestor::*))"/>
  1316.      <a>
  1317.        <xsl:attribute name="href">#<xsl:value-of select="generate-id()"/></xsl:attribute>
  1318.        <xsl:value-of select="."/>
  1319.      </a>
  1320.      <!--recursive call for subtopics here"/-->
  1321.      </li>
  1322.     </xsl:for-each>
  1323.    </ul>
  1324.   </div>
  1325. </xsl:template>
  1326.  
  1327.  
  1328. <!-- listing of immediate child topics; can be expanded for nesting -->
  1329. <xsl:template name="gen-ptoc">
  1330. <xsl:if test="*[contains(@class,' topic/topic ')]">
  1331.   <div>
  1332.   <h3 class="sectiontitle">
  1333.      <!--xsl:value-of select="$deftxt-ptoc"/-->
  1334.       <xsl:call-template name="getString">
  1335.         <xsl:with-param name="stringName" select="'Local topics'"/>
  1336.       </xsl:call-template><xsl:text>: </xsl:text>
  1337.   </h3>
  1338.    <ol>
  1339.     <xsl:for-each select="*[contains(@class,' topic/topic ')]">
  1340.      <li><a>
  1341.        <xsl:attribute name="href">#<xsl:value-of select="generate-id()"/></xsl:attribute>
  1342.        <xsl:value-of select="title"/>
  1343.      </a>
  1344.      <!--recursive call for subtopics here"/-->
  1345.      </li>
  1346.     </xsl:for-each>
  1347.    </ol>
  1348.   </div>
  1349. </xsl:if>
  1350. </xsl:template>
  1351.  
  1352. <xsl:template name="gen-sect-ptoc">
  1353.   <xsl:if test="section"><!-- only in case of child sections of body -->
  1354.   <div>
  1355.   <h3>Sections in this topic:</h3>
  1356.     <ol>
  1357.     <xsl:for-each select="section">
  1358.      <li><xsl:call-template name="get-sect-heading"/></li>
  1359.     </xsl:for-each>
  1360.     </ol>
  1361.   <hr class="hr"/>
  1362.   </div>
  1363.   </xsl:if>
  1364. </xsl:template>
  1365.  
  1366.  
  1367. <!-- basis for string localization -->
  1368.  
  1369. <xsl:template name="getString">
  1370.   <xsl:param name="stringName"/>
  1371.   <xsl:value-of select="$stringName"/>
  1372. </xsl:template>
  1373.  
  1374.  
  1375. <!--  SETTINGS  -->
  1376. <xsl:variable name="trace">no</xsl:variable> <!--set string to 'yes' to turn on trace -->
  1377.  
  1378. <!-- set up keys based on xref's "type" attribute: %info-types;|hd|fig|table|li|fn -->
  1379. <xsl:key name="topic" match="topic" use="@id"/> <!-- uses "title" -->
  1380. <xsl:key name="fig"   match="fig"   use="@id"/> <!-- uses "title" -->
  1381. <xsl:key name="table" match="table" use="@id"/> <!-- uses "title" -->
  1382. <xsl:key name="li"    match="li"    use="@id"/> <!-- uses "?" -->
  1383. <xsl:key name="fn"    match="fn"    use="@id"/> <!-- uses "callout?" -->
  1384.  
  1385.  
  1386. <!--  FORMATTER DECLARATIONS AND GLOBALS  -->
  1387.  
  1388.  
  1389.  
  1390. <!--  "FORMAT" GLOBAL DECLARATIONS  -->
  1391.  
  1392. <xsl:variable name="fmt-fig-lbl-loc">over</xsl:variable><!-- values: over, under -->
  1393. <xsl:variable name="fmt-tbl-lbl-loc">over</xsl:variable><!-- values: over, under -->
  1394. <xsl:variable name="link-top-section">no</xsl:variable><!-- values: yes, no (or any not "yes") -->
  1395. <xsl:variable name="do-place-ing">no</xsl:variable><!-- values: yes, no (or any not "yes") -->
  1396.  
  1397. <!-- this value should be created in a named template since it needs to increment per call -->
  1398. <!-- for now, the static value is null until we can redo this intent -->
  1399. <xsl:variable name="fig-pfx-txt"></xsl:variable>
  1400. <xsl:variable name="xfig-pfx-txt">
  1401.  <!--xsl:value-of select="$deftxt-fig"/-->
  1402.       <xsl:call-template name="getString">
  1403.         <xsl:with-param name="stringName" select="'Figure'"/>
  1404.       </xsl:call-template> <xsl:number level="any" count="label" from="/" />
  1405.  of <xsl:value-of select="count(//fig/label)"/>. </xsl:variable><!-- values: '' or custom design -->
  1406. <xsl:variable name="tbl-pfx-txt"></xsl:variable>
  1407.  
  1408.  
  1409.  
  1410. <!--  "FORMAT" MACROS  -->
  1411. <!--
  1412.  | These macros support globally-defined formatting constants for
  1413.  | document content.  Some elements have attributes that permit local
  1414.  | control of formatting; such logic is part of the pertinent template rule.
  1415.  +-->
  1416.  
  1417. <xsl:template name="place-tbl-width">
  1418. <xsl:variable name="twidth-fixed">100%</xsl:variable>
  1419.   <xsl:if test="$twidth-fixed != ''">
  1420.     <xsl:attribute name="width"><xsl:value-of select="$twidth-fixed"/></xsl:attribute>
  1421.   </xsl:if>
  1422. </xsl:template>
  1423.  
  1424.  
  1425. <xsl:template name="place-tbl-lbl">
  1426. <xsl:variable name="tbl-count">                  <!-- Number of table/title's before this one -->
  1427.  <xsl:number count="*/table/title" level="any"/>
  1428. </xsl:variable>
  1429. <xsl:variable name="tbl-count-actual">           <!-- Number of table/title's including this one -->
  1430.  <xsl:choose>
  1431.    <xsl:when test="not($tbl-count>0) and not($tbl-count=0) and not($tbl-count<0)">1</xsl:when>
  1432.    <xsl:otherwise><xsl:value-of select="$tbl-count+1"/></xsl:otherwise>
  1433.  </xsl:choose>
  1434. </xsl:variable>
  1435.   <xsl:choose>
  1436.     <xsl:when test="*[contains(@class,' topic/title ')]">
  1437.       <br /><div><strong>
  1438.         <xsl:call-template name="getString">
  1439.          <xsl:with-param name="stringName" select="'Table'"/>
  1440.         </xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$tbl-count-actual"/>.<xsl:text> </xsl:text>
  1441.         <xsl:value-of select="*[contains(@class,' topic/title ')]"/>
  1442.       </strong>
  1443.       <xsl:if test="*[contains(@class,' topic/desc ')]">
  1444.         <xsl:text>. </xsl:text><xsl:value-of select="*[contains(@class,' topic/desc ')]"/>
  1445.       </xsl:if>
  1446.       </div>
  1447.     </xsl:when>
  1448.     <xsl:when test="*[contains(@class,' topic/desc ')]">
  1449.       <div><xsl:value-of select="*[contains(@class,' topic/desc ')]"/></div>
  1450.     </xsl:when>
  1451.   </xsl:choose>
  1452. </xsl:template>
  1453.  
  1454.  
  1455. <xsl:template name="place-fig-lbl">
  1456. <xsl:variable name="fig-count">                 <!-- Number of fig/title's before this one -->
  1457.  <xsl:number count="*/fig/title" level="any"/>
  1458. </xsl:variable>
  1459. <xsl:variable name="fig-count-actual">          <!-- Number of fig/title's including this one -->
  1460.  <xsl:choose>
  1461.    <xsl:when test="not($fig-count>0) and not($fig-count=0) and not($fig-count<0)">1</xsl:when>
  1462.    <xsl:otherwise><xsl:value-of select="$fig-count+1"/></xsl:otherwise>
  1463.  </xsl:choose>
  1464. </xsl:variable>
  1465.   <xsl:choose>
  1466.     <xsl:when test="*[contains(@class,' topic/title ')]">
  1467.       <br /><div><strong>
  1468.         <xsl:call-template name="getString">
  1469.           <xsl:with-param name="stringName" select="'Figure'"/>
  1470.         </xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="$fig-count-actual"/>.<xsl:text> </xsl:text>
  1471.         <xsl:value-of select="*[contains(@class,' topic/title ')]"/>
  1472.       </strong>
  1473.       <xsl:if test="desc">
  1474.         <xsl:text>. </xsl:text><xsl:value-of select="*[contains(@class,' topic/desc ')]"/>
  1475.       </xsl:if>
  1476.       </div>
  1477.     </xsl:when>
  1478.     <xsl:when test="*[contains(@class, ' topic/desc ')]">
  1479.       <div><xsl:value-of select="*[contains(@class,' topic/desc ')]"/></div>
  1480.     </xsl:when>
  1481.   </xsl:choose>
  1482. </xsl:template>
  1483.  
  1484.  
  1485.  
  1486. <xsl:template name="proc-ing">
  1487.   <xsl:if test="$do-place-ing = 'yes'"> <!-- set in a global variable, as with label placement, etc. -->
  1488.     <img src="tip-ing.jpg"/> <!-- this should be an xsl:choose with the approved list and a selection method-->
  1489.     <!-- add any other required positioning controls, if needed, but must be valid in the location
  1490.          from which the call to this template was made -->
  1491.      
  1492.   </xsl:if>
  1493. </xsl:template>
  1494.  
  1495. <!-- =================== end of processors  ====================== -->
  1496.  
  1497.  
  1498.  
  1499.  
  1500. <!-- =================== start of diagnostics  ====================== -->
  1501.  
  1502.  
  1503. <xsl:template name="output-message">
  1504.   <xsl:param name="msg" select="***"/>
  1505.   <xsl:param name="msgnum" select="000"/>
  1506.   <xsl:param name="msgsev" select="I"/>
  1507.   <xsl:variable name="localclass"><xsl:value-of select="@class"/></xsl:variable>
  1508.   <xsl:variable name="debugloc">
  1509.    <!-- DocID = test.dita, Element = searchtitle:1 -->
  1510.    <xsl:text>DocID = </xsl:text><xsl:value-of select="generate-id(/)"/><xsl:text>, </xsl:text>
  1511.    <xsl:text>Element = </xsl:text><xsl:value-of select="name()"/>:<xsl:value-of select="count(preceding::*[@class=$localclass])+count(ancestor-or-self::*[@class=$localclass])"/>
  1512.   </xsl:variable>
  1513.   <xsl:message><xsl:text>------------------------------------------------------------------
  1514. DITA</xsl:text><xsl:value-of select="$msgnum"/>
  1515.     <xsl:choose>
  1516.       <xsl:when test="$msgsev='I'">I Informational: </xsl:when>
  1517.       <xsl:when test="$msgsev='W'">W Warning: </xsl:when>
  1518.       <xsl:when test="$msgsev=E">E Error: </xsl:when>
  1519.       <xsl:when test="$msgsev=F">F Fatal: </xsl:when>
  1520.       <xsl:otherwise>I Informational: </xsl:otherwise>
  1521.     </xsl:choose>
  1522.     <xsl:text> (</xsl:text><xsl:value-of select="$debugloc"/><xsl:text>)
  1523. </xsl:text><xsl:value-of select="$msg"/><xsl:text>
  1524. </xsl:text>
  1525.   </xsl:message>
  1526. </xsl:template>
  1527.  
  1528. <!-- =================== end of diagnostics  ====================== -->
  1529.  
  1530.  
  1531.  
  1532.  
  1533. <!-- =================== start of override stubs ====================== -->
  1534.  
  1535. <!--  STUBS FOR USER PROVIDED OVERRIDE EXTENSIONS  -->
  1536.  
  1537. <xsl:template name="gen-user-header">
  1538.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1539.   <!-- for example, to display logos, search/nav widgets, etc. -->
  1540. </xsl:template>
  1541.  
  1542. <xsl:template name="gen-user-footer">
  1543.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1544.   <!-- for example, to display compliances for: XHTML, accessibility, content ratings, etc. -->
  1545. </xsl:template>
  1546.  
  1547. <xsl:template name="gen-user-sidetoc">
  1548.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1549.   <!-- Common implementations use a table with align=right to place generated content
  1550.        adjacent to the start of the body content -->
  1551. </xsl:template>
  1552.  
  1553. <xsl:template name="gen-user-scripts">
  1554.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1555.   <!-- see (or enable) the named template "script-sample" for an example -->
  1556.   <!--xsl:call-template name="script-sample"/-->
  1557. </xsl:template>
  1558.  
  1559. <xsl:template name="gen-user-styles">
  1560.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1561. </xsl:template>
  1562.  
  1563.  
  1564. <xsl:template name="gen-user-panel-title-pfx">
  1565.   <!-- to customize: copy this to your override transform, add whatever content you want! -->
  1566.   <!-- Generate content based on run-time parameter value, with local logic here -->
  1567.   <!-- This is overrideable -->
  1568. </xsl:template>
  1569.  
  1570. <xsl:template name="gen-main-panel-title">
  1571.   <!-- use the searchtitle unless there's no value - else use title -->
  1572.   <xsl:variable name="schtitle"><xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/></xsl:variable>
  1573.   <xsl:variable name="ditaschtitle"><xsl:value-of select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/titlealts ')]/*[contains(@class,' topic/searchtitle ')]"/></xsl:variable>
  1574.   <xsl:variable name="maintitle"><xsl:value-of select="/*[contains(@class,' topic/topic ')]/*[contains(@class,' topic/title ')]"/></xsl:variable>
  1575.   <xsl:variable name="ditamaintitle"><xsl:value-of select="/dita/*[contains(@class,' topic/topic ')][1]/*[contains(@class,' topic/title ')]"/></xsl:variable>
  1576.   <xsl:choose>
  1577.     <xsl:when test="string-length($schtitle)>'0'"><xsl:value-of select="$schtitle"/></xsl:when>
  1578.     <xsl:when test="string-length($ditaschtitle)>'0'"><xsl:value-of select="$ditaschtitle"/></xsl:when>
  1579.     <xsl:when test="string-length($maintitle)>'0'"><xsl:value-of select="$maintitle"/></xsl:when>
  1580.     <xsl:when test="string-length($ditamaintitle)>'0'"><xsl:value-of select="$ditamaintitle"/></xsl:when>
  1581.     <xsl:otherwise>
  1582.       <xsl:text>***</xsl:text>
  1583.       <xsl:call-template name="output-message">
  1584.         <xsl:with-param name="msg">No title specified; using "***".</xsl:with-param>
  1585.         <xsl:with-param name="msgnum">009</xsl:with-param>
  1586.         <xsl:with-param name="msgsev">W</xsl:with-param>
  1587.       </xsl:call-template>
  1588.     </xsl:otherwise>
  1589.   </xsl:choose>
  1590. </xsl:template>
  1591.  
  1592.  
  1593. <!-- =================== end of override stubs ====================== -->
  1594.  
  1595.  
  1596.  
  1597. <!-- =================== DEFAULT PAGE LAYOUT ====================== -->
  1598.  
  1599. <xsl:template name="chapter-setup">
  1600. <html lang="en-US"><xsl:value-of select="$newline"/>
  1601.   <head><xsl:value-of select="$newline"/>
  1602.     <meta http-equiv="generator" content="IBM Darwin Information Typing Architecture topic-to-html transform" /><xsl:value-of select="$newline"/>
  1603.     <meta name="copyright" content="(C) {$copyright}" /><xsl:value-of select="$newline"/>
  1604.     <meta name="security" content="public" /><xsl:value-of select="$newline"/>
  1605.     <xsl:variable name="shortdesc"><xsl:value-of select="normalize-space(descendant-or-self::*[contains(@class,' topic/shortdesc ')])"/></xsl:variable>
  1606.     <xsl:if test="not(string($shortdesc) = '')">
  1607.       <meta name="description" content="{$shortdesc}" /><xsl:value-of select="$newline"/>
  1608.     </xsl:if>
  1609.     <!-- call any other meta processors here -->
  1610.     <link rel="stylesheet" type="text/css" href="{$CSSPATH}{$default-css}" /><xsl:value-of select="$newline"/>
  1611.     <xsl:if test="string-length($CSS)>0">
  1612.      <link rel="stylesheet" type="text/css" href="{$CSSPATH}{$CSS}" /><xsl:value-of select="$newline"/>
  1613.     </xsl:if>
  1614.     <title>
  1615.       <xsl:call-template name="gen-user-panel-title-pfx"/>
  1616.       <xsl:call-template name="gen-main-panel-title"/>
  1617.     </title><xsl:value-of select="$newline"/>
  1618.     <!-- include scripts here -->
  1619.     <xsl:call-template name="gen-user-scripts" />
  1620.     <!-- include style element and content here -->
  1621.     <xsl:call-template name="gen-user-styles" />
  1622.   </head><xsl:value-of select="$newline"/>
  1623.   <body class="base"><xsl:value-of select="$newline"/>
  1624.   <xsl:apply-templates select="@id"/>
  1625.  
  1626.   <xsl:call-template name="gen-user-header"/>
  1627.     <!-- here, you can generate a toc based on what's a child of topic -->
  1628.     <!--xsl:call-template name="gen-user-sidetoc"/-->
  1629.  
  1630.     <xsl:apply-templates/> <!-- this will include all things within topic; therefore, -->
  1631.     <!-- title content will appear here by fall-through -->
  1632.     <!-- followed by prolog, if fall-through is permitted on it -->
  1633.     <!-- followed by body content, again by fall-through in document order -->
  1634.     <!-- finally, and child topics and includes will imbed here by fall-through -->
  1635.  
  1636.   <xsl:call-template name="gen-endnotes"/>
  1637.   <xsl:call-template name="gen-user-footer"/>
  1638.  
  1639.   </body><xsl:value-of select="$newline"/>
  1640. </html>
  1641. </xsl:template>
  1642.  
  1643. </xsl:transform>