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

    r799 r832  
    344344<xsl:variable name="lcase" select="'abcdefghijklmnopqrstuvwxyz'" />
    345345<xsl:variable name="ucase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />       
     346<xsl:variable name="digits" select="'0123456789'" />
    346347
    347348<!-- build help keys for indices -->
     
    10141015    <xsl:apply-templates select="title"/>
    10151016    <xsl:if test="/rfc/@docName">
     1017      <xsl:variable name="docname" select="/rfc/@docName"/>
     1018
    10161019      <br/>
    1017       <span class="filename"><xsl:value-of select="/rfc/@docName"/></span>
     1020      <span class="filename"><xsl:value-of select="$docname"/></span>
    10181021     
    1019       <xsl:if test="contains(/rfc/@docName,'.')">
     1022      <xsl:variable name="docname-noext">
     1023        <xsl:choose>
     1024          <xsl:when test="contains($docname,'.')">
     1025            <xsl:call-template name="warning">
     1026              <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>
     1027              <xsl:with-param name="inline" select="'no'"/>
     1028            </xsl:call-template>
     1029            <xsl:value-of select="substring-before($docname,'.')"/>
     1030          </xsl:when>
     1031          <xsl:otherwise>
     1032            <xsl:value-of select="$docname"/>
     1033          </xsl:otherwise>
     1034        </xsl:choose>
     1035      </xsl:variable>
     1036     
     1037      <!-- more name checks -->
     1038      <xsl:variable name="offending" select="translate($docname,concat($lcase,$digits,'-.'),'')"/>
     1039      <xsl:if test="$offending != ''">
    10201040        <xsl:call-template name="warning">
    1021           <xsl:with-param name="msg">The @docName attribute should contain the base name, not the filename (thus no file extension).</xsl:with-param>
     1041          <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>
     1042          <xsl:with-param name="inline" select="'no'"/>
    10221043        </xsl:call-template>
    10231044      </xsl:if>
     1045     
     1046     
     1047      <xsl:if test="contains($docname,'--')">
     1048        <xsl:call-template name="warning">
     1049          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should not contain the character sequence '--'.</xsl:with-param>
     1050          <xsl:with-param name="inline" select="'no'"/>
     1051        </xsl:call-template>
     1052      </xsl:if>
     1053
     1054      <xsl:if test="not(starts-with($docname,'draft-'))">
     1055        <xsl:call-template name="warning">
     1056          <xsl:with-param name="msg">The @docName attribute '<xsl:value-of select="$docname"/>' should start with 'draft-'.</xsl:with-param>
     1057          <xsl:with-param name="inline" select="'no'"/>
     1058        </xsl:call-template>
     1059      </xsl:if>
     1060     
     1061      <!-- sequence number -->
     1062      <xsl:variable name="seq">
     1063        <xsl:choose>
     1064          <xsl:when test="substring($docname-noext,string-length($docname-noext) + 1 - string-length('-latest'))='-latest'">latest</xsl:when>
     1065          <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>
     1066          <xsl:otherwise/>
     1067        </xsl:choose>
     1068      </xsl:variable>
     1069
     1070      <xsl:if test="$seq='' or ($seq!='latest' and translate($seq,$digits,'')!='')">
     1071        <xsl:call-template name="warning">
     1072          <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>
     1073          <xsl:with-param name="inline" select="'no'"/>
     1074        </xsl:call-template>
     1075      </xsl:if>
     1076
     1077      <xsl:if test="string-length($docname)-string-length($seq) > 50">
     1078        <xsl:call-template name="warning">
     1079          <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>
     1080          <xsl:with-param name="inline" select="'no'"/>
     1081        </xsl:call-template>
     1082      </xsl:if>
     1083     
    10241084    </xsl:if> 
    10251085  </p>
     
    14911551          <xsl:call-template name="format-initials"/>
    14921552        </xsl:variable>
     1553        <xsl:variable name="truncated-initials" select="concat(substring-before($initials,'.'),'.')"/>
    14931554     
    14941555        <xsl:choose>
     
    14981559              <xsl:choose>
    14991560                <xsl:when test="position()=last() and position()!=1">
    1500                   <xsl:value-of select="concat($initials,' ',@surname)" />
     1561                  <xsl:value-of select="concat($truncated-initials,' ',@surname)" />
    15011562                </xsl:when>
    15021563                <xsl:otherwise>
    1503                   <xsl:value-of select="concat(@surname,', ',$initials)" />
     1564                  <xsl:value-of select="concat(@surname,', ',$truncated-initials)" />
    15041565                </xsl:otherwise>
    15051566              </xsl:choose>
     
    26602721      <xsl:call-template name="format-initials"/>
    26612722    </xsl:variable>
     2723    <xsl:variable name="truncated-initials" select="concat(substring-before($initials,'.'),'.')"/>
    26622724    <xsl:if test="@surname">
    26632725      <myns:item>
    2664         <xsl:value-of select="concat($initials,' ',@surname)" />
     2726        <xsl:value-of select="concat($truncated-initials,' ',@surname)" />
    26652727        <xsl:if test="@role">
    26662728          <xsl:choose>
     
    61186180    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    61196181    <!-- when RCS keyword substitution in place, add version info -->
    6120     <xsl:if test="contains('$Revision: 1.517 $',':')">
    6121       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.517 $', 'Revision: '),'$','')),', ')" />
     6182    <xsl:if test="contains('$Revision: 1.518 $',':')">
     6183      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.518 $', 'Revision: '),'$','')),', ')" />
    61226184    </xsl:if>
    6123     <xsl:if test="contains('$Date: 2010-03-31 18:24:38 $',':')">
    6124       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-03-31 18:24:38 $', 'Date: '),'$','')),', ')" />
     6185    <xsl:if test="contains('$Date: 2010-06-27 12:07:31 $',':')">
     6186      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-06-27 12:07:31 $', 'Date: '),'$','')),', ')" />
    61256187    </xsl:if>
    61266188    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    62526314<!-- reformat contents of author/@initials -->
    62536315<xsl:template name="format-initials">
     6316  <xsl:variable name="r">
     6317    <xsl:call-template name="t-format-initials">
     6318      <xsl:with-param name="remainder" select="normalize-space(@initials)"/>
     6319    </xsl:call-template>
     6320  </xsl:variable>
     6321 
     6322  <xsl:if test="$r!=@initials">
     6323    <xsl:call-template name="warning">
     6324      <xsl:with-param name="inline" select="'no'"/>
     6325      <xsl:with-param name="msg">@initials '<xsl:value-of select="@initials"/>': did you mean '<xsl:value-of select="$r"/>'?</xsl:with-param>
     6326    </xsl:call-template>
     6327  </xsl:if>
     6328 
     6329  <xsl:value-of select="$r"/>
     6330</xsl:template>
     6331
     6332<xsl:template name="t-format-initials">
     6333  <xsl:param name="have"/>
     6334  <xsl:param name="remainder"/>
     6335 
     6336  <xsl:variable name="first" select="substring($remainder,1,1)"/>
     6337  <xsl:variable name="prev" select="substring($have,string-length($have))"/>
     6338
     6339<!--<xsl:message>
     6340have: <xsl:value-of select="$have"/>
     6341remainder: <xsl:value-of select="$remainder"/>
     6342first: <xsl:value-of select="$first"/>
     6343prev: <xsl:value-of select="$prev"/>
     6344</xsl:message>-->
     6345
    62546346  <xsl:choose>
    6255     <xsl:when test="string-length(@initials)=1">
    6256       <xsl:value-of select="concat(@initials,'.')"/>
    6257     </xsl:when>
     6347    <xsl:when test="$remainder='' and $prev!='.'">
     6348      <xsl:value-of select="concat($have,'.')"/>
     6349    </xsl:when>
     6350    <xsl:when test="$remainder=''">
     6351      <xsl:value-of select="$have"/>
     6352    </xsl:when>
     6353    <xsl:when test="$prev='.' and $first='.'">
     6354      <!-- repeating dots -->
     6355      <xsl:call-template name="t-format-initials">
     6356        <xsl:with-param name="have" select="$have"/>
     6357        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6358      </xsl:call-template>
     6359    </xsl:when>
     6360    <!-- missing dot before '-' -->
     6361<!--    <xsl:when test="$prev!='.' and $first='-'">
     6362      <xsl:call-template name="t-format-initials">
     6363        <xsl:with-param name="have" select="concat($have,'.-')"/>
     6364        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6365      </xsl:call-template>
     6366    </xsl:when>-->
     6367    <!-- missing space after '.' -->
     6368<!--    <xsl:when test="$prev='.' and $first!=' '">
     6369      <xsl:call-template name="t-format-initials">
     6370        <xsl:with-param name="have" select="concat($have,' ',$first)"/>
     6371        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6372      </xsl:call-template>
     6373    </xsl:when>-->
    62586374    <xsl:otherwise>
    6259       <xsl:value-of select="@initials"/>
     6375      <xsl:call-template name="t-format-initials">
     6376        <xsl:with-param name="have" select="concat($have,$first)"/>
     6377        <xsl:with-param name="remainder" select="substring($remainder,2)"/>
     6378      </xsl:call-template>
    62606379    </xsl:otherwise>
    62616380  </xsl:choose>
     6381 
    62626382</xsl:template>
    62636383
Note: See TracChangeset for help on using the changeset viewer.