Ignore:
Timestamp:
Feb 3, 2008, 6:58:34 AM (12 years ago)
Author:
julian.reschke@…
Message:

Update to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629.xslt

    r118 r189  
    22    XSLT transformation from RFC2629 XML format to HTML
    33
    4     Copyright (c) 2006-2007, Julian Reschke (julian.reschke@greenbytes.de)
     4    Copyright (c) 2006-2008, Julian Reschke (julian.reschke@greenbytes.de)
    55    All rights reserved.
    66
     
    660660  <div id="{$anch}" />
    661661  <xsl:apply-templates />
    662   <xsl:if test="@title!='' or @anchor!=''">
    663     <xsl:variable name="n"><xsl:number level="any" count="figure[@title!='' or @anchor!='']" /></xsl:variable>
     662  <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
     663    <xsl:variable name="n"><xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]" /></xsl:variable>
    664664    <p class="figure">Figure <xsl:value-of select="$n"/><xsl:if test="@title!=''">: <xsl:value-of select="@title" /></xsl:if></p>
    665665  </xsl:if>
     
    782782    <xsl:otherwise>
    783783      <xsl:value-of select="$anchor-prefix"/>.iref.<xsl:number level="any" count="iref[translate(substring(@item,1,1),concat($lcase,$ucase),'')='']"/>
     784    </xsl:otherwise>
     785  </xsl:choose>
     786</xsl:template>
     787
     788<xsl:template name="compute-extref-anchor">
     789  <xsl:variable name="first" select="translate(substring(.,1,1),$ucase,$lcase)"/>
     790  <xsl:variable name="nkey" select="translate($first,$lcase,'')"/>
     791  <xsl:choose>
     792    <xsl:when test="$nkey=''">
     793      <xsl:value-of select="$anchor-prefix"/>.extref.<xsl:value-of select="$first"/>.<xsl:number level="any" count="x:ref[starts-with(translate(.,$ucase,$lcase),$first)]"/>
     794    </xsl:when>
     795    <xsl:otherwise>
     796      <xsl:value-of select="$anchor-prefix"/>.extref.<xsl:number level="any" count="x:ref[translate(substring(.,1,1),concat($lcase,$ucase),'')='']"/>
    784797    </xsl:otherwise>
    785798  </xsl:choose>
     
    17531766        <xsl:variable name="figcnt">
    17541767          <xsl:for-each select="$node">
    1755             <xsl:number level="any" count="figure[@title!='' or @anchor!='']" />
     1768            <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
    17561769          </xsl:for-each>
    17571770        </xsl:variable>
     
    17751788        <xsl:variable name="tabcnt">
    17761789          <xsl:for-each select="$node">
    1777             <xsl:number level="any" count="texttable[@title!='' or @anchor!='']" />
     1790            <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
    17781791          </xsl:for-each>
    17791792        </xsl:variable>
     
    28862899            <xsl:call-template name="compute-iref-anchor"/>
    28872900          </xsl:when>
     2901          <xsl:when test="self::x:ref">
     2902            <xsl:text>#</xsl:text>
     2903            <xsl:call-template name="compute-extref-anchor"/>
     2904          </xsl:when>
    28882905          <xsl:otherwise>
    28892906            <xsl:message>Unsupported element type for insertSingleIref</xsl:message>
     
    31093126                        <xsl:variable name="irefs3" select="key('index-item',@item)[not(@subitem) or @subitem='']"/>
    31103127                        <xsl:variable name="xrefs3" select="//xref[@target=$irefs3[@x:for-anchor='']/../@anchor or @target=$irefs3/@x:for-anchor]"/>
    3111 
    3112                         <xsl:for-each select="$irefs3|$xrefs3">
     3128                        <xsl:variable name="extrefs3" select="//x:ref[.=$irefs3[@x:for-anchor='']/../@anchor or .=$irefs3/@x:for-anchor]"/>
     3129
     3130                        <xsl:for-each select="$irefs3|$xrefs3|$extrefs3">
    31133131                          <!-- <xsl:sort select="translate(@item,$lcase,$ucase)" />  -->
    31143132                          <xsl:call-template name="insertSingleIref" />
     
    31403158                                  <xsl:variable name="irefs4" select="key('index-item-subitem',concat(@item,'..',@subitem))"/>
    31413159                                  <xsl:variable name="xrefs4" select="//xref[@target=$irefs4[@x:for-anchor='']/../@anchor or @target=$irefs4/@x:for-anchor]"/>
    3142 
    3143                                   <xsl:for-each select="$irefs4|$xrefs4">
     3160                                  <xsl:variable name="extrefs4" select="//x:ref[.=$irefs4[@x:for-anchor='']/../@anchor or .=$irefs4/@x:for-anchor]"/>
     3161
     3162                                  <xsl:for-each select="$irefs4|$xrefs4|$extrefs4">
    31443163                                    <!--<xsl:sort select="translate(@item,$lcase,$ucase)" />-->                   
    31453164                                    <xsl:call-template name="insertSingleIref" />
     
    37753794  <xsl:variable name="val" select="."/>
    37763795  <xsl:variable name="target" select="//*[(@anchor and x:anchor-alias/@value=$val) or (@anchor and ed:replace/ed:ins/x:anchor-alias/@value=$val) or (@anchor=$val)]"/>
     3796  <xsl:variable name="irefs" select="//iref[@x:for-anchor=$val]"/>
    37773797  <xsl:choose>
    37783798    <xsl:when test="$target">
    3779       <a href="#{$target/@anchor}" class="smpl"><xsl:value-of select="."/></a>
     3799      <a href="#{$target/@anchor}" class="smpl">
     3800        <!-- to be indexed? -->
     3801        <xsl:if test="$irefs">
     3802          <xsl:attribute name="id"><xsl:call-template name="compute-extref-anchor"/></xsl:attribute>
     3803        </xsl:if>
     3804        <xsl:value-of select="."/>
     3805      </a>
    37803806    </xsl:when>
    37813807    <xsl:otherwise>
     
    44414467    <xsl:apply-templates select="postamble" />
    44424468
    4443     <xsl:if test="@title!='' or @anchor!=''">
    4444       <xsl:variable name="n"><xsl:number level="any" count="texttable[@title!='' or @anchor!='']" /></xsl:variable>
     4469    <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
     4470      <xsl:variable name="n"><xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]" /></xsl:variable>
    44454471      <p class="figure">Table <xsl:value-of select="$n"/><xsl:if test="@title!=''">: <xsl:value-of select="@title" /></xsl:if></p>
    44464472    </xsl:if>
     
    46484674    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    46494675    <!-- when RCS keyword substitution in place, add version info -->
    4650     <xsl:if test="contains('$Revision: 1.354 $',':')">
    4651       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.354 $', 'Revision: '),'$','')),', ')" />
     4676    <xsl:if test="contains('$Revision: 1.356 $',':')">
     4677      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.356 $', 'Revision: '),'$','')),', ')" />
    46524678    </xsl:if>
    4653     <xsl:if test="contains('$Date: 2007/12/31 13:43:05 $',':')">
    4654       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2007/12/31 13:43:05 $', 'Date: '),'$','')),', ')" />
     4679    <xsl:if test="contains('$Date: 2008/02/03 13:29:11 $',':')">
     4680      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2008/02/03 13:29:11 $', 'Date: '),'$','')),', ')" />
    46554681    </xsl:if>
    46564682    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
Note: See TracChangeset for help on using the changeset viewer.