Ignore:
Timestamp:
01/07/10 13:30:11 (10 years ago)
Author:
julian.reschke@…
Message:

Bump up document dates, update to latest version of rfc2629.xslt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629toXHTML.xslt

    r799 r832  
    300300<xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'"/>
    301301<xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>       
     302<xsl:variable name="digits" select="'0123456789'"/>
    302303
    303304<!-- build help keys for indices -->
     
    882883    <xsl:apply-templates select="title"/>
    883884    <xsl:if test="/rfc/@docName">
     885      <xsl:variable name="docname" select="/rfc/@docName"/>
     886
    884887      <br/>
    885       <span class="filename"><xsl:value-of select="/rfc/@docName"/></span>
     888      <span class="filename"><xsl:value-of select="$docname"/></span>
    886889     
    887       <xsl:if test="contains(/rfc/@docName,'.')">
     890      <xsl:variable name="docname-noext">
     891        <xsl:choose>
     892          <xsl:when test="contains($docname,'.')">
     893            <xsl:call-template name="warning">
     894              <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should contain the base name, not the filename (thus no file extension).</xsl:with-param>
     895              <xsl:with-param name="inline" select="'no'"/>
     896            </xsl:call-template>
     897            <xsl:value-of select="substring-before($docname,'.')"/>
     898          </xsl:when>
     899          <xsl:otherwise>
     900            <xsl:value-of select="$docname"/>
     901          </xsl:otherwise>
     902        </xsl:choose>
     903      </xsl:variable>
     904     
     905      <!-- more name checks -->
     906      <xsl:variable name="offending" select="translate($docname,concat($lcase,$digits,'-.'),'')"/>
     907      <xsl:if test="$offending != ''">
    888908        <xsl:call-template name="warning">
    889           <xsl:with-param name="msg">The @docName attribute should contain the base name, not the filename (thus no file extension).</xsl:with-param>
     909          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should not contain the character '<xsl:value-of select="substring($offending,1,1)"/>'.</xsl:with-param>
     910          <xsl:with-param name="inline" select="'no'"/>
    890911        </xsl:call-template>
    891912      </xsl:if>
     913     
     914     
     915      <xsl:if test="contains($docname,'--')">
     916        <xsl:call-template name="warning">
     917          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should not contain the character sequence '--'.</xsl:with-param>
     918          <xsl:with-param name="inline" select="'no'"/>
     919        </xsl:call-template>
     920      </xsl:if>
     921
     922      <xsl:if test="not(starts-with($docname,'draft-'))">
     923        <xsl:call-template name="warning">
     924          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should start with 'draft-'.</xsl:with-param>
     925          <xsl:with-param name="inline" select="'no'"/>
     926        </xsl:call-template>
     927      </xsl:if>
     928     
     929      <!-- sequence number -->
     930      <xsl:variable name="seq">
     931        <xsl:choose>
     932          <xsl:when test="substring($docname-noext,string-length($docname-noext) + 1 - string-length('-latest'))='-latest'">latest</xsl:when>
     933          <xsl:when test="substring($docname-noext,string-length($docname-noext) - 2, 1)='-'"><xsl:value-of select="substring($docname-noext,string-length($docname-noext)-1)"/></xsl:when>
     934          <xsl:otherwise/>
     935        </xsl:choose>
     936      </xsl:variable>
     937
     938      <xsl:if test="$seq='' or ($seq!='latest' and translate($seq,$digits,'')!='')">
     939        <xsl:call-template name="warning">
     940          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should end with a two-digit sequence number or 'latest'.</xsl:with-param>
     941          <xsl:with-param name="inline" select="'no'"/>
     942        </xsl:call-template>
     943      </xsl:if>
     944
     945      <xsl:if test="string-length($docname)-string-length($seq) &gt; 50">
     946        <xsl:call-template name="warning">
     947          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>', excluding sequence number, should have less than 50 characters.</xsl:with-param>
     948          <xsl:with-param name="inline" select="'no'"/>
     949        </xsl:call-template>
     950      </xsl:if>
     951     
    892952    </xsl:if> 
    893953  </p>
     
    13591419          <xsl:call-template name="format-initials"/>
    13601420        </xsl:variable>
     1421        <xsl:variable name="truncated-initials" select="concat(substring-before($initials,'.'),'.')"/>
    13611422     
    13621423        <xsl:choose>
     
    13661427              <xsl:choose>
    13671428                <xsl:when test="position()=last() and position()!=1">
    1368                   <xsl:value-of select="concat($initials,' ',@surname)"/>
     1429                  <xsl:value-of select="concat($truncated-initials,' ',@surname)"/>
    13691430                </xsl:when>
    13701431                <xsl:otherwise>
    1371                   <xsl:value-of select="concat(@surname,', ',$initials)"/>
     1432                  <xsl:value-of select="concat(@surname,', ',$truncated-initials)"/>
    13721433                </xsl:otherwise>
    13731434              </xsl:choose>
     
    25282589      <xsl:call-template name="format-initials"/>
    25292590    </xsl:variable>
     2591    <xsl:variable name="truncated-initials" select="concat(substring-before($initials,'.'),'.')"/>
    25302592    <xsl:if test="@surname">
    25312593      <myns:item>
    2532         <xsl:value-of select="concat($initials,' ',@surname)"/>
     2594        <xsl:value-of select="concat($truncated-initials,' ',@surname)"/>
    25332595        <xsl:if test="@role">
    25342596          <xsl:choose>
     
    59766038    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    59776039    <!-- when RCS keyword substitution in place, add version info -->
    5978     <xsl:if test="contains('$Revision: 1.517 $',':')">
    5979       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.517 $', 'Revision: '),'$','')),', ')"/>
     6040    <xsl:if test="contains('$Revision: 1.518 $',':')">
     6041      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.518 $', 'Revision: '),'$','')),', ')"/>
    59806042    </xsl:if>
    5981     <xsl:if test="contains('$Date: 2010-03-31 18:24:38 $',':')">
    5982       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-03-31 18:24:38 $', 'Date: '),'$','')),', ')"/>
     6043    <xsl:if test="contains('$Date: 2010-06-27 12:07:31 $',':')">
     6044      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-06-27 12:07:31 $', 'Date: '),'$','')),', ')"/>
    59836045    </xsl:if>
    59846046    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/>
     
    61106172<!-- reformat contents of author/@initials -->
    61116173<xsl:template name="format-initials">
     6174  <xsl:variable name="r">
     6175    <xsl:call-template name="t-format-initials">
     6176      <xsl:with-param name="remainder" select="normalize-space(@initials)"/>
     6177    </xsl:call-template>
     6178  </xsl:variable>
     6179 
     6180  <xsl:if test="$r!=@initials">
     6181    <xsl:call-template name="warning">
     6182      <xsl:with-param name="inline" select="'no'"/>
     6183      <xsl:with-param name="msg">@initials '<xsl:value-of select="@initials"/>': did you mean '<xsl:value-of select="$r"/>'?</xsl:with-param>
     6184    </xsl:call-template>
     6185  </xsl:if>
     6186 
     6187  <xsl:value-of select="$r"/>
     6188</xsl:template>
     6189
     6190<xsl:template name="t-format-initials">
     6191  <xsl:param name="have"/>
     6192  <xsl:param name="remainder"/>
     6193 
     6194  <xsl:variable name="first" select="substring($remainder,1,1)"/>
     6195  <xsl:variable name="prev" select="substring($have,string-length($have))"/>
     6196
     6197<!--<xsl:message>
     6198have: <xsl:value-of select="$have"/>
     6199remainder: <xsl:value-of select="$remainder"/>
     6200first: <xsl:value-of select="$first"/>
     6201prev: <xsl:value-of select="$prev"/>
     6202</xsl:message>-->
     6203
    61126204  <xsl:choose>
    6113     <xsl:when test="string-length(@initials)=1">
    6114       <xsl:value-of select="concat(@initials,'.')"/>
    6115     </xsl:when>
     6205    <xsl:when test="$remainder='' and $prev!='.'">
     6206      <xsl:value-of select="concat($have,'.')"/>
     6207    </xsl:when>
     6208    <xsl:when test="$remainder=''">
     6209      <xsl:value-of select="$have"/>
     6210    </xsl:when>
     6211    <xsl:when test="$prev='.' and $first='.'">
     6212      <!-- repeating dots -->
     6213      <xsl:call-template name="t-format-initials">
     6214        <xsl:with-param name="have" select="$have"/>
     6215        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6216      </xsl:call-template>
     6217    </xsl:when>
     6218    <!-- missing dot before '-' -->
     6219<!--    <xsl:when test="$prev!='.' and $first='-'">
     6220      <xsl:call-template name="t-format-initials">
     6221        <xsl:with-param name="have" select="concat($have,'.-')"/>
     6222        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6223      </xsl:call-template>
     6224    </xsl:when>-->
     6225    <!-- missing space after '.' -->
     6226<!--    <xsl:when test="$prev='.' and $first!=' '">
     6227      <xsl:call-template name="t-format-initials">
     6228        <xsl:with-param name="have" select="concat($have,' ',$first)"/>
     6229        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6230      </xsl:call-template>
     6231    </xsl:when>-->
    61166232    <xsl:otherwise>
    6117       <xsl:value-of select="@initials"/>
     6233      <xsl:call-template name="t-format-initials">
     6234        <xsl:with-param name="have" select="concat($have,$first)"/>
     6235        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6236      </xsl:call-template>
    61186237    </xsl:otherwise>
    61196238  </xsl:choose>
     6239 
    61206240</xsl:template>
    61216241
Note: See TracChangeset for help on using the changeset viewer.