Advertisement
Guest User

Untitled

a guest
May 8th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 39.28 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="2.0"
  3.                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                xmlns:xs="http://www.w3.org/2001/XMLSchema"
  5.                xmlns:fn="http://www.w3.org/2005/xpath-functions"  
  6.                xmlns:ntw="Number2Word.uri"
  7.                exclude-result-prefixes="ntw">
  8.     <xsl:output method="html"/>
  9.     <xsl:strip-space elements="*"/>
  10.  
  11.  
  12.     <xsl:variable name="ThisDocument" select="document('')"/>
  13.  
  14.  
  15.     <xsl:template match="/">
  16.         <xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html>]]></xsl:text>
  17.  
  18.         <html>
  19.             <head>
  20.             <xsl:text disable-output-escaping="yes"><![CDATA[</meta>]]></xsl:text>
  21.             <title>
  22.                 <xsl:value-of select="chapter/title"/>
  23.             </title>
  24.             <link rel="stylesheet" href="C:\Users\u0138039\Desktop\Proview\SG\Commentary_SG_XML-03032014\SG-Walter Woon on Company Law (3rd ed)\XSLT\main.css" type="text/css"/>
  25.             <xsl:text disable-output-escaping="yes"><![CDATA[</link>]]></xsl:text>
  26.             </head>
  27.             <body>
  28.             <xsl:apply-templates/>
  29. <xsl:if test="//footnote">
  30.             <section class="tr_footnotes">
  31.                 <hr/>
  32.                 <xsl:apply-templates select="//footnote" mode="footnote"/>
  33.             </section>
  34.             </xsl:if>
  35.             </body>
  36.         </html>
  37.     </xsl:template>
  38.  
  39.     <xsl:template name="TitleCase">
  40.         <xsl:param name="text" />
  41.         <xsl:param name="lastletter" select="' '"/>
  42.         <xsl:if test="$text">
  43.             <xsl:variable name="thisletter" select="substring($text,1,1)"/>
  44.             <xsl:choose>
  45.                 <xsl:when test="$lastletter=' '">
  46.                     <xsl:value-of select="translate($thisletter,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  47.                 </xsl:when>
  48.                 <xsl:otherwise>
  49.                     <xsl:value-of select="$thisletter"/>
  50.                 </xsl:otherwise>
  51.             </xsl:choose>
  52.             <xsl:call-template name="TitleCase">
  53.                 <xsl:with-param name="text" select="substring($text,2)"/>
  54.                 <xsl:with-param name="lastletter" select="$thisletter"/>
  55.             </xsl:call-template>
  56.         </xsl:if>      
  57.     </xsl:template>
  58.  
  59.  
  60.     <xsl:template match="chapter">
  61.         <section class="tr_chapter">
  62.         <xsl:apply-templates select="./title[1]/page[1]"/>
  63.             <div class="chapter">
  64.                 <xsl:variable name="num_L">
  65.                     <xsl:value-of select="string-length(@num)"></xsl:value-of>
  66.                 </xsl:variable>
  67.                 <xsl:variable name="num_S">
  68.                     <xsl:choose>
  69.                         <xsl:when test="$num_L=1">
  70.                             <xsl:value-of select="concat('0',@num)"/>
  71.                         </xsl:when>
  72.                         <xsl:otherwise>
  73.                             <xsl:value-of select="@num"/>
  74.                         </xsl:otherwise>
  75.                     </xsl:choose>
  76.  
  77.                 </xsl:variable>
  78.                 <a name="LRSC_CH_{$num_S}"/>
  79.  
  80.                 <xsl:variable name="cnum">
  81.                     <xsl:choose>
  82.  
  83.                         <xsl:when test="starts-with(@num,'0')">
  84.                             <xsl:value-of select="substring-after(@num,'0')"/>
  85.                         </xsl:when>
  86.                         <xsl:otherwise>
  87.                             <xsl:value-of select="@num"/>
  88.                         </xsl:otherwise>
  89.                     </xsl:choose>
  90.                 </xsl:variable>
  91.                 <div class="chapter-title">
  92.                     <span class="chapter-num">
  93.                         <xsl:value-of select="normalize-space(concat('Chapter ',$cnum,' '))"/>
  94.                     </span>&#x00A0;
  95.                    
  96.                     <xsl:value-of select="./title/content-style/text()"/>
  97.                 </div>             
  98.                 <xsl:apply-templates select="child::node()[not(self::title)]"/>
  99.  
  100.             </div>
  101.         </section>
  102.     </xsl:template>
  103.  
  104.  
  105.  
  106.     <xsl:template match="chapter/para">
  107.         <xsl:variable name="for">
  108.             <xsl:value-of select="current()/@align"/>
  109.         </xsl:variable>
  110.         <div class="{concat('para align-',$for)}">
  111.             <xsl:apply-templates/>
  112.         </div>
  113.     </xsl:template>
  114.     <!-- Index templates -->
  115.     <xsl:template name="toc" match="chapter/toc">
  116.         <div class="toc">
  117.             <xsl:call-template name="toc-part"/>
  118.         </div>
  119.     </xsl:template>
  120.     <xsl:template name="toc-part" match="chapter/toc/toc-part">
  121.         <div class="toc-part">
  122.             <xsl:call-template name="toc-div"/>
  123.         </div>
  124.     </xsl:template>
  125.     <xsl:template name="toc-div" match="chapter/toc/toc-part/toc-div">
  126.         <table class="toc-div">
  127.             <tbody>
  128.                 <tr>
  129.                     <td>
  130.             <xsl:for-each select="current()/toc-part/toc-div/*">
  131.                 <xsl:call-template name="toc-item"/>
  132.             </xsl:for-each>
  133.             </td>
  134.             </tr>
  135.             </tbody>
  136.         </table>
  137.     </xsl:template>
  138.  
  139.  
  140.  
  141.     <xsl:template name="toc-item" match="chapter/toc/toc-part/toc-div/toc-item">
  142.         <xsl:variable name="tocpg">
  143.             <xsl:value-of select="concat('P',current()/toc-pg/text())"/>
  144.         </xsl:variable>
  145.         <xsl:variable name="tocpgtag" select="translate($tocpg,'.', '-')"/>
  146.         <xsl:variable name="chapternumber">
  147.             <!-- Get num attribute of parent node -->
  148.             <xsl:value-of select="ancestor::chapter[1]/@num"/>
  149.         </xsl:variable>
  150.     <xsl:variable name="strl">
  151.     <xsl:value-of select="string-length(substring-after(@num,'.'))"/>
  152.                 </xsl:variable>
  153.        
  154.         <xsl:variable name="Brac">
  155.             <xsl:choose>
  156.                 <xsl:when test="contains(substring-after(@num,'.'),'.')">
  157.                     <xsl:value-of select="3"/>
  158.                 </xsl:when>
  159.                 <xsl:when test="contains(@num,'(')">
  160.                     <xsl:value-of select="2"/>
  161.                 </xsl:when>
  162.                 <xsl:otherwise>
  163.                     <xsl:value-of select="1"/>
  164.                 </xsl:otherwise>
  165.             </xsl:choose>
  166.         </xsl:variable>
  167.         <xsl:variable name="NewL">
  168.             <xsl:value-of select="string-length(substring-before(current()/toc-pg,'.'))"/>
  169.         </xsl:variable>
  170.         <xsl:variable name="newNum">
  171.             <xsl:choose>
  172.                 <xsl:when test="$NewL=1">
  173.                     <xsl:value-of select="concat('0',substring-before(current()/toc-pg/text(),'.'))"/>
  174.                 </xsl:when>
  175.                 <xsl:otherwise>
  176.                     <xsl:value-of select="substring-before(current()/toc-pg/text(),'.')"/>
  177.  
  178.                 </xsl:otherwise>
  179.             </xsl:choose>
  180.  
  181.         </xsl:variable>
  182.         <xsl:variable name="d">
  183.             <xsl:value-of select="concat('toc-item-',$ThisDocument//ntw:nums[@num=$Brac]/@word,'-level')"/>
  184.         </xsl:variable>
  185.         <xsl:variable name="new">
  186.             <xsl:value-of select="concat('er:#LRSC_CH_',$newNum,'/',$tocpgtag)"/>
  187.         </xsl:variable>
  188.         <table class="{$d}">
  189.             <tbody>
  190.                 <tr>
  191.                     <td class="toc-item-num">
  192.             <xsl:value-of select="current()/@num"/>
  193.             </td>
  194.             <td class="toc-title">
  195.             <xsl:value-of select="current()/toc-title"/>
  196.             </td>
  197.               <xsl:variable name="toc-title" select="upper-case(current()/toc-title/text())" />
  198.  
  199.             <td class="toc-pg">
  200.             <xsl:variable name="refe">
  201.             <xsl:choose>
  202.        <xsl:when test="//section[title/*[upper-case(text()) = $toc-title]]/section[1]/para[1]/@num">
  203.             <xsl:value-of select="//section[title/*[upper-case(text()) = $toc-title]]/section[1]/para[1]/@num[1]"/>
  204.             </xsl:when>
  205.             <xsl:otherwise>
  206. <xsl:value-of select="//section[title/*[upper-case(text()) = $toc-title]]/para[1]/@num[1]"/>            
  207.             </xsl:otherwise>
  208.             </xsl:choose>
  209.               </xsl:variable>
  210.               <xsl:variable name="full">
  211.                   <xsl:value-of select="$refe"/>
  212.               </xsl:variable>
  213.               <xsl:variable name="pre">
  214. <xsl:value-of select="substring-before($refe,'.')"/>              
  215.               </xsl:variable>
  216.               <xsl:variable name="post">
  217.               <xsl:value-of select="substring-after($refe,'.')"/></xsl:variable>
  218.               <xsl:variable name="siz">
  219.                   <xsl:choose>
  220. <xsl:when test="$pre>'1'">
  221. <xsl:value-of select="concat('LRSC_CH_',$pre,'/P',translate($full,'.','-'))"></xsl:value-of>
  222. </xsl:when>
  223. <xsl:otherwise>
  224. <xsl:value-of select="concat('LRSC_CH_0',$pre,'/P',translate($full,'.','-'))"></xsl:value-of>
  225. </xsl:otherwise>                 
  226.                   </xsl:choose>
  227.               </xsl:variable>
  228.               <a href="{$siz}">
  229.                   <xsl:value-of select="./toc-pg"/>
  230.               </a>
  231.             </td>
  232.           </tr>
  233.             </tbody>
  234.         </table>
  235.         <xsl:if test="./toc-subitem">
  236.         <xsl:for-each select="./toc-subitem">
  237. <xsl:apply-templates select="."/>      
  238.  </xsl:for-each>
  239.         </xsl:if>
  240.         <!--</table>-->
  241.     </xsl:template>
  242.    
  243. <xsl:template match="toc-subitem">
  244.         <xsl:variable name="tocpg">
  245.             <xsl:value-of select="concat('P',current()/toc-pg/text())"/>
  246.         </xsl:variable>
  247.         <xsl:variable name="tocpgtag" select="translate($tocpg,'.', '-')"/>
  248.         <xsl:variable name="chapternumber">
  249.             <!-- Get num attribute of parent node -->
  250.             <xsl:value-of select="ancestor::chapter[1]/@num"/>
  251.         </xsl:variable>
  252.     <xsl:variable name="strl">
  253.     <xsl:value-of select="string-length(substring-after(@num,'.'))"/>
  254.                 </xsl:variable>
  255.        
  256.         <xsl:variable name="Brac">
  257.             <xsl:choose>
  258.                 <xsl:when test="contains(substring-after(@num,'.'),'.')">
  259.                     <xsl:value-of select="3"/>
  260.                 </xsl:when>
  261.                 <xsl:when test="contains(@num,'(')">
  262.                     <xsl:value-of select="2"/>
  263.                 </xsl:when>
  264.                 <xsl:otherwise>
  265.                     <xsl:value-of select="1"/>
  266.                 </xsl:otherwise>
  267.             </xsl:choose>
  268.         </xsl:variable>
  269.         <xsl:variable name="NewL">
  270.             <xsl:value-of select="string-length(substring-before(current()/toc-pg,'.'))"/>
  271.         </xsl:variable>
  272.         <xsl:variable name="newNum">
  273.             <xsl:choose>
  274.                 <xsl:when test="$NewL=1">
  275.                     <xsl:value-of select="concat('0',substring-before(current()/toc-pg/text(),'.'))"/>
  276.                 </xsl:when>
  277.                 <xsl:otherwise>
  278.                     <xsl:value-of select="substring-before(current()/toc-pg/text(),'.')"/>
  279.  
  280.                 </xsl:otherwise>
  281.             </xsl:choose>
  282.  
  283.         </xsl:variable>
  284.         <xsl:variable name="d">
  285.             <xsl:value-of select="concat('toc-item-',$ThisDocument//ntw:nums[@num='2']/@word,'-level')"/>
  286.         </xsl:variable>
  287.         <xsl:variable name="new">
  288.             <xsl:value-of select="concat('er:#LRSC_CH_',$newNum,'/',$tocpgtag)"/>
  289.         </xsl:variable>
  290.         <table class="{$d}">
  291.             <tbody>
  292.                 <tr>
  293.                     <td class="toc-item-num">
  294.             <xsl:value-of select="current()/@num"/>
  295.             </td>
  296.             <td class="toc-title">
  297.             <xsl:value-of select="current()/toc-title"/>
  298.             </td>
  299.      <xsl:variable name="toc-title" select="upper-case(current()/toc-title/*)" />
  300.             <td class="toc-pg">
  301.             <xsl:variable name="refe">
  302.             <xsl:choose>
  303.        <xsl:when test="//section[title/*[upper-case(text()) = $toc-title]]/section[1]/para[1]/@num[1]">
  304.             <xsl:value-of select="//section[title/*[upper-case(text()) = $toc-title]]/section[1]/para[1]/@num[1]"/>
  305.             </xsl:when>
  306.             <xsl:otherwise>
  307. <xsl:value-of select="//section[title/*[upper-case(text()) = $toc-title]]/para[1]/@num[1]"/>            
  308.             </xsl:otherwise>
  309.             </xsl:choose>
  310.               </xsl:variable>
  311.               <xsl:variable name="full">
  312.                   <xsl:value-of select="$refe"/>
  313.               </xsl:variable>
  314.               <xsl:variable name="pre">
  315. <xsl:value-of select="substring-before($refe,'.')"/>              
  316.               </xsl:variable>
  317.               <xsl:variable name="post">
  318.               <xsl:value-of select="substring-after($refe,'.')"/></xsl:variable>
  319.               <xsl:variable name="siz">
  320.                   <xsl:choose>
  321. <xsl:when test="$pre>'1'">
  322. <xsl:value-of select="concat('LRSC_CH_',$pre,'/P',translate($full,'.','-'))"></xsl:value-of>
  323. </xsl:when>
  324. <xsl:otherwise>
  325. <xsl:value-of select="concat('LRSC_CH_0',$pre,'/P',translate($full,'.','-'))"></xsl:value-of>
  326. </xsl:otherwise>                 
  327.                   </xsl:choose>
  328.               </xsl:variable>
  329.               <a href="{$siz}">
  330.                   <xsl:value-of select="./toc-pg"/>
  331.               </a>
  332.             </td>
  333.             </tr>
  334.             </tbody>
  335.         </table>
  336.         <xsl:if test="./toc-subitem">
  337. <xsl:apply-templates/>        
  338.         </xsl:if>
  339.         <!--</table>-->
  340.  
  341.  
  342. </xsl:template>
  343.  
  344.  
  345.  
  346.  
  347.  
  348.    
  349.    
  350.    
  351.     <!-- Index Templates Complete -->
  352.     <!-- Paragraph templates -->
  353.  
  354.     <xsl:template name="section" match="section">
  355.         <!-- Variables-->
  356.         <xsl:variable name="classname">
  357.             <!--Get name attribute of current node -->
  358.             <xsl:value-of select="concat('section-',@level)"/>
  359.         </xsl:variable>
  360.         <xsl:variable name="size">
  361.             <xsl:value-of select="string-length(ancestor::chapter[1]/@num)"/>
  362.         </xsl:variable>
  363.         <xsl:variable name="Chn">
  364.             <xsl:value-of select="ancestor::chapter[1]/@num"/>
  365.         </xsl:variable>
  366.         <xsl:variable name="chapternumber">
  367.             <!-- Get num attribute of parent node -->
  368.             <xsl:choose>
  369.                 <xsl:when test="$size=1">
  370.                     <xsl:value-of select="concat('0',$Chn)"/>
  371.  
  372.                 </xsl:when>
  373.                 <xsl:otherwise>
  374.                     <xsl:value-of select="$Chn"/>
  375.                 </xsl:otherwise>
  376.             </xsl:choose>
  377.  
  378.         </xsl:variable>
  379.         <xsl:variable name="sectnum">
  380.             <xsl:number level="any" count="section" format="1"/>
  381.         </xsl:variable>
  382.         <!--Create a string variable by concat string method  -->
  383.         <xsl:variable name="sectionname">
  384.             <xsl:value-of select="concat('CH_',$chapternumber,'-SEC-', $sectnum)"/>
  385.         </xsl:variable>
  386.         <!-- Template Content  -->
  387.  
  388.         <div class="{$classname}">
  389.             <a name="{$sectionname}"> </a>
  390.  
  391.             <div class="section-title">
  392.             <xsl:if test="not(contains(./@num,'unnumbered'))">
  393.                         <xsl:if test="./@num"> 
  394.                         <span class="section-num">
  395.                             <xsl:value-of select="@num"/>
  396.                         </span>
  397.                         <xsl:text> </xsl:text>
  398.                    
  399.                         </xsl:if>                  
  400.             </xsl:if>
  401.                    
  402.                 <xsl:apply-templates select="title"/>
  403.             </div>
  404.  
  405.             <xsl:apply-templates select="child::node()[not(self::title)]"/>
  406.         </div>
  407.  
  408.     </xsl:template>
  409.  
  410.     <xsl:template name="para" match="section/para">
  411.         <xsl:choose>
  412.             <xsl:when test="current()/@align">
  413.                 <div class="para align-{@align}">
  414.                     <xsl:apply-templates/>
  415.                 </div>
  416.             </xsl:when>
  417.             <xsl:when test="current()/@num">
  418.             <xsl:choose>
  419.             <xsl:when test="child::node()[1][self::*]">
  420.                                                     <xsl:apply-templates select="child::page[1]"/>
  421.                                                       <div class="para">
  422.                <xsl:call-template name="phrase"/>                                              
  423.                 <xsl:apply-templates select="child::node()[not(self::page)]"/>
  424.                 </div>
  425.                                                 </xsl:when>  
  426.                                                
  427.                 <xsl:otherwise>
  428.                  <div class="para">
  429.                      <xsl:call-template name="phrase"/>                                            
  430.                     <xsl:apply-templates/>
  431.                 </div>
  432.                 </xsl:otherwise>
  433.             </xsl:choose>
  434.            
  435.            
  436.  
  437.             </xsl:when>
  438.             <xsl:otherwise>
  439.                 <div class="para">
  440.                     <xsl:apply-templates/>
  441.                 </div>
  442.             </xsl:otherwise>
  443.         </xsl:choose>
  444.     </xsl:template>
  445.  
  446.  
  447.  
  448.    <xsl:template match="text()">
  449.    
  450.     <xsl:analyze-string select="." regex="(([Cc]hapter)\s(\d+))">
  451.  
  452.       <xsl:matching-substring>
  453.       <xsl:choose>
  454.                             <xsl:when test="number(regex-group(3)) &lt; 14">
  455.                                 <a href="{concat('er:#LRSC_CH_',format-number(number(regex-group(3)),'00'),'/','LRSC_CH_',format-number(number(regex-group(3)),'00'))}">
  456.           <xsl:value-of select="."/>
  457.         </a>
  458.                             </xsl:when>
  459.                             <xsl:otherwise>
  460.                                     <xsl:value-of select="."/>
  461.                                                 </xsl:otherwise>
  462.                         </xsl:choose>
  463.        
  464.       </xsl:matching-substring>
  465.      
  466.       <xsl:non-matching-substring>
  467.         <xsl:analyze-string select="." regex="([0-9]+)/([0-9]+)">
  468.           <xsl:matching-substring>
  469.          
  470.          
  471.             <a
  472.              href="{concat('er:#LRSC_CH_',format-number(number(regex-group(1)),'00'),'/P',format-number(number(regex-group(1)),'0'),'-',regex-group(2))}">
  473.               <xsl:value-of select="."/>
  474.             </a>
  475.          
  476.           </xsl:matching-substring>
  477.           <xsl:non-matching-substring>
  478.              
  479.           <xsl:analyze-string select="."  regex="http://[^ ]+">
  480.           <xsl:matching-substring>
  481.          <a href="{.}">
  482.                             <xsl:value-of select="."/>
  483.                                     </a>
  484.          
  485.           </xsl:matching-substring>
  486.           <xsl:non-matching-substring>
  487.              
  488.             <xsl:value-of select="."/>
  489.           </xsl:non-matching-substring>
  490.         </xsl:analyze-string>
  491.           </xsl:non-matching-substring>
  492.         </xsl:analyze-string>
  493.       </xsl:non-matching-substring>
  494.     </xsl:analyze-string>
  495.   </xsl:template>
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.     <xsl:template name="phraseExtract" match="section/extract">
  504.         <div class="extract">
  505.             <xsl:apply-templates/>
  506.         </div>
  507.     </xsl:template>
  508.  
  509.     <xsl:template name="newPh" match="extract/para">
  510.         <div class="para">
  511.             <xsl:apply-templates/>
  512.         </div>
  513.     </xsl:template>
  514.     <xsl:template match="para/case">
  515.         <xsl:apply-templates/>
  516.  
  517.     </xsl:template>
  518.  
  519.     <xsl:template name="ItemTex" match="itemizedlist">
  520.  
  521.         <ul class="itemizedlist">
  522.             <xsl:for-each select="item">
  523.                 <li class="item">
  524.                    
  525.                    
  526.                         <xsl:apply-templates/>  
  527.                    
  528.                 </li>
  529.             </xsl:for-each>
  530.         </ul>
  531.  
  532.     </xsl:template>
  533.  
  534.  
  535.     <xsl:template name="phrase">
  536. <xsl:choose>
  537.     <xsl:when test="parent::title">
  538.           <xsl:variable name="phrase">
  539.             <xsl:value-of select="concat('P',@num)"/>
  540.         </xsl:variable>
  541.         <xsl:variable name="newphrase" select="translate($phrase,'.','-')"/>
  542.         <a>
  543.             <xsl:attribute name="name">
  544.                 <xsl:value-of select="$newphrase">
  545.                 </xsl:value-of>
  546.             </xsl:attribute>
  547.         </a>
  548.         <span class="phrase1">
  549.             <xsl:value-of select="current()"/>
  550.         </span>
  551.     </xsl:when>
  552.     <xsl:otherwise>
  553.           <xsl:variable name="phrase">
  554.             <xsl:value-of select="concat('P',@num)"/>
  555.         </xsl:variable>
  556.         <xsl:variable name="newphrase" select="translate($phrase,'.','-')"/>
  557.         <a>
  558.             <xsl:attribute name="name">
  559.                 <xsl:value-of select="$newphrase">
  560.                 </xsl:value-of>
  561.             </xsl:attribute>
  562.         </a>
  563.         <span class="phrase">
  564.             <xsl:value-of select="current()/@num"/>
  565.         </span>
  566.     </xsl:otherwise>
  567. </xsl:choose>    
  568.     <!--<xsl:apply-templates/>-->
  569.      
  570.  
  571.     </xsl:template>
  572.  
  573.  
  574.  
  575.  
  576.     <!-- Table Templates  -->
  577.  
  578.     <xsl:template match="table|legtable|informaltable">
  579.         <table cellspacing="1">
  580.            
  581.             <xsl:attribute name="class">
  582.                 <xsl:choose>
  583.                     <xsl:when test="@frame = 'top'">frame-above</xsl:when>
  584.                     <xsl:when test="@frame = 'bottom'">frame-below</xsl:when>
  585.                     <xsl:when test="@frame = 'topbot'">frame-topbot</xsl:when>
  586.                     <xsl:when test="@frame = 'all'">frame-all</xsl:when>
  587.                     <xsl:when test="@frame = 'sides'">frame-vsides</xsl:when>
  588.                     <xsl:when test="@frame = 'none'">frame-none</xsl:when>
  589.                     <xsl:when test="local-name()='informaltable'">frame-box</xsl:when>
  590.                     <xsl:otherwise>void</xsl:otherwise>
  591.                 </xsl:choose>
  592.             </xsl:attribute><xsl:apply-templates/>
  593.         </table>
  594.     </xsl:template>
  595.  
  596. <!--
  597.  <xsl:template match="table/title | legtable/title | informaltable/title">
  598.    <caption>
  599.      <xsl:apply-templates/>
  600.    </caption>
  601.  </xsl:template>
  602. -->
  603.  
  604.     <xsl:template match="tgroup">
  605.         <colgroup>
  606.             <xsl:apply-templates select="colspec"/>
  607.         </colgroup>
  608.         <xsl:apply-templates select="thead"/>
  609.         <xsl:apply-templates select="tbody"/>
  610.         <xsl:apply-templates select="tfoot"/>
  611.     </xsl:template>
  612.  
  613.     <xsl:template match="tgroup/colspec">
  614.  
  615.               <col class="colnum-{current()/@colnum} colname-{current()/@colname} colwidth-{translate(current()/@colwidth,'%','')}"/>
  616.         <xsl:text disable-output-escaping="yes"><![CDATA[</col>]]></xsl:text>
  617.             <xsl:apply-templates/>
  618.  
  619.     </xsl:template>
  620.  
  621.     <xsl:template match="tgroup/thead">
  622.         <thead><xsl:if test="@valign">
  623.                 <xsl:attribute name="class">    <xsl:if test="@valign">
  624.                         <xsl:value-of select="@valign"/>
  625.                     </xsl:if>
  626.                 </xsl:attribute>
  627.             </xsl:if>
  628.             <xsl:apply-templates/>
  629.         </thead>
  630.     </xsl:template>
  631.  
  632.     <xsl:template match="tgroup/tbody">
  633.         <tbody>
  634.             <xsl:if test="@valign">
  635.                 <xsl:attribute name="class" select="@valign"/>
  636.             </xsl:if>
  637.             <xsl:apply-templates/>
  638.         </tbody>
  639.     </xsl:template>
  640.  
  641.     <xsl:template match="tgroup/tfoot">
  642.         <tfoot>
  643.             <xsl:if test="@valign">
  644.                 <xsl:attribute name="class" select="@valign"/>
  645.             </xsl:if>
  646.             <xsl:apply-templates/>
  647.         </tfoot>
  648.     </xsl:template>
  649.  
  650.     <xsl:template match="tgroup//row">
  651.         <tr>
  652.             <xsl:if test="@valign">
  653.                 <xsl:attribute name="class" select="@valign"/>
  654.             </xsl:if>
  655.             <xsl:if test="@rowsep = '1'">
  656.                 <xsl:attribute name="class" select="'rowsep'"/>
  657.             </xsl:if>
  658.             <!-- MH 14/1/2014 -->
  659.             <xsl:if test="@rowsep = '0'">
  660.                 <xsl:attribute name="class" select="'rownone'"/>
  661.             </xsl:if>
  662.             <xsl:apply-templates/>
  663.         </tr><xsl:text>
  664. </xsl:text>
  665.     </xsl:template>
  666.  
  667.     <xsl:template name="getColPosition">
  668.         <xsl:param name="column"/>
  669.         <xsl:param name="index" select="0"/>
  670.        
  671.         <xsl:variable name="colspan">
  672.             <xsl:choose>
  673.                 <xsl:when test="($index > 0) and $column/@namest and $column/@nameend">
  674.                     <xsl:variable name="namest" select="$column/@namest" />
  675.                     <xsl:variable name="nameend" select="$column/@nameend" />
  676.        
  677.                     <xsl:variable name="posStart">
  678.                         <xsl:for-each select="$column/ancestor::tgroup/colspec">
  679.                             <xsl:if test="lower-case(@colname) = lower-case($namest)">
  680.                                 <xsl:value-of select="position()"/>
  681.                             </xsl:if>
  682.                         </xsl:for-each>
  683.                     </xsl:variable>
  684.                     <xsl:variable name="posEnd">
  685.                         <xsl:for-each select="$column/ancestor::tgroup/colspec">
  686.                             <xsl:if test="lower-case(@colname) = lower-case($nameend)">
  687.                                 <xsl:value-of select="position()"/>
  688.                             </xsl:if>
  689.                         </xsl:for-each>
  690.                     </xsl:variable>
  691.                     <xsl:value-of select="number($posEnd) - number($posStart) + 1"/>
  692.                 </xsl:when>
  693.                 <xsl:otherwise>1</xsl:otherwise>
  694.             </xsl:choose>
  695.         </xsl:variable>
  696.        
  697.         <xsl:choose>
  698.             <xsl:when test="$column/preceding-sibling::entry[1]">
  699.                 <xsl:call-template name="getColPosition">
  700.                     <xsl:with-param name="column" select="$column/preceding-sibling::entry[1]"/>
  701.                     <xsl:with-param name="index" select="$colspan + $index"/>
  702.                 </xsl:call-template>
  703.             </xsl:when>
  704.             <xsl:otherwise><xsl:value-of select="$colspan + $index"/></xsl:otherwise>
  705.         </xsl:choose>
  706.     </xsl:template>
  707.  
  708.     <xsl:template match="tgroup//row/entry">
  709.         <xsl:choose>
  710.             <xsl:when test="ancestor::thead">
  711.                 <th>
  712.                     <xsl:if test="@morerows"><xsl:attribute name="rowspan" select="@morerows+1"/></xsl:if>
  713.                     <xsl:if test="@valign"><xsl:attribute name="valign" select="@valign"/></xsl:if>
  714.                     <xsl:if test="@align"><xsl:attribute name="class" select="concat('align-',@align)"/></xsl:if>
  715.                     <xsl:if test="@namest">
  716.                         <xsl:attribute name="colspan">
  717.                             <xsl:variable name="namest" select="@namest" />
  718.                             <xsl:variable name="nameend" select="@nameend" />
  719.  
  720.                             <xsl:variable name="posStart">
  721.                                 <xsl:for-each select="ancestor::tgroup/colspec">
  722.                                     <xsl:if test="lower-case(translate(@colname,'col','')) = lower-case($namest)">
  723.                                         <xsl:value-of select="position()"/>
  724.                                     </xsl:if>
  725.                                 </xsl:for-each>
  726.                             </xsl:variable>
  727.                             <xsl:variable name="posEnd">
  728.                                 <xsl:for-each select="ancestor::tgroup/colspec">
  729.                                     <xsl:if test="lower-case(translate(@colname,'col','')) = lower-case($nameend)">
  730.                                         <xsl:value-of select="position()"/>
  731.                                     </xsl:if>
  732.                                 </xsl:for-each>
  733.                             </xsl:variable>
  734.                             <xsl:choose>
  735.                                 <xsl:when test="$posEnd=''">
  736.                                     <xsl:message>
  737.                                         <xsl:text>TD missing @nameend
  738. </xsl:text>
  739.                                         <xsl:if test="ancestor-or-self::*[@uci]">
  740.                                             <xsl:text>The closest UCI is </xsl:text>
  741.                                             <xsl:value-of select="ancestor-or-self::*[@uci][1]/@uci"/>
  742.                                             <xsl:text>
  743. </xsl:text>
  744.                                         </xsl:if>
  745.                                     </xsl:message>
  746.                                     <xsl:text>1</xsl:text>
  747.                                 </xsl:when>
  748.                                 <xsl:when test="$posStart=''">
  749.                                     <xsl:message>
  750.                                         <xsl:text>TD missing @namest
  751. </xsl:text>
  752.                                         <xsl:if test="ancestor-or-self::*[@uci]">
  753.                                             <xsl:text>The closest UCI is </xsl:text>
  754.                                             <xsl:value-of select="ancestor-or-self::*[@uci][1]/@uci"/>
  755.                                             <xsl:text>
  756. </xsl:text>
  757.                                         </xsl:if>
  758.                                     </xsl:message>
  759.                                     <xsl:text>1</xsl:text>
  760.                                 </xsl:when>
  761.                                 <xsl:otherwise>
  762.                                     <xsl:value-of select="$posEnd - $posStart + 1"/>
  763.                                 </xsl:otherwise>
  764.                             </xsl:choose>
  765.                         </xsl:attribute>
  766.                     </xsl:if>
  767.            
  768.                     <xsl:variable name="curPosition">
  769.                         <xsl:call-template name="getColPosition">
  770.                             <xsl:with-param name="column" select="."/>
  771.                         </xsl:call-template>
  772.                         <!-- xsl:value-of select="position()"/ -->
  773.                     </xsl:variable>
  774.            
  775.                     <xsl:variable name="className">
  776.                         <xsl:choose>
  777.                             <xsl:when test="@colsep = '1' or ancestor::tgroup/@colsep = '1'">
  778.                                 <xsl:text>colsep </xsl:text>
  779.                             </xsl:when>
  780.                             <!-- MH 14/1/2014 -->
  781.                             <xsl:when test="@colsep = '0' or ancestor::tgroup/@colsep = '0'">
  782.                                 <xsl:text>colnone </xsl:text>
  783.                             </xsl:when>
  784.                             <xsl:when test="ancestor::tgroup/colspec[position() = $curPosition]/@colsep = '1'">
  785.                                 <xsl:text>colsep </xsl:text>
  786.                             </xsl:when>
  787.                         </xsl:choose>
  788.                         <xsl:choose>
  789.                             <xsl:when test="@rowsep = '1' or ancestor::tgroup/@rowsep = '1'">
  790.                                 <xsl:text>rowsep</xsl:text>
  791.                             </xsl:when>
  792.                             <!-- MH 14/1/2014 -->
  793.                             <xsl:when test="@rowsep = '0' or ancestor::tgroup/@rowsep = '0'">
  794.                                 <xsl:text>rownone</xsl:text>
  795.                             </xsl:when>
  796.                             <xsl:when test="ancestor::tgroup/colspec[position() = $curPosition]/@rowsep = '1'">
  797.                                 <xsl:text>rowsep</xsl:text>
  798.                             </xsl:when>
  799.                         </xsl:choose>
  800.                     </xsl:variable>
  801.                     <xsl:if test="$className != ''">
  802.                         <xsl:attribute name="class" select="$className"/>
  803.                     </xsl:if>
  804.            
  805.                     <xsl:variable name="alignment">
  806.                         <xsl:choose>
  807.                           <xsl:when test="@align">
  808.                             <xsl:value-of select="@align"/>
  809.                           </xsl:when>
  810.                           <xsl:when test="ancestor::tgroup/colspec[position() = $curPosition]/@align">
  811.                             <xsl:value-of select="ancestor::tgroup/colspec[position() = $curPosition]/@align"/>
  812.                           </xsl:when>
  813.                           <xsl:when test="ancestor::tgroup/@align">
  814.                             <xsl:value-of select="ancestor::tgroup/@align"/>
  815.                           </xsl:when>
  816.                         </xsl:choose>
  817.                     </xsl:variable>
  818.                     <xsl:if test="$alignment != ''">
  819.                         <xsl:attribute name="align" select="$alignment"/>
  820.                     </xsl:if>
  821.  
  822.                     <xsl:choose>
  823.                         <!-- Antony Suryadinata 21 June 2012 - Disabled outputting leaders -->
  824.                         <xsl:when test="symbol[@role='leader' and not(following-sibling::node())] and false()">
  825.                             <div class="not_used_leader">
  826.                                 <div class="item">
  827.                                     <xsl:apply-templates/>
  828.                                 </div>
  829.                                 <div class="ref">&#160;</div>
  830.                             </div>
  831.                         </xsl:when>
  832.                         <xsl:otherwise>
  833.                             <xsl:choose>
  834.                                 <xsl:when test="normalize-space(.) = ''">&#160;</xsl:when>
  835.                                 <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
  836.                             </xsl:choose>
  837.                         </xsl:otherwise>
  838.                     </xsl:choose>
  839.                 </th>
  840.             </xsl:when>
  841.             <xsl:otherwise>
  842.                 <td>
  843.                     <xsl:if test="@morerows"><xsl:attribute name="rowspan" select="@morerows+1"/></xsl:if>
  844.                     <xsl:if test="@valign"><xsl:attribute name="class" select="@valign"/></xsl:if>
  845.                     <xsl:if test="@namest">
  846.                         <xsl:attribute name="colspan">
  847.                             <xsl:variable name="namest" select="@namest" />
  848.                             <xsl:variable name="nameend" select="@nameend" />
  849.                    
  850.                             <xsl:variable name="posStart">
  851.                                 <xsl:for-each select="ancestor::tgroup/colspec">
  852.                                     <xsl:if test="lower-case(translate(@colname,'col','')) = lower-case($namest)">
  853.                                         <xsl:value-of select="position()"/>
  854.                                     </xsl:if>
  855.                                 </xsl:for-each>
  856.                             </xsl:variable>
  857.                             <xsl:variable name="posEnd">
  858.                                 <xsl:for-each select="ancestor::tgroup/colspec">
  859.                                     <xsl:if test="lower-case(translate(@colname,'col','')) = lower-case($nameend)">
  860.                                         <xsl:value-of select="position()"/>
  861.                                     </xsl:if>
  862.                                 </xsl:for-each>
  863.                             </xsl:variable>
  864.                             <xsl:choose>
  865.                                 <xsl:when test="$posEnd=''">
  866.                                     <xsl:message>
  867.                                         <xsl:text>TD missing @nameend
  868. </xsl:text>
  869.                                         <xsl:if test="ancestor-or-self::*[@uci]">
  870.                                             <xsl:text>The closest UCI is </xsl:text>
  871.                                             <xsl:value-of select="ancestor-or-self::*[@uci][1]/@uci"/>
  872.                                             <xsl:text>
  873. </xsl:text>
  874.                                         </xsl:if>
  875.                                     </xsl:message>
  876.                                     <xsl:text>1</xsl:text>
  877.                                 </xsl:when>
  878.                                 <xsl:when test="$posStart=''">
  879.                                     <xsl:message>
  880.                                         <xsl:text>TD missing @namest
  881. </xsl:text>
  882.                                         <xsl:if test="ancestor-or-self::*[@uci]">
  883.                                             <xsl:text>The closest UCI is </xsl:text>
  884.                                             <xsl:value-of select="ancestor-or-self::*[@uci][1]/@uci"/>
  885.                                             <xsl:text>
  886. </xsl:text>
  887.                                         </xsl:if>
  888.                                     </xsl:message>
  889.                                     <xsl:text>1</xsl:text>
  890.                                 </xsl:when>
  891.                                 <xsl:otherwise>
  892.                                     <xsl:value-of select="$posEnd - $posStart + 1"/>
  893.                                 </xsl:otherwise>
  894.                             </xsl:choose>
  895.                         </xsl:attribute>
  896.                     </xsl:if>
  897.        
  898.                     <xsl:variable name="curPosition">
  899.                         <xsl:call-template name="getColPosition">
  900.                             <xsl:with-param name="column" select="."/>
  901.                         </xsl:call-template>
  902.                         <!-- xsl:value-of select="position()"/ -->
  903.                     </xsl:variable>
  904.        
  905.                     <xsl:variable name="className">
  906.                         <xsl:choose>
  907.                             <xsl:when test="@colsep = '1' or ancestor::tgroup/@colsep = '1'">
  908.                                 <xsl:text>colsep </xsl:text>
  909.                             </xsl:when>
  910.                             <!-- MH 14/1/2014 -->
  911.                             <xsl:when test="@colsep = '0' or ancestor::tgroup/@colsep = '0'">
  912.                                 <xsl:text>colnone </xsl:text>
  913.                             </xsl:when>
  914.                         </xsl:choose>
  915.                         <xsl:choose>
  916.                             <xsl:when test="@rowsep = '1' or ancestor::tgroup/@rowsep = '1'">
  917.                                 <xsl:text>rowsep</xsl:text>
  918.                             </xsl:when>
  919.                             <!-- MH 14/1/2014 -->
  920.                             <xsl:when test="@rowsep = '0' or ancestor::tgroup/@rowsep = '0'">
  921.                                 <xsl:text>rownone</xsl:text>
  922.                             </xsl:when>
  923.                             <xsl:when test="ancestor::tgroup/colspec[position() = $curPosition]/@rowsep = '1'">
  924.                                 <xsl:text>rowsep</xsl:text>
  925.                             </xsl:when>
  926.                         </xsl:choose>
  927.                     </xsl:variable>
  928.                     <xsl:if test="$className != ''">
  929.                         <xsl:attribute name="class" select="$className"/>
  930.                     </xsl:if>
  931.  
  932.                     <xsl:variable name="alignment">
  933.                         <xsl:choose>
  934.                           <xsl:when test="@align">
  935.                             <xsl:value-of select="@align"/>
  936.                           </xsl:when>
  937.                           <xsl:when test="ancestor::tgroup/colspec[position() = $curPosition]/@align">
  938.                             <xsl:value-of select="ancestor::tgroup/colspec[position() = $curPosition]/@align"/>
  939.                           </xsl:when>
  940.                           <xsl:when test="ancestor::tgroup/@align">
  941.                             <xsl:value-of select="ancestor::tgroup/@align"/>
  942.                           </xsl:when>
  943.                         </xsl:choose>
  944.                     </xsl:variable>
  945.                     <xsl:if test="$alignment != ''">
  946.                         <xsl:attribute name="align" select="$alignment"/>
  947.                     </xsl:if>
  948.        
  949.                     <xsl:choose>
  950.                         <!-- Antony Suryadinata 21 June 2012 - Disabled outputting leaders -->
  951.                         <xsl:when test="symbol[@role='leader' and not(following-sibling::node())] and false()">
  952.                             <div class="not_used_leader">
  953.                                 <div class="item">
  954.                                     <xsl:apply-templates/>
  955.                                 </div>
  956.                                 <div class="ref">&#160;</div>
  957.                             </div>
  958.                         </xsl:when>
  959.                         <xsl:otherwise>
  960.                             <xsl:choose>
  961.                                 <xsl:when test="normalize-space(.) = ''">&#160;</xsl:when>
  962.                                 <xsl:otherwise>
  963.                            
  964.                                     <div class="para">
  965.                                     <xsl:apply-templates/>
  966.                                 </div>
  967.                            
  968.                                 </xsl:otherwise>
  969.                             </xsl:choose>
  970.                         </xsl:otherwise>
  971.                     </xsl:choose>
  972.                 </td>
  973.             </xsl:otherwise>
  974.         </xsl:choose>
  975.     </xsl:template>
  976.  
  977.     <!-- Table Templates complete  -->
  978.  
  979.  
  980.     <!--List templates -->
  981.  
  982.     <xsl:template name="orderedlist" match="orderedlist">
  983.         <ol class="eng-orderedlist orderedlist">
  984.             <xsl:apply-templates/>
  985.         </ol>
  986.     </xsl:template>
  987.  
  988.  
  989.  
  990.     <xsl:template name="orderitem" match="item">
  991. <xsl:choose>
  992.     <xsl:when test="./para[1]/page[1]">
  993.         <xsl:apply-templates select="./para[1]/page[1]"/>
  994.           <li class="item">
  995.         <xsl:apply-templates select="child::node()[fn:not(child::para/page[1])]"/>
  996.         </li>
  997.     </xsl:when>
  998.     <xsl:otherwise>
  999.    
  1000.               <li class="item">
  1001.         <xsl:apply-templates/>
  1002.         </li>
  1003.     </xsl:otherwise>
  1004. </xsl:choose>
  1005.  
  1006.      
  1007.     </xsl:template>
  1008.  
  1009.  
  1010.     <xsl:template name="orderitempara" match="item/para">
  1011.  
  1012.  
  1013. <xsl:choose>
  1014.     <xsl:when test="contains(../../@type,'manual')">
  1015.        
  1016.         <div class="para">
  1017.  
  1018.             <xsl:choose>
  1019.                 <xsl:when test="position()=1">
  1020.  
  1021.                     <span class="item-num">
  1022.                      <xsl:choose>
  1023.                                                                                         <xsl:when test="contains(parent::item[1]/@num,'bull')">
  1024.                                                                                            
  1025.                             <xsl:text>&#8226;</xsl:text>
  1026.                        
  1027.                                                                                         </xsl:when>
  1028.                                                                                         <xsl:otherwise>
  1029.                                                                                         <xsl:value-of select="parent::item[1]/@num"/>
  1030.                                                                                        
  1031.                                                                                         </xsl:otherwise>
  1032.                                                                                     </xsl:choose>
  1033.                     </span>
  1034.                     <xsl:text> </xsl:text>
  1035.                    
  1036.                     <xsl:apply-templates select="child::node()[not(self::page)]"/>
  1037.                 </xsl:when>
  1038.                 <xsl:otherwise>
  1039.                     <xsl:apply-templates/>
  1040.                 </xsl:otherwise>
  1041.             </xsl:choose>
  1042.  
  1043.         </div>
  1044.  
  1045.     </xsl:when>
  1046.  
  1047. <xsl:otherwise>
  1048. <span class="bullet-list">
  1049. <xsl:value-of select="../../@type"/>
  1050. </span>
  1051. <xsl:apply-templates/>
  1052. </xsl:otherwise>
  1053.  
  1054.  
  1055.    
  1056.    
  1057. </xsl:choose>
  1058.     </xsl:template>
  1059.     <!--List templates Complete -->
  1060.     <!-- Paragraph templates Complete -->
  1061.     <!-- Footnote Templates-->
  1062.     <xsl:template match="footnote">
  1063.         <xsl:variable name="varHeaderNote" select='concat("f",@num)'/>
  1064.         <xsl:variable name="varFootNote" select='concat("#ftn.",@num)'/>
  1065.         <sup><a name="{$varHeaderNote}" href="{$varFootNote}" class="tr_ftn"><xsl:value-of select="@num"/></a>
  1066.         </sup>
  1067. </xsl:template>
  1068.  
  1069.     <xsl:template match="footnote" mode="footnote">
  1070. <xsl:if test="preceding::node()[page[1]]">
  1071.    <xsl:variable name="op">&#60;</xsl:variable>
  1072. <xsl:variable name="apos">'</xsl:variable>
  1073. <xsl:variable name="cl">&#62;</xsl:variable>
  1074.  
  1075. <xsl:value-of select="concat($op,'?pb label=',$apos,preceding::page[1]/@num,$apos,'?',$cl)"/>
  1076.  
  1077.    </xsl:if>
  1078.  
  1079.         <div class="tr_footnote">
  1080.             <div class="footnote">
  1081.                 <sup>
  1082.                 <a>
  1083.                         <xsl:attribute name="name"><xsl:text>ftn.</xsl:text><xsl:value-of select="@num"/></xsl:attribute>
  1084.                         <xsl:attribute name="href"><xsl:text>#f</xsl:text><xsl:value-of select="@num"/></xsl:attribute>
  1085.                         <xsl:attribute name="class"><xsl:text>tr_ftn</xsl:text></xsl:attribute>
  1086.                         <xsl:value-of select="@num"/>
  1087.                     </a>
  1088.                 </sup>
  1089.                
  1090.              <xsl:apply-templates/>
  1091.             </div>
  1092.         </div>
  1093.     </xsl:template>
  1094.    
  1095.     <xsl:template match="footnote/para/uri">
  1096.  
  1097.         <xsl:variable name="url1">
  1098.             <xsl:value-of select="translate(@href, '&#x003C;','')" />
  1099.         </xsl:variable>
  1100.         <xsl:variable name="url2">
  1101.             <xsl:value-of select="translate($url1, '&#x003E;','')" />
  1102.         </xsl:variable>
  1103.         <a href="{$url2}">
  1104.             <xsl:value-of select="." />
  1105.         </a>
  1106.     </xsl:template>
  1107.     <!-- Footnote Templates Complete -->
  1108.     <xsl:template match="content-style">
  1109.        <xsl:choose>
  1110.                                 <xsl:when test="./@format">
  1111. <span class="format-{@format}">
  1112. <xsl:apply-templates/>
  1113. </span>                                
  1114.                                 </xsl:when>
  1115.                                 <xsl:otherwise>
  1116. <xsl:if test="preceding-sibling::content-style">
  1117.             <xsl:text>&#160;</xsl:text>
  1118.         </xsl:if>                          
  1119.         <xsl:variable name="fontStyle">
  1120.             <xsl:value-of select="concat('font-style-',@font-style)"/>
  1121.         </xsl:variable>
  1122.         <span class="{$fontStyle}">
  1123.             <xsl:apply-templates/>
  1124.         </span>
  1125. </xsl:otherwise>                               
  1126.                                 </xsl:choose>
  1127.        
  1128.  
  1129.     </xsl:template>
  1130.  
  1131. <xsl:template match="extract">
  1132. <div class="extract">
  1133. <xsl:apply-templates/>
  1134. </div>
  1135. </xsl:template>    
  1136.    
  1137.    
  1138.     <xsl:template name="fig" match="figure">
  1139.         <div class="figure">
  1140.         <!--<div class="figure-title">
  1141.         <xsl:value-of select="current()/title"/>
  1142.         </div>-->
  1143.             <xsl:variable name="numb">
  1144.             <xsl:value-of select="substring-before(graphic/@href,'.')"/>
  1145.             </xsl:variable>
  1146.         <xsl:variable name="figCon">
  1147.             <xsl:value-of select="concat('er:#',$numb)"/>
  1148.         </xsl:variable>
  1149.        
  1150.         <img class="graphic" src="{$figCon}" alt=""/>
  1151. <xsl:text disable-output-escaping="yes"><![CDATA[</img>]]></xsl:text>      
  1152.         </div>
  1153.        
  1154.     </xsl:template>
  1155.  
  1156. <xsl:template match="chapter-meta">
  1157.  
  1158. </xsl:template>
  1159.  
  1160. <xsl:template match="page">
  1161. <xsl:variable name="op">&#60;</xsl:variable>
  1162. <xsl:variable name="apos">'</xsl:variable>
  1163. <xsl:variable name="cl">&#62;</xsl:variable>
  1164. <xsl:value-of select="concat($op,'?pb label=',$apos,./@num,$apos,'?',$cl)"/>
  1165. <xsl:apply-templates/>
  1166. </xsl:template>  
  1167.  
  1168.    
  1169.    
  1170.    
  1171.     <!-- Namespace ntw-->
  1172.     <ntw:nums num="1" word="first"/>
  1173.     <ntw:nums num="2" word="second"/>
  1174.     <ntw:nums num="3" word="third"/>
  1175.     <ntw:nums num="4" word="forth"/>
  1176.     <ntw:nums num="5" word="fifth"/>
  1177.     <ntw:nums num="6" word="sixth"/>
  1178.     <ntw:nums num="7" word="seventh"/>
  1179.     <ntw:nums num="8" word="eighth"/>
  1180.     <ntw:nums num="9" word="nighth"/>
  1181.     <ntw:nums num="10" word="tenth"/>
  1182.     <!-- Namespace ntw ends -->
  1183. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement