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/rfc2629toXHTML.xslt

    r118 r189  
    501501  <div xmlns="http://www.w3.org/1999/xhtml" id="{$anch}"/>
    502502  <xsl:apply-templates/>
    503   <xsl:if test="@title!='' or @anchor!=''">
    504     <xsl:variable name="n"><xsl:number level="any" count="figure[@title!='' or @anchor!='']"/></xsl:variable>
     503  <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
     504    <xsl:variable name="n"><xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/></xsl:variable>
    505505    <p xmlns="http://www.w3.org/1999/xhtml" class="figure">Figure <xsl:value-of select="$n"/><xsl:if test="@title!=''">: <xsl:value-of select="@title"/></xsl:if></p>
    506506  </xsl:if>
     
    623623    <xsl:otherwise>
    624624      <xsl:value-of select="$anchor-prefix"/>.iref.<xsl:number level="any" count="iref[translate(substring(@item,1,1),concat($lcase,$ucase),'')='']"/>
     625    </xsl:otherwise>
     626  </xsl:choose>
     627</xsl:template>
     628
     629<xsl:template name="compute-extref-anchor">
     630  <xsl:variable name="first" select="translate(substring(.,1,1),$ucase,$lcase)"/>
     631  <xsl:variable name="nkey" select="translate($first,$lcase,'')"/>
     632  <xsl:choose>
     633    <xsl:when test="$nkey=''">
     634      <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)]"/>
     635    </xsl:when>
     636    <xsl:otherwise>
     637      <xsl:value-of select="$anchor-prefix"/>.extref.<xsl:number level="any" count="x:ref[translate(substring(.,1,1),concat($lcase,$ucase),'')='']"/>
    625638    </xsl:otherwise>
    626639  </xsl:choose>
     
    15941607        <xsl:variable name="figcnt">
    15951608          <xsl:for-each select="$node">
    1596             <xsl:number level="any" count="figure[@title!='' or @anchor!='']"/>
     1609            <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
    15971610          </xsl:for-each>
    15981611        </xsl:variable>
     
    16161629        <xsl:variable name="tabcnt">
    16171630          <xsl:for-each select="$node">
    1618             <xsl:number level="any" count="texttable[@title!='' or @anchor!='']"/>
     1631            <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
    16191632          </xsl:for-each>
    16201633        </xsl:variable>
     
    27272740            <xsl:call-template name="compute-iref-anchor"/>
    27282741          </xsl:when>
     2742          <xsl:when test="self::x:ref">
     2743            <xsl:text>#</xsl:text>
     2744            <xsl:call-template name="compute-extref-anchor"/>
     2745          </xsl:when>
    27292746          <xsl:otherwise>
    27302747            <xsl:message>Unsupported element type for insertSingleIref</xsl:message>
     
    29502967                        <xsl:variable name="irefs3" select="key('index-item',@item)[not(@subitem) or @subitem='']"/>
    29512968                        <xsl:variable name="xrefs3" select="//xref[@target=$irefs3[@x:for-anchor='']/../@anchor or @target=$irefs3/@x:for-anchor]"/>
    2952 
    2953                         <xsl:for-each select="$irefs3|$xrefs3">
     2969                        <xsl:variable name="extrefs3" select="//x:ref[.=$irefs3[@x:for-anchor='']/../@anchor or .=$irefs3/@x:for-anchor]"/>
     2970
     2971                        <xsl:for-each select="$irefs3|$xrefs3|$extrefs3">
    29542972                          <!-- <xsl:sort select="translate(@item,$lcase,$ucase)" />  -->
    29552973                          <xsl:call-template name="insertSingleIref"/>
     
    29812999                                  <xsl:variable name="irefs4" select="key('index-item-subitem',concat(@item,'..',@subitem))"/>
    29823000                                  <xsl:variable name="xrefs4" select="//xref[@target=$irefs4[@x:for-anchor='']/../@anchor or @target=$irefs4/@x:for-anchor]"/>
    2983 
    2984                                   <xsl:for-each select="$irefs4|$xrefs4">
     3001                                  <xsl:variable name="extrefs4" select="//x:ref[.=$irefs4[@x:for-anchor='']/../@anchor or .=$irefs4/@x:for-anchor]"/>
     3002
     3003                                  <xsl:for-each select="$irefs4|$xrefs4|$extrefs4">
    29853004                                    <!--<xsl:sort select="translate(@item,$lcase,$ucase)" />-->                   
    29863005                                    <xsl:call-template name="insertSingleIref"/>
     
    36163635  <xsl:variable name="val" select="."/>
    36173636  <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)]"/>
     3637  <xsl:variable name="irefs" select="//iref[@x:for-anchor=$val]"/>
    36183638  <xsl:choose>
    36193639    <xsl:when test="$target">
    3620       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target/@anchor}" class="smpl"><xsl:value-of select="."/></a>
     3640      <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target/@anchor}" class="smpl">
     3641        <!-- to be indexed? -->
     3642        <xsl:if test="$irefs">
     3643          <xsl:attribute name="id"><xsl:call-template name="compute-extref-anchor"/></xsl:attribute>
     3644        </xsl:if>
     3645        <xsl:value-of select="."/>
     3646      </a>
    36213647    </xsl:when>
    36223648    <xsl:otherwise>
     
    42824308    <xsl:apply-templates select="postamble"/>
    42834309
    4284     <xsl:if test="@title!='' or @anchor!=''">
    4285       <xsl:variable name="n"><xsl:number level="any" count="texttable[@title!='' or @anchor!='']"/></xsl:variable>
     4310    <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
     4311      <xsl:variable name="n"><xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/></xsl:variable>
    42864312      <p class="figure">Table <xsl:value-of select="$n"/><xsl:if test="@title!=''">: <xsl:value-of select="@title"/></xsl:if></p>
    42874313    </xsl:if>
     
    44894515    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    44904516    <!-- when RCS keyword substitution in place, add version info -->
    4491     <xsl:if test="contains('$Revision: 1.354 $',':')">
    4492       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.354 $', 'Revision: '),'$','')),', ')"/>
     4517    <xsl:if test="contains('$Revision: 1.356 $',':')">
     4518      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.356 $', 'Revision: '),'$','')),', ')"/>
    44934519    </xsl:if>
    4494     <xsl:if test="contains('$Date: 2007/12/31 13:43:05 $',':')">
    4495       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2007/12/31 13:43:05 $', 'Date: '),'$','')),', ')"/>
     4520    <xsl:if test="contains('$Date: 2008/02/03 13:29:11 $',':')">
     4521      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2008/02/03 13:29:11 $', 'Date: '),'$','')),', ')"/>
    44964522    </xsl:if>
    44974523    <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.