Ignore:
Timestamp:
2007-02-07T13:29:17+13:00 (17 years ago)
Author:
lh92
Message:

updated XSLs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl-documentation/manuals/processing/common.xsl

    r13785 r13861  
    66 
    77  <xsl:template match="Title"><p><b><i><xsl:apply-templates/></i></b></p></xsl:template>
     8 
    89 
    910  <xsl:template match="Title" mode="Figure">
     
    1516  </xsl:template>
    1617 
     18 
    1719  <xsl:template match="Title" mode="Table">       
    1820    <div style="margin-right:1.7pt;" align="center">
    1921    <b>Table&#160;<xsl:number count="Table[not(@class='hidden')]" level="any"/>&#160;<xsl:apply-templates/></b></div>
    2022  </xsl:template>
     23 
    2124
    2225    <xsl:template match="NumberedList"><ol><xsl:apply-templates/></ol></xsl:template>
    2326  <xsl:template match="NumberedItem"><li><xsl:apply-templates/></li></xsl:template>
    2427
     28
    2529  <xsl:template match="BulletList">
    2630    <xsl:if test="not(parent::Bullet)">
    27     <ul style="list-style-type: disc;">
    28       <xsl:for-each select="Bullet">
    29         <li><xsl:apply-templates/></li>
     31    <ul style="list-style-type: disc;"><xsl:for-each select="Bullet"><li><xsl:apply-templates/></li>
    3032        <xsl:if test="BulletList">
    31         <xsl:for-each select="BulletList">
    32           <ul style="list-style-type: disc;"><xsl:for-each select="Bullet"><li><xsl:apply-templates/></li></xsl:for-each></ul>
    33         </xsl:for-each>
    34         </xsl:if>
    35       </xsl:for-each>
    36     </ul>
    37     <p/>
    38     </xsl:if>
     33        <xsl:for-each select="BulletList"><ul style="list-style-type: disc;"><xsl:for-each select="Bullet"><li><xsl:apply-templates/></li></xsl:for-each></ul>
     34        </xsl:for-each></xsl:if></xsl:for-each></ul><p/></xsl:if>
    3935  </xsl:template>
     36
    4037
    4138  <xsl:template match="Text">
    4239    <xsl:choose>
    43         <xsl:when test="parent::Indented">
    44           <p style="font-size=12px; color=black; text-align=justify; margin-left=15pt;"><xsl:apply-templates/></p>
    45         </xsl:when>
     40        <xsl:when test="parent::Indented"><p class="indented"><xsl:apply-templates/></p>    </xsl:when>
    4641        <xsl:when test="parent::Title|parent::Footnote"><xsl:apply-templates/></xsl:when>
    47         <xsl:when test="not(parent::Version) and not(parent::Date) and not(parent::NumberedItem) and not(parent::Bullet)">
    48             <p><xsl:apply-templates/></p>
    49         </xsl:when>
     42        <xsl:when test="not(parent::Version) and not(parent::Date) and not(parent::NumberedItem) and not(parent::Bullet)"><p><xsl:apply-templates/></p></xsl:when>
    5043        <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
    5144    </xsl:choose>   
    5245  </xsl:template>
    5346
     47
    5448  <xsl:template match="CodeLine"> 
    5549  <xsl:choose>
    56     <xsl:when test="parent::Figure or parent::th">
    57       <div style="margin-top:0pt; margin-right:0in; margin-bottom:0in; margin-left:2pt; margin-bottom:0pt;
    58     font-family: Courier; font-size: 11px"><xsl:apply-templates/></div>
    59     </xsl:when>     
    60     <xsl:when test="name(preceding-sibling::*[position()=1])='CodeLine' or name(following-sibling::*[position()=1])='CodeLine'">
    61      
    62         <div style="margin-top:0pt; margin-right:0pt; margin-bottom:0pt; margin-left:2em; font-size:10px; font-family:Courier;"><xsl:apply-templates/></div>
    63      
    64     </xsl:when>     
     50  <!-- codeline in figure or table -->
     51    <xsl:when test="parent::Figure or parent::th"><div class="codeline_figure"><xsl:apply-templates/></div></xsl:when>     
     52    <!-- consecutive codelines -->
     53    <xsl:when test="name(preceding-sibling::*[position()=1])='CodeLine' or name(following-sibling::*[position()=1])='CodeLine'"><div class="codeline"><xsl:apply-templates/></div></xsl:when>     
    6554    <!-- a single line of code between two text paragraphs -->
    66     <xsl:otherwise>
    67       <p><div style="font-size:10px; margin-right:0pt; margin-left:2em; margin-bottom:2px; margin-top:2px; font-family:Courier;">
    68     <xsl:apply-templates/></div></p>     
    69   </xsl:otherwise>
     55    <xsl:otherwise><div class="codeline_single"><xsl:apply-templates/></div></xsl:otherwise>
    7056  </xsl:choose> 
    7157  </xsl:template>
     58 
    7259
    7360  <xsl:template match="Figure">
     
    7865            <xsl:number count="Figure[Title/SubTitle and substring(translate(@id, '_0123456789', '99999999999'), string-length(@id)-1, string-length(@id))='99']" level="any"/>
    7966    </xsl:variable>         
    80     <xsl:variable name="no"><xsl:value-of select="$temp_total_figs - $temp_num_of_sub_figs"/></xsl:variable>   
     67    <xsl:variable name="no"><xsl:value-of select="$temp_total_figs - $temp_num_of_sub_figs"/></xsl:variable>
     68       
    8169    <p/>       
    8270    <xsl:apply-templates select="Title" mode="Figure"><xsl:with-param name="no" select="$no"/></xsl:apply-templates>
     
    8775        <tr>
    8876        <xsl:if test="parent::Figure[@class='withLineNumber']">
    89         <td><div style="linenumber"><xsl:number value="position()" format="1"/>&#160;&#160;</div></td></xsl:if>
     77        <td><div class="linenumber"><xsl:number value="position()" format="1"/>&#160;&#160;</div></td></xsl:if>
    9078        <td><xsl:apply-templates select="."/></td></tr>
    9179      </xsl:for-each>
     
    9886  </xsl:template>
    9987
     88
    10089  <xsl:template match="Table">
    101     <p/>
    102     <a id="Table_{@id}"/>
     90    <p/><a id="Table_{@id}"/>
    10391    <xsl:if test="not(@class='hidden') and not(normalize-space(Title/Text)='')"><xsl:apply-templates select="Title" mode="Table"/></xsl:if>
    10492    <table cellpadding="2pt" cellspacing="2pt">
    105         <xsl:if test="not(@class='hidden')">
     93    <xsl:if test="not(@class='hidden')">
    10694      <xsl:if test="not(../../@class='hidden')"><xsl:attribute name="style">border-collapse:collapse;border:1px solid black;</xsl:attribute></xsl:if>
    10795      <xsl:attribute name="rules">rows</xsl:attribute><xsl:attribute name="align">center</xsl:attribute>       
    10896    </xsl:if>
    10997    <xsl:if test="@class='hidden'"><xsl:attribute name="width">90%</xsl:attribute><xsl:attribute name="align">center</xsl:attribute></xsl:if>
    110         <xsl:for-each select="TableContent/tr">
    111           <tr>
     98    <xsl:for-each select="TableContent/tr">
     99    <tr>
    112100      <xsl:if test="not(../../@class='hidden')"><xsl:attribute name="style">border-collapse:collapse;border:1px solid black;</xsl:attribute></xsl:if>
    113           <xsl:for-each select="th"><td valign="top"><xsl:if test="File"><xsl:attribute name="align">right</xsl:attribute></xsl:if>
    114           <xsl:apply-templates select="node()"/></td></xsl:for-each>
     101    <xsl:for-each select="th"><td valign="top"><xsl:if test="File"><xsl:attribute name="align">right</xsl:attribute></xsl:if>
     102    <xsl:apply-templates select="node()"/></td></xsl:for-each>
    115103      </tr>
    116     </xsl:for-each>
     104    </xsl:for-each>
    117105    </table>
    118106    <br/>
    119107  </xsl:template>
    120108   
     109
    121110  <xsl:template match="Section">     
    122     <a name="Section_{@id}"/>
    123     <h3><xsl:if test="not(starts-with(../../@id, 'appendix'))">
     111    <a name="Section_{@id}"/><h3><xsl:if test="not(starts-with(../../@id, 'appendix'))">
    124112    <xsl:number level="multiple" format="1.1" count="//Chapter|//Chapter//Section"/>&#160;</xsl:if>
    125     <xsl:apply-templates select="Title/Text"/></h3>
    126     <xsl:apply-templates select="Content/*"/>
     113    <xsl:apply-templates select="Title/Text"/></h3><xsl:apply-templates select="Content/*"/>
    127114  </xsl:template>
     115
    128116
    129117  <xsl:template match="Section" mode="preface">   
     
    131119    <xsl:apply-templates select="Content/*"/>
    132120  </xsl:template>
     121
    133122
    134123  <xsl:template match="Subsection">
     
    138127  </xsl:template>
    139128 
     129 
    140130  <xsl:template match="Part"><a id="Part_{@id}"/><xsl:apply-templates/></xsl:template>   
    141 
    142131  <xsl:template match="Comment"><xsl:apply-templates/></xsl:template> 
    143132  <xsl:template match="Indented"><p><div style="margin-left: 1em;"><xsl:apply-templates/></div></p></xsl:template>
     
    146135  </xsl:template>
    147136  <xsl:template match="i|b|u"><xsl:element name="{name()}"><xsl:apply-templates/></xsl:element></xsl:template> 
    148   <xsl:template match="File"><a href="{@url}" target="_blank"><img src="../{@url}" width="{@width}" height="{@height}" border="0"/></a></xsl:template>
    149  
    150  
    151  
    152   <xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
    153  
     137  <xsl:template match="File"><a href="../{@url}" target="_blank"><img src="../{@url}" width="{@width}" height="{@height}" border="0"/></a></xsl:template>
     138  <xsl:template match="text()"><xsl:value-of select="."/></xsl:template> 
    154139  <xsl:template match="Author"><b><xsl:apply-templates/></b></xsl:template>
    155140  <xsl:template match="Affiliation"><i><xsl:apply-templates/></i></xsl:template>
    156   <xsl:template name="version_and_date"><p><b><xsl:apply-templates select="Version/Text"/></b>&#160;&#160;<xsl:apply-templates select="Date/Text"/></p></xsl:template>
     141  <xsl:template name="version_and_date"><p><b><xsl:apply-templates select="Version/Text"/></b>&#160;&#160;<xsl:apply-templates select="Date/Text"/></p></xsl:template> 
     142 
    157143 
    158144  <xsl:template match="Chapter|Appendix|Bibliography" mode="index">
     
    161147</xsl:template>
    162148
     149
    163150  <xsl:template match="Section" mode="index">
    164151  <dt><a href="#Section_{@id}"><xsl:apply-templates select="Title/Text"/></a></dt> 
    165152  </xsl:template>
     153
    166154
    167155<xsl:template match="Chapter">
     
    171159  <xsl:apply-templates select="Content/*"/>
    172160</xsl:template>
    173 
    174161 
    175162
     
    185172    <xsl:value-of select="concat($no, $subtitle)"/>
    186173  </xsl:template> 
    187   <xsl:template match="Table" mode="ref"><xsl:number level="any"/></xsl:template>
     174  <xsl:template match="Table" mode="ref"><xsl:number count="Table[not(@class='hidden')]" level="any"/></xsl:template>
    188175  <xsl:template match="Chapter" mode="ref"><xsl:number level="any"/></xsl:template>
    189176  <xsl:template match="Section" mode="ref"><xsl:number count="//Chapter|//Chapter//Section" format="1.1" level="multiple"/></xsl:template>
     
    191178 
    192179 
    193   <xsl:template match="SupplementaryText">
     180<xsl:template match="SupplementaryText">
    194181    <xsl:param name="manual_id" select="''"/>
    195182    <xsl:param name="manual_lang" select="''"/>     
     
    201188    </xsl:for-each>
    202189  </xsl:template>
    203  
    204190</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.