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

  1. <?xml version='1.0'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 version='1.0'>
  4.  
  5. <!-- ********************************************************************
  6.      $Id: pi.xsl,v 1.1.2.1 2002/09/04 13:50:53 jdj Exp $
  7.      ********************************************************************
  8.  
  9.      This file is part of the XSL DocBook Stylesheet distribution.
  10.      See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  11.      and other information.
  12.  
  13.      ******************************************************************** -->
  14.  
  15. <xsl:template match="processing-instruction()">
  16. </xsl:template>
  17.  
  18. <xsl:template match="processing-instruction('dbhtml')">
  19.   <!-- nop -->
  20. </xsl:template>
  21.  
  22. <!-- ==================================================================== -->
  23.  
  24. <xsl:template name="dbhtml-attribute">
  25.   <xsl:param name="pis" select="processing-instruction('dbhtml')"/>
  26.   <xsl:param name="attribute">filename</xsl:param>
  27.  
  28.   <xsl:call-template name="pi-attribute">
  29.     <xsl:with-param name="pis" select="$pis"/>
  30.     <xsl:with-param name="attribute" select="$attribute"/>
  31.   </xsl:call-template>
  32. </xsl:template>
  33.  
  34. <xsl:template name="dbhtml-filename">
  35.   <xsl:param name="pis" select="./processing-instruction('dbhtml')"/>
  36.   <xsl:call-template name="dbhtml-attribute">
  37.     <xsl:with-param name="pis" select="$pis"/>
  38.     <xsl:with-param name="attribute">filename</xsl:with-param>
  39.   </xsl:call-template>
  40. </xsl:template>
  41.  
  42. <!--
  43. <xsl:template name="dbhtml-dir">
  44.   <xsl:param name="pis" select="./processing-instruction('dbhtml')"/>
  45.   <xsl:call-template name="dbhtml-attribute">
  46.     <xsl:with-param name="pis" select="$pis"/>
  47.     <xsl:with-param name="attribute">dir</xsl:with-param>
  48.   </xsl:call-template>
  49. </xsl:template>
  50. -->
  51.  
  52. <xsl:template name="dbhtml-dir">
  53.   <xsl:param name="context" select="."/>
  54.  
  55.   <!-- directories are now inherited from previous levels -->
  56.  
  57.   <xsl:variable name="ppath">
  58.     <xsl:if test="$context/parent::*">
  59.       <xsl:call-template name="dbhtml-dir">
  60.         <xsl:with-param name="context" select="$context/parent::*"/>
  61.       </xsl:call-template>
  62.     </xsl:if>
  63.   </xsl:variable>
  64.  
  65.   <xsl:variable name="path">
  66.     <xsl:call-template name="dbhtml-attribute">
  67.       <xsl:with-param name="pis" select="$context/processing-instruction('dbhtml')"/>
  68.       <xsl:with-param name="attribute">dir</xsl:with-param>
  69.     </xsl:call-template>
  70.   </xsl:variable>
  71.  
  72.   <xsl:choose>
  73.     <xsl:when test="$path = ''">
  74.       <xsl:if test="$ppath != ''">
  75.         <xsl:value-of select="$ppath"/>
  76.       </xsl:if>
  77.     </xsl:when>
  78.     <xsl:otherwise>
  79.       <xsl:if test="$ppath != ''">
  80.         <xsl:value-of select="$ppath"/>
  81.         <xsl:if test="substring($ppath, string-length($ppath), 1) != '/'">
  82.           <xsl:text>/</xsl:text>
  83.         </xsl:if>
  84.       </xsl:if>
  85.       <xsl:value-of select="$path"/>
  86.       <xsl:text>/</xsl:text>
  87.     </xsl:otherwise>
  88.   </xsl:choose>
  89. </xsl:template>
  90.  
  91. <!-- ==================================================================== -->
  92.  
  93. <xsl:template name="process.cmdsynopsis.list">
  94.   <xsl:param name="cmdsynopses"/><!-- empty node list by default -->
  95.   <xsl:param name="count" select="1"/>
  96.  
  97.   <xsl:choose>
  98.     <xsl:when test="$count>count($cmdsynopses)"></xsl:when>
  99.     <xsl:otherwise>
  100.       <xsl:variable name="cmdsyn" select="$cmdsynopses[$count]"/>
  101.  
  102.        <dt>
  103.        <a>
  104.          <xsl:attribute name="href">
  105.            <xsl:call-template name="object.id">
  106.              <xsl:with-param name="object" select="$cmdsyn"/>
  107.            </xsl:call-template>
  108.          </xsl:attribute>
  109.  
  110.          <xsl:choose>
  111.            <xsl:when test="$cmdsyn/@xreflabel">
  112.              <xsl:call-template name="xref.xreflabel">
  113.                <xsl:with-param name="target" select="$cmdsyn"/>
  114.              </xsl:call-template>
  115.            </xsl:when>
  116.            <xsl:otherwise>
  117.              <xsl:apply-templates select="$cmdsyn" mode="xref-to">
  118.                <xsl:with-param name="target" select="$cmdsyn"/>
  119.              </xsl:apply-templates>
  120.            </xsl:otherwise>
  121.          </xsl:choose>
  122.        </a>
  123.        </dt>
  124.  
  125.         <xsl:call-template name="process.cmdsynopsis.list">
  126.           <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/>
  127.           <xsl:with-param name="count" select="$count+1"/>
  128.         </xsl:call-template>
  129.       </xsl:otherwise>
  130.     </xsl:choose>
  131. </xsl:template>
  132.  
  133. <xsl:template match="processing-instruction('dbcmdlist')">
  134.   <xsl:variable name="cmdsynopses" select="..//cmdsynopsis"/>
  135.  
  136.   <xsl:if test="count($cmdsynopses)<1">
  137.     <xsl:message><xsl:text>No cmdsynopsis elements matched dbcmdlist PI, perhaps it's nested too deep?</xsl:text>
  138.     </xsl:message>
  139.   </xsl:if>
  140.  
  141.   <dl>
  142.     <xsl:call-template name="process.cmdsynopsis.list">
  143.       <xsl:with-param name="cmdsynopses" select="$cmdsynopses"/>
  144.     </xsl:call-template>
  145.   </dl>
  146. </xsl:template>
  147.  
  148. <!-- ==================================================================== -->
  149.  
  150. <xsl:template name="process.funcsynopsis.list">
  151.   <xsl:param name="funcsynopses"/><!-- empty node list by default -->
  152.   <xsl:param name="count" select="1"/>
  153.  
  154.   <xsl:choose>
  155.     <xsl:when test="$count>count($funcsynopses)"></xsl:when>
  156.     <xsl:otherwise>
  157.       <xsl:variable name="cmdsyn" select="$funcsynopses[$count]"/>
  158.  
  159.        <dt>
  160.        <a>
  161.          <xsl:attribute name="href">
  162.            <xsl:call-template name="object.id">
  163.              <xsl:with-param name="object" select="$cmdsyn"/>
  164.            </xsl:call-template>
  165.          </xsl:attribute>
  166.  
  167.          <xsl:choose>
  168.            <xsl:when test="$cmdsyn/@xreflabel">
  169.              <xsl:call-template name="xref.xreflabel">
  170.                <xsl:with-param name="target" select="$cmdsyn"/>
  171.              </xsl:call-template>
  172.            </xsl:when>
  173.            <xsl:otherwise>
  174.               <xsl:apply-templates select="$cmdsyn" mode="xref-to">
  175.                 <xsl:with-param name="target" select="$cmdsyn"/>
  176.               </xsl:apply-templates>
  177.            </xsl:otherwise>
  178.          </xsl:choose>
  179.        </a>
  180.        </dt>
  181.  
  182.         <xsl:call-template name="process.funcsynopsis.list">
  183.           <xsl:with-param name="funcsynopses" select="$funcsynopses"/>
  184.           <xsl:with-param name="count" select="$count+1"/>
  185.         </xsl:call-template>
  186.       </xsl:otherwise>
  187.     </xsl:choose>
  188. </xsl:template>
  189.  
  190. <xsl:template match="processing-instruction('dbfunclist')">
  191.   <xsl:variable name="funcsynopses" select="..//funcsynopsis"/>
  192.  
  193.   <xsl:if test="count($funcsynopses)<1">
  194.     <xsl:message><xsl:text>No funcsynopsis elements matched dbfunclist PI, perhaps it's nested too deep?</xsl:text>
  195.     </xsl:message>
  196.   </xsl:if>
  197.  
  198.   <dl>
  199.     <xsl:call-template name="process.funcsynopsis.list">
  200.       <xsl:with-param name="funcsynopses" select="$funcsynopses"/>
  201.     </xsl:call-template>
  202.   </dl>
  203. </xsl:template>
  204.  
  205. <!-- ==================================================================== -->
  206.  
  207. </xsl:stylesheet>
  208.