home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _06D01E8611BA4214BBBAACB9F964D8BE < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  10.4 KB  |  393 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: block.xsl,v 1.1.2.1 2002/09/04 13:50:11 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. <!-- ==================================================================== -->
  16.  
  17. <xsl:template name="block.object">
  18.   <div class="{name(.)}">
  19.     <xsl:call-template name="anchor"/>
  20.     <xsl:apply-templates/>
  21.   </div>
  22. </xsl:template>
  23.  
  24. <!-- ==================================================================== -->
  25.  
  26. <xsl:template match="para">
  27.   <xsl:variable name="p">
  28.     <p>
  29.       <xsl:if test="@role and $para.propagates.style != 0">
  30.         <xsl:attribute name="class">
  31.           <xsl:value-of select="@role"/>
  32.         </xsl:attribute>
  33.       </xsl:if>
  34.  
  35.       <xsl:if test="position() = 1 and parent::listitem">
  36.         <xsl:call-template name="anchor">
  37.           <xsl:with-param name="node" select="parent::listitem"/>
  38.         </xsl:call-template>
  39.       </xsl:if>
  40.  
  41.       <xsl:call-template name="anchor"/>
  42.       <xsl:apply-templates/>
  43.     </p>
  44.   </xsl:variable>
  45.  
  46.   <xsl:choose>
  47.     <xsl:when test="$html.cleanup != 0">
  48.       <xsl:call-template name="unwrap.p">
  49.         <xsl:with-param name="p" select="$p"/>
  50.       </xsl:call-template>
  51.     </xsl:when>
  52.     <xsl:otherwise>
  53.       <xsl:copy-of select="$p"/>
  54.     </xsl:otherwise>
  55.   </xsl:choose>
  56. </xsl:template>
  57.  
  58. <xsl:template match="simpara">
  59.   <!-- see also listitem/simpara in lists.xsl -->
  60.   <p>
  61.     <xsl:if test="@role and $para.propagates.style != 0">
  62.       <xsl:attribute name="class">
  63.         <xsl:value-of select="@role"/>
  64.       </xsl:attribute>
  65.     </xsl:if>
  66.  
  67.     <xsl:call-template name="anchor"/>
  68.     <xsl:apply-templates/>
  69.   </p>
  70. </xsl:template>
  71.  
  72. <xsl:template match="formalpara">
  73.   <p>
  74.     <xsl:if test="@role and $para.propagates.style != 0">
  75.       <xsl:attribute name="class">
  76.         <xsl:value-of select="@role"/>
  77.       </xsl:attribute>
  78.     </xsl:if>
  79.  
  80.     <xsl:call-template name="anchor"/>
  81.     <xsl:apply-templates/>
  82.   </p>
  83. </xsl:template>
  84.  
  85. <xsl:template match="formalpara/title">
  86.   <xsl:variable name="titleStr" select="."/>
  87.   <xsl:variable name="lastChar">
  88.     <xsl:if test="$titleStr != ''">
  89.       <xsl:value-of select="substring($titleStr,string-length($titleStr),1)"/>
  90.     </xsl:if>
  91.   </xsl:variable>
  92.  
  93.   <b>
  94.     <xsl:apply-templates/>
  95.     <xsl:if test="$lastChar != ''
  96.                   and not(contains($runinhead.title.end.punct, $lastChar))">
  97.       <xsl:value-of select="$runinhead.default.title.end.punct"/>
  98.     </xsl:if>
  99.     <xsl:text> </xsl:text>
  100.   </b>
  101. </xsl:template>
  102.  
  103. <xsl:template match="formalpara/para">
  104.   <xsl:apply-templates/>
  105. </xsl:template>
  106.  
  107. <!-- ==================================================================== -->
  108.  
  109. <xsl:template match="blockquote">
  110.   <xsl:call-template name="anchor"/>
  111.   <xsl:choose>
  112.     <xsl:when test="attribution">
  113.       <table border="0" width="100%"
  114.          cellspacing="0" cellpadding="0" class="blockquote"
  115.              summary="Block quote">
  116.     <tr>
  117.       <td width="10%" valign="top"> </td>
  118.       <td width="80%" valign="top">
  119.         <xsl:apply-templates
  120.           select="child::*[local-name(.)!='attribution']"/>
  121.       </td>
  122.       <td width="10%" valign="top"> </td>
  123.     </tr>
  124.     <tr>
  125.       <td colspan="2" align="right" valign="top">
  126.         <xsl:text>--</xsl:text>
  127.         <xsl:apply-templates select="attribution"/>
  128.       </td>
  129.       <td width="10%" valign="top"> </td>
  130.     </tr>
  131.       </table>
  132.     </xsl:when>
  133.     <xsl:otherwise>
  134.       <blockquote class="blockquote">
  135.     <xsl:apply-templates/>
  136.       </blockquote>
  137.     </xsl:otherwise>
  138.   </xsl:choose>
  139. </xsl:template>
  140.  
  141. <xsl:template match="blockquote/title">
  142.   <div class="blockquote-title">
  143.     <p>
  144.       <b>
  145.         <xsl:apply-templates/>
  146.       </b>
  147.     </p>
  148.   </div>
  149. </xsl:template>
  150.  
  151. <xsl:template match="epigraph">
  152.   <div class="{name(.)}">
  153.     <xsl:apply-templates select="para"/>
  154.     <span>--<xsl:apply-templates select="attribution"/></span>
  155.   </div>
  156. </xsl:template>
  157.  
  158. <xsl:template match="attribution">
  159.   <span class="{name(.)}"><xsl:apply-templates/></span>
  160. </xsl:template>
  161.  
  162. <!-- ==================================================================== -->
  163.  
  164. <xsl:template match="sidebar">
  165.   <div class="{name(.)}">
  166.     <xsl:call-template name="anchor"/>
  167.     <xsl:apply-templates/>
  168.   </div>
  169. </xsl:template>
  170.  
  171. <xsl:template match="sidebar/title">
  172.   <p class="title">
  173.     <b><xsl:apply-templates/></b>
  174.   </p>
  175. </xsl:template>
  176.  
  177. <!-- ==================================================================== -->
  178.  
  179. <xsl:template match="abstract">
  180.   <div class="{name(.)}">
  181.     <xsl:call-template name="anchor"/>
  182.     <xsl:call-template name="formal.object.heading">
  183.       <xsl:with-param name="title">
  184.         <xsl:apply-templates select="." mode="title.markup">
  185.           <xsl:with-param name="allow-anchors" select="'1'"/>
  186.         </xsl:apply-templates>
  187.       </xsl:with-param>
  188.     </xsl:call-template>
  189.     <xsl:apply-templates/>
  190.   </div>
  191. </xsl:template>
  192.  
  193. <xsl:template match="abstract/title">
  194. </xsl:template>
  195.  
  196. <!-- ==================================================================== -->
  197.  
  198. <xsl:template match="msgset">
  199.   <xsl:apply-templates/>
  200. </xsl:template>
  201.  
  202. <xsl:template match="msgentry">
  203.   <xsl:call-template name="block.object"/>
  204. </xsl:template>
  205.  
  206. <xsl:template match="simplemsgentry">
  207.   <xsl:call-template name="block.object"/>
  208. </xsl:template>
  209.  
  210. <xsl:template match="msg">
  211.   <xsl:call-template name="block.object"/>
  212. </xsl:template>
  213.  
  214. <xsl:template match="msgmain">
  215.   <xsl:apply-templates/>
  216. </xsl:template>
  217.  
  218. <xsl:template match="msgmain/title">
  219.   <b><xsl:apply-templates/></b>
  220. </xsl:template>
  221.  
  222. <xsl:template match="msgsub">
  223.   <xsl:apply-templates/>
  224. </xsl:template>
  225.  
  226. <xsl:template match="msgsub/title">
  227.   <b><xsl:apply-templates/></b>
  228. </xsl:template>
  229.  
  230. <xsl:template match="msgrel">
  231.   <xsl:apply-templates/>
  232. </xsl:template>
  233.  
  234. <xsl:template match="msgrel/title">
  235.   <b><xsl:apply-templates/></b>
  236. </xsl:template>
  237.  
  238. <xsl:template match="msgtext">
  239.   <xsl:apply-templates/>
  240. </xsl:template>
  241.  
  242. <xsl:template match="msginfo">
  243.   <xsl:call-template name="block.object"/>
  244. </xsl:template>
  245.  
  246. <xsl:template match="msglevel">
  247.   <p>
  248.     <b>
  249.       <xsl:call-template name="gentext.template">
  250.         <xsl:with-param name="context" select="'msgset'"/>
  251.         <xsl:with-param name="name" select="'MsgLevel'"/>
  252.       </xsl:call-template>
  253.     </b>
  254.     <xsl:apply-templates/>
  255.   </p>
  256. </xsl:template>
  257.  
  258. <xsl:template match="msgorig">
  259.   <p>
  260.     <b>
  261.       <xsl:call-template name="gentext.template">
  262.         <xsl:with-param name="context" select="'msgset'"/>
  263.         <xsl:with-param name="name" select="'MsgOrig'"/>
  264.       </xsl:call-template>
  265.     </b>
  266.     <xsl:apply-templates/>
  267.   </p>
  268. </xsl:template>
  269.  
  270. <xsl:template match="msgaud">
  271.   <p>
  272.     <b>
  273.       <xsl:call-template name="gentext.template">
  274.         <xsl:with-param name="context" select="'msgset'"/>
  275.         <xsl:with-param name="name" select="'MsgAud'"/>
  276.       </xsl:call-template>
  277.     </b>
  278.     <xsl:apply-templates/>
  279.   </p>
  280. </xsl:template>
  281.  
  282. <xsl:template match="msgexplan">
  283.   <xsl:call-template name="block.object"/>
  284. </xsl:template>
  285.  
  286. <xsl:template match="msgexplan/title">
  287.   <p><b><xsl:apply-templates/></b></p>
  288. </xsl:template>
  289.  
  290. <!-- ==================================================================== -->
  291.  
  292. <xsl:template match="revhistory">
  293.   <div class="{name(.)}">
  294.     <table border="0" width="100%" summary="Revision history">
  295.       <tr>
  296.         <th align="left" valign="top" colspan="3">
  297.           <b>
  298.             <xsl:call-template name="gentext">
  299.               <xsl:with-param name="key" select="'RevHistory'"/>
  300.             </xsl:call-template>
  301.           </b>
  302.         </th>
  303.       </tr>
  304.       <xsl:apply-templates/>
  305.     </table>
  306.   </div>
  307. </xsl:template>
  308.  
  309. <xsl:template match="revhistory/revision">
  310.   <xsl:variable name="revnumber" select=".//revnumber"/>
  311.   <xsl:variable name="revdate"   select=".//date"/>
  312.   <xsl:variable name="revauthor" select=".//authorinitials"/>
  313.   <xsl:variable name="revremark" select=".//revremark|../revdescription"/>
  314.   <tr>
  315.     <td align="left">
  316.       <xsl:if test="$revnumber">
  317.         <xsl:call-template name="gentext">
  318.           <xsl:with-param name="key" select="'Revision'"/>
  319.         </xsl:call-template>
  320.         <xsl:call-template name="gentext.space"/>
  321.         <xsl:apply-templates select="$revnumber"/>
  322.       </xsl:if>
  323.     </td>
  324.     <td align="left">
  325.       <xsl:apply-templates select="$revdate"/>
  326.     </td>
  327.     <xsl:choose>
  328.       <xsl:when test="count($revauthor)=0">
  329.         <td align="left">
  330.           <xsl:call-template name="dingbat">
  331.             <xsl:with-param name="dingbat">nbsp</xsl:with-param>
  332.           </xsl:call-template>
  333.         </td>
  334.       </xsl:when>
  335.       <xsl:otherwise>
  336.         <td align="left">
  337.           <xsl:apply-templates select="$revauthor"/>
  338.         </td>
  339.       </xsl:otherwise>
  340.     </xsl:choose>
  341.   </tr>
  342.   <xsl:if test="$revremark">
  343.     <tr>
  344.       <td align="left" colspan="3">
  345.         <xsl:apply-templates select="$revremark"/>
  346.       </td>
  347.     </tr>
  348.   </xsl:if>
  349. </xsl:template>
  350.  
  351. <xsl:template match="revision/revnumber">
  352.   <xsl:apply-templates/>
  353. </xsl:template>
  354.  
  355. <xsl:template match="revision/date">
  356.   <xsl:apply-templates/>
  357. </xsl:template>
  358.  
  359. <xsl:template match="revision/authorinitials">
  360.   <xsl:text>, </xsl:text>
  361.   <xsl:apply-templates/>
  362. </xsl:template>
  363.  
  364. <xsl:template match="revision/authorinitials[1]" priority="2">
  365.   <xsl:apply-templates/>
  366. </xsl:template>
  367.  
  368. <xsl:template match="revision/revremark">
  369.   <xsl:apply-templates/>
  370. </xsl:template>
  371.  
  372. <xsl:template match="revision/revdescription">
  373.   <xsl:apply-templates/>
  374. </xsl:template>
  375.  
  376. <!-- ==================================================================== -->
  377.  
  378. <xsl:template match="ackno">
  379.   <p class="{name(.)}">
  380.     <xsl:apply-templates/>
  381.   </p>
  382. </xsl:template>
  383.  
  384. <!-- ==================================================================== -->
  385.  
  386. <xsl:template match="highlights">
  387.   <xsl:call-template name="block.object"/>
  388. </xsl:template>
  389.  
  390. <!-- ==================================================================== -->
  391.  
  392. </xsl:stylesheet>
  393.