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

  1. <?xml version="1.0" encoding="US-ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets. Do not edit this file.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sverb="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Verbatim" xmlns:xverb="com.nwalsh.xalan.Verbatim" xmlns:lxslt="http://xml.apache.org/xslt" exclude-result-prefixes="sverb xverb lxslt" version="1.0">
  5.  
  6. <!-- ********************************************************************
  7.      $Id: callout.xsl,v 1.1.2.3 2002/09/04 13:55:33 jdj Exp $
  8.      ********************************************************************
  9.  
  10.      This file is part of the XSL DocBook Stylesheet distribution.
  11.      See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  12.      and other information.
  13.  
  14.      ******************************************************************** -->
  15.  
  16. <lxslt:component prefix="xverb" functions="insertCallouts"/>
  17.  
  18. <xsl:template match="programlistingco|screenco">
  19.   <xsl:variable name="verbatim" select="programlisting|screen"/>
  20.  
  21.   <xsl:choose>
  22.     <xsl:when test="$use.extensions != '0'                     and $callouts.extension != '0'">
  23.       <xsl:variable name="rtf">
  24.         <xsl:apply-templates select="$verbatim">
  25.           <xsl:with-param name="suppress-numbers" select="'1'"/>
  26.         </xsl:apply-templates>
  27.       </xsl:variable>
  28.  
  29.       <xsl:variable name="rtf-with-callouts">
  30.         <xsl:choose>
  31.           <xsl:when test="function-available('sverb:insertCallouts')">
  32.             <xsl:copy-of select="sverb:insertCallouts(areaspec,$rtf)"/>
  33.           </xsl:when>
  34.           <xsl:when test="function-available('xverb:insertCallouts')">
  35.             <xsl:copy-of select="xverb:insertCallouts(areaspec,$rtf)"/>
  36.           </xsl:when>
  37.           <xsl:otherwise>
  38.             <xsl:message terminate="yes">
  39.               <xsl:text>No insertCallouts function is available.</xsl:text>
  40.             </xsl:message>
  41.           </xsl:otherwise>
  42.         </xsl:choose>
  43.       </xsl:variable>
  44.  
  45.       <xsl:choose>
  46.         <xsl:when test="$verbatim/@linenumbering = 'numbered'                         and $linenumbering.extension != '0'">
  47.           <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
  48.             <xsl:call-template name="number.rtf.lines">
  49.               <xsl:with-param name="rtf" select="$rtf-with-callouts"/>
  50.               <xsl:with-param name="pi.context" select="programlisting|screen"/>
  51.             </xsl:call-template>
  52.             <xsl:apply-templates select="calloutlist"/>
  53.           </div>
  54.         </xsl:when>
  55.         <xsl:otherwise>
  56.           <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
  57.             <xsl:copy-of select="$rtf-with-callouts"/>
  58.             <xsl:apply-templates select="calloutlist"/>
  59.           </div>
  60.         </xsl:otherwise>
  61.       </xsl:choose>
  62.     </xsl:when>
  63.     <xsl:otherwise>
  64.       <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}">
  65.         <xsl:apply-templates/>
  66.       </div>
  67.     </xsl:otherwise>
  68.   </xsl:choose>
  69. </xsl:template>
  70.  
  71. <xsl:template match="areaspec|areaset|area">
  72. </xsl:template>
  73.  
  74. <xsl:template match="areaset" mode="conumber">
  75.   <xsl:number count="area|areaset" format="1"/>
  76. </xsl:template>
  77.  
  78. <xsl:template match="area" mode="conumber">
  79.   <xsl:number count="area|areaset" format="1"/>
  80. </xsl:template>
  81.  
  82. <xsl:template match="co">
  83.   <!-- Support a single linkend in HTML -->
  84.   <xsl:variable name="targets" select="key('id', @linkends)"/>
  85.   <xsl:variable name="target" select="$targets[1]"/>
  86.   <xsl:choose>
  87.     <xsl:when test="$target">
  88.       <a xmlns="http://www.w3.org/1999/xhtml">
  89.         <xsl:if test="@id">
  90.           <xsl:attribute name="id">
  91.             <xsl:value-of select="@id"/>
  92.           </xsl:attribute>
  93.         </xsl:if>
  94.         <xsl:attribute name="href">
  95.           <xsl:call-template name="href.target">
  96.             <xsl:with-param name="object" select="$target"/>
  97.           </xsl:call-template>
  98.         </xsl:attribute>
  99.         <xsl:apply-templates select="." mode="callout-bug"/>
  100.       </a>
  101.     </xsl:when>
  102.     <xsl:otherwise>
  103.       <xsl:call-template name="anchor"/>
  104.       <xsl:apply-templates select="." mode="callout-bug"/>
  105.     </xsl:otherwise>
  106.   </xsl:choose>
  107. </xsl:template>
  108.  
  109.  
  110.  
  111.  
  112. <xsl:template match="co" mode="callout-bug">
  113.   <xsl:call-template name="callout-bug">
  114.     <xsl:with-param name="conum">
  115.       <xsl:number count="co" format="1"/>
  116.     </xsl:with-param>
  117.   </xsl:call-template>
  118. </xsl:template>
  119.  
  120. <xsl:template name="callout-bug">
  121.   <xsl:param name="conum" select="1"/>
  122.  
  123.   <xsl:choose>
  124.     <xsl:when test="$callout.graphics != 0                     and $conum <= $callout.graphics.number.limit">
  125.       <img xmlns="http://www.w3.org/1999/xhtml" src="{$callout.graphics.path}{$conum}{$callout.graphics.extension}" alt="{$conum}" border="0"/>
  126.     </xsl:when>
  127.     <xsl:when test="$callout.unicode != 0                     and $conum <= $callout.unicode.number.limit">
  128.       <xsl:choose>
  129.         <xsl:when test="$callout.unicode.start.character = 10102">
  130.           <xsl:choose>
  131.             <xsl:when test="$conum = 1">❶</xsl:when>
  132.             <xsl:when test="$conum = 2">❷</xsl:when>
  133.             <xsl:when test="$conum = 3">❸</xsl:when>
  134.             <xsl:when test="$conum = 4">❹</xsl:when>
  135.             <xsl:when test="$conum = 5">❺</xsl:when>
  136.             <xsl:when test="$conum = 6">❻</xsl:when>
  137.             <xsl:when test="$conum = 7">❼</xsl:when>
  138.             <xsl:when test="$conum = 8">❽</xsl:when>
  139.             <xsl:when test="$conum = 9">❾</xsl:when>
  140.             <xsl:when test="$conum = 10">❿</xsl:when>
  141.           </xsl:choose>
  142.         </xsl:when>
  143.         <xsl:otherwise>
  144.           <xsl:message>
  145.             <xsl:text>Don't know how to generate Unicode callouts </xsl:text>
  146.             <xsl:text>when $callout.unicode.start.character is </xsl:text>
  147.             <xsl:value-of select="$callout.unicode.start.character"/>
  148.           </xsl:message>
  149.           <xsl:text>(</xsl:text>
  150.           <xsl:value-of select="$conum"/>
  151.           <xsl:text>)</xsl:text>
  152.         </xsl:otherwise>
  153.       </xsl:choose>
  154.     </xsl:when>
  155.     <xsl:otherwise>
  156.       <xsl:text>(</xsl:text>
  157.       <xsl:value-of select="$conum"/>
  158.       <xsl:text>)</xsl:text>
  159.     </xsl:otherwise>
  160.   </xsl:choose>
  161. </xsl:template>
  162.  
  163. </xsl:stylesheet>
  164.