Ignore:
Timestamp:
05/08/09 13:56:13 (11 years ago)
Author:
julian.reschke@…
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629.xslt

    r599 r662  
    381381<xsl:variable name="ipr-2009-02" select="(
    382382    $ipr-2008-11 and ($xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric >= 02))
     383  )" />
     384
     385<!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html -->
     386<xsl:variable name="abstract-first" select="(
     387    /rfc/@number and (
     388      $xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric >= 07)
     389    )
    383390  )" />
    384391
     
    706713<xsl:template match="back">
    707714
    708   <!-- add references section first, no matter where it appears in the
    709     source document -->
    710   <!-- as of April 2004, process from middle section
    711   <xsl:apply-templates select="references" />
    712   -->
    713  
    714715  <!-- add editorial comments -->
    715716  <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
     
    725726  <xsl:apply-templates select="*[not(self::references) and not(self::ed:replace and .//references)]" />
    726727
     728  <!-- insert the index if index entries exist -->
     729  <!-- note it always comes before the authors section -->
     730  <xsl:if test="$has-index">
     731    <xsl:call-template name="insertIndex" />
     732  </xsl:if>
     733
     734  <!-- Authors section is the absolute last thing, except for copyright stuff -->
    727735  <xsl:if test="$xml2rfc-ext-authors-section='end'">
    728736    <xsl:call-template name="insertAuthors" />
     
    746754  </xsl:if>
    747755 
    748   <!-- insert the index if index entries exist -->
    749   <xsl:if test="$has-index">
    750     <xsl:call-template name="insertIndex" />
    751   </xsl:if>
    752 
    753756</xsl:template>
    754757
     
    863866  </xsl:choose>           
    864867
    865   <xsl:if test="not($xml2rfc-private)">
    866  
    867     <!-- Get status info formatted as per RFC2629-->
    868     <xsl:variable name="preamble">
    869       <xsl:call-template name="insertPreamble" />
    870     </xsl:variable>
    871    
    872     <!-- emit it -->
    873     <xsl:choose>
    874       <xsl:when test="function-available('exslt:node-set')">
    875         <xsl:apply-templates select="exslt:node-set($preamble)" />
    876       </xsl:when>
    877       <xsl:otherwise>
    878         <xsl:call-template name="error">
    879           <xsl:with-param name="msg" select="$node-set-warning"/>
    880         </xsl:call-template>
    881       </xsl:otherwise>
    882     </xsl:choose>
     868  <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     869    <xsl:call-template name="emit-ietf-preamble"/>
    883870  </xsl:if>
    884871 
     
    889876  <xsl:apply-templates select="ed:replace[.//note]" />
    890877   
     878  <xsl:if test="not($xml2rfc-private) and $abstract-first">
     879    <xsl:call-template name="emit-ietf-preamble"/>
     880  </xsl:if>
     881
    891882  <xsl:if test="$xml2rfc-toc='yes'">
    892883    <xsl:apply-templates select="/" mode="toc" />
     
    896887</xsl:template>
    897888
     889<xsl:template name="emit-ietf-preamble">
     890  <!-- Get status info formatted as per RFC2629-->
     891  <xsl:variable name="preamble">
     892    <xsl:call-template name="insertPreamble" />
     893  </xsl:variable>
     894 
     895  <!-- emit it -->
     896  <xsl:choose>
     897    <xsl:when test="function-available('exslt:node-set')">
     898      <xsl:apply-templates select="exslt:node-set($preamble)" />
     899    </xsl:when>
     900    <xsl:otherwise>
     901      <xsl:call-template name="error">
     902        <xsl:with-param name="msg" select="$node-set-warning"/>
     903      </xsl:call-template>
     904    </xsl:otherwise>
     905  </xsl:choose>
     906</xsl:template>
    898907
    899908<xsl:template match="iref">
     
    15691578            <xsl:otherwise/>
    15701579          </xsl:choose>
    1571           <meta name="DC.Date.Issued" scheme="ISO8601" content="{$xml2rfc-ext-pub-year}-{$xml2rfc-ext-pub-month-numeric}" />
     1580          <meta name="DC.Date.Issued" scheme="ISO8601">
     1581            <xsl:attribute name="content">
     1582              <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$xml2rfc-ext-pub-month-numeric)"/>
     1583              <xsl:if test="$xml2rfc-ext-pub-day != '' and not(/rfc/@number)">
     1584                <xsl:value-of select="concat('-',format-number($xml2rfc-ext-pub-day,'00'))"/>
     1585              </xsl:if>
     1586            </xsl:attribute>
     1587          </meta>
    15721588 
    15731589          <xsl:if test="/rfc/@obsoletes!=''">
     
    17421758    </xsl:if>
    17431759    <xsl:choose>
    1744       <xsl:when test="$sectionNumber='1'">
     1760      <xsl:when test="$sectionNumber='1' or $sectionNumber='A'">
    17451761        <!-- pagebreak, this the first section -->
    17461762        <xsl:attribute name="class">np</xsl:attribute>
     
    17541770    <xsl:call-template name="insertInsDelClass" />
    17551771       
    1756     <xsl:if test="$sectionNumber!=''">
     1772    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
    17571773      <a href="#{$anchor-prefix}.section.{$sectionNumber}">
    17581774        <xsl:call-template name="emit-section-number">
     
    18991915      </xsl:call-template>
    19001916    </xsl:when>
    1901 
     1917   
    19021918    <!-- Section links -->
    19031919    <xsl:when test="$node/self::section or $node/self::appendix">
    1904       <xsl:apply-templates/>
    1905       <xsl:text> (</xsl:text>
    1906       <a href="#{@target}">
    1907         <!-- insert id when a backlink to this xref is needed in the index -->
    1908         <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
    1909           <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    1910         </xsl:if>
    1911         <xsl:call-template name="render-section-ref">
    1912           <xsl:with-param name="from" select="."/>
    1913           <xsl:with-param name="to" select="$node"/>
    1914         </xsl:call-template>
    1915       </a>
    1916       <xsl:text>)</xsl:text>
     1920      <xsl:choose>
     1921        <xsl:when test="@format='none'">
     1922          <a href="#{@target}">
     1923            <!-- insert id when a backlink to this xref is needed in the index -->
     1924            <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
     1925              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1926            </xsl:if>
     1927            <xsl:apply-templates/>
     1928          </a>
     1929        </xsl:when>
     1930        <xsl:otherwise>
     1931          <xsl:apply-templates/>
     1932          <xsl:text> (</xsl:text>
     1933          <a href="#{@target}">
     1934            <!-- insert id when a backlink to this xref is needed in the index -->
     1935            <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
     1936              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1937            </xsl:if>
     1938            <xsl:call-template name="render-section-ref">
     1939              <xsl:with-param name="from" select="."/>
     1940              <xsl:with-param name="to" select="$node"/>
     1941            </xsl:call-template>
     1942          </a>
     1943          <xsl:text>)</xsl:text>
     1944        </xsl:otherwise>
     1945      </xsl:choose>
    19171946    </xsl:when>
    19181947
     
    24302459<xsl:template name="expirydate">
    24312460  <xsl:choose>
     2461    <xsl:when test="$xml2rfc-ext-pub-day >= 1">
     2462      <xsl:call-template name="normalize-date">
     2463        <xsl:with-param name="year" select="$xml2rfc-ext-pub-year"/>
     2464        <xsl:with-param name="month" select="$xml2rfc-ext-pub-month-numeric"/>
     2465        <xsl:with-param name="day" select="$xml2rfc-ext-pub-day + 185"/>
     2466      </xsl:call-template>
     2467    </xsl:when>
    24322468    <xsl:when test="$xml2rfc-ext-pub-month='January'">July <xsl:value-of select="$xml2rfc-ext-pub-year" /></xsl:when>
    24332469    <xsl:when test="$xml2rfc-ext-pub-month='February'">August <xsl:value-of select="$xml2rfc-ext-pub-year" /></xsl:when>
     
    24462482</xsl:template>
    24472483
     2484<xsl:template name="normalize-date">
     2485  <xsl:param name="year"/>
     2486  <xsl:param name="month"/>
     2487  <xsl:param name="day"/>
     2488
     2489  <xsl:variable name="isleap" select="(($year mod 4) = 0 and ($year mod 100 != 0)) or ($year mod 400) = 0" />
     2490
     2491  <!--<xsl:message>
     2492    <xsl:value-of select="concat($year,' ',$month,' ',$day)"/>
     2493  </xsl:message>-->
     2494 
     2495  <xsl:variable name="dim">
     2496    <xsl:choose>
     2497      <xsl:when test="$month=1 or $month=3 or $month=5 or $month=7 or $month=8 or $month=10 or $month=12">31</xsl:when>
     2498      <xsl:when test="$month=2 and $isleap">29</xsl:when>
     2499      <xsl:when test="$month=2 and not($isleap)">28</xsl:when>
     2500      <xsl:otherwise>30</xsl:otherwise>
     2501    </xsl:choose>
     2502  </xsl:variable>
     2503 
     2504  <xsl:choose>
     2505    <xsl:when test="$day > $dim and $month=12">
     2506      <xsl:call-template name="normalize-date">
     2507        <xsl:with-param name="year" select="$year + 1"/>
     2508        <xsl:with-param name="month" select="1"/>
     2509        <xsl:with-param name="day" select="$day - $dim"/>
     2510      </xsl:call-template>
     2511    </xsl:when>
     2512    <xsl:when test="$day > $dim">
     2513      <xsl:call-template name="normalize-date">
     2514        <xsl:with-param name="year" select="$year"/>
     2515        <xsl:with-param name="month" select="$month + 1"/>
     2516        <xsl:with-param name="day" select="$day - $dim"/>
     2517      </xsl:call-template>
     2518    </xsl:when>
     2519    <xsl:otherwise>
     2520      <xsl:call-template name="get-month-as-name">
     2521        <xsl:with-param name="month" select="$month"/>
     2522      </xsl:call-template>
     2523      <xsl:value-of select="concat(' ',$day,', ',$year)"/>
     2524    </xsl:otherwise>
     2525  </xsl:choose>
     2526
     2527</xsl:template>
     2528 
    24482529<xsl:template name="get-month-as-num">
    24492530  <xsl:param name="month" />
     
    25072588    <xsl:call-template name="insert-conditional-hrule"/>
    25082589   
    2509     <h1 id="{$anchor-prefix}.authors">
    2510       <xsl:call-template name="insert-conditional-pagebreak"/>
    2511       <xsl:if test="$number != ''">
    2512         <a href="#{$anchor-prefix}.section.{$number}" id="{$anchor-prefix}.section.{$number}"><xsl:value-of select="$number"/>.</a>
    2513         <xsl:text> </xsl:text>
    2514       </xsl:if>
    2515       <a href="#{$anchor-prefix}.authors"><xsl:call-template name="get-authors-section-title"/></a>
    2516     </h1>
    2517  
    2518     <xsl:apply-templates select="/rfc/front/author" />
     2590    <div class="avoidbreak">
     2591      <h1 id="{$anchor-prefix}.authors">
     2592        <xsl:call-template name="insert-conditional-pagebreak"/>
     2593        <xsl:if test="$number != ''">
     2594          <a href="#{$anchor-prefix}.section.{$number}" id="{$anchor-prefix}.section.{$number}"><xsl:value-of select="$number"/>.</a>
     2595          <xsl:text> </xsl:text>
     2596        </xsl:if>
     2597        <a href="#{$anchor-prefix}.authors"><xsl:call-template name="get-authors-section-title"/></a>
     2598      </h1>
     2599   
     2600      <xsl:apply-templates select="/rfc/front/author" />
     2601    </div>
    25192602  </xsl:if>
    25202603</xsl:template>
     
    28672950  border-width: 1px;
    28682951}
     2952table.left {
     2953  margin-right: auto;
     2954}
     2955table.right {
     2956  margin-left: auto;
     2957}
     2958table.center {
     2959  margin-left: auto;
     2960  margin-right: auto;
     2961}
    28692962caption {
    28702963  caption-side: bottom;
     
    29453038  margin-left: 0em;
    29463039  margin-right: 0em;
     3040}
     3041.avoidbreak {
     3042  page-break-inside: avoid;
    29473043}
    29483044</xsl:if><xsl:if test="//x:bcp14">.bcp14 {
     
    37833879       
    37843880        <!-- special case: RFC5378 escape applies to RFCs as well -->
    3785         <!-- <xsl:if test="/rfc/@ipr = 'pre5378Trust200902'">
     3881        <!-- currently only applied to RFCs, need to discuss for IDs -->
     3882        <xsl:if test="/rfc/@number and /rfc/@ipr = 'pre5378Trust200902'">
    37863883          <t>
    37873884            This document may contain material from IETF Documents or IETF Contributions published or
     
    37943891            other than English.
    37953892          </t>
    3796         </xsl:if> -->
     3893        </xsl:if>
    37973894       
    37983895      </section>
     
    38683965            </xsl:otherwise>
    38693966          </xsl:choose>
    3870           <xsl:if test="$number != ''">
     3967          <xsl:if test="$number != '' and not(contains($number,'unnumbered-'))">
    38713968            <xsl:call-template name="emit-section-number">
    38723969              <xsl:with-param name="no" select="$number"/>
     
    38933990<xsl:template match="back" mode="toc">
    38943991
    3895   <!-- <xsl:apply-templates select="references" mode="toc" /> -->
    3896 
    38973992  <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
    38983993    <li>
     
    39084003  </xsl:if>
    39094004  <xsl:apply-templates select="*[not(self::references)]" mode="toc" />
     4005
     4006  <!-- insert the index if index entries exist -->
     4007  <xsl:if test="$has-index">
     4008    <li>
     4009      <xsl:call-template name="insert-toc-line">
     4010        <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
     4011        <xsl:with-param name="title" select="'Index'"/>
     4012      </xsl:call-template>
     4013    </li>
     4014  </xsl:if>
    39104015
    39114016  <xsl:if test="$xml2rfc-ext-authors-section='end'">
     
    39234028  </xsl:if>
    39244029 
    3925   <!-- insert the index if index entries exist -->
    3926   <xsl:if test="//iref">
    3927     <li>
    3928       <xsl:call-template name="insert-toc-line">
    3929         <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
    3930         <xsl:with-param name="title" select="'Index'"/>
    3931       </xsl:call-template>
    3932     </li>
    3933   </xsl:if>
    3934 
    39354030</xsl:template>
    39364031
     
    50515146<xsl:template name="sectionnumberAndEdits">
    50525147  <xsl:choose>
    5053     <xsl:when test="ancestor::ed:del">del-<xsl:number count="ed:del//section" level="any"/></xsl:when>
    5054     <xsl:when test="@x:fixed-section-number">
     5148    <xsl:when test="ancestor::ed:del">
     5149      <xsl:text>del-</xsl:text>
     5150      <xsl:number count="ed:del//section" level="any"/>
     5151    </xsl:when>
     5152    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number!=''">
    50555153      <xsl:value-of select="@x:fixed-section-number"/>
     5154    </xsl:when>
     5155    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number=''">
     5156      <xsl:text>unnumbered-</xsl:text>
     5157      <xsl:number count="section[@x:fixed-section-number='']" level="any"/>
    50565158    </xsl:when>
    50575159    <xsl:when test="self::section and parent::ed:ins and local-name(../..)='replace'">
     
    51555257
    51565258  <div id="{$anch}">
     5259
    51575260    <xsl:if test="@anchor!=''">
    51585261      <div id="{@anchor}"/>
     
    51675270        <xsl:otherwise>full</xsl:otherwise>
    51685271      </xsl:choose>
     5272      <xsl:choose>
     5273        <xsl:when test="@align='left'"> left</xsl:when>
     5274        <xsl:when test="@align='right'"> right</xsl:when>
     5275        <xsl:when test="@align='center' or not(@align) or @align=''"> center</xsl:when>
     5276        <xsl:otherwise/>
     5277      </xsl:choose>
     5278
    51695279    </xsl:variable>
    51705280
    5171     <table summary="{preamble}" class="{$style}" cellpadding="3" cellspacing="0">
    5172 
     5281    <table class="{$style}" cellpadding="3" cellspacing="0">
    51735282      <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
    51745283        <xsl:variable name="n"><xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]" /></xsl:variable>
     
    51875296        <xsl:variable name="columns" select="count(ttcol)" />
    51885297        <xsl:variable name="fields" select="c | ed:replace/ed:ins/c | ed:replace/ed:del/c" />
    5189         <xsl:for-each select="$fields[(position() mod $columns) = 1]">
     5298        <xsl:for-each select="$fields[$columns=1 or (position() mod $columns) = 1]">
    51905299          <tr>
    51915300            <xsl:for-each select=". | following-sibling::c[position() &lt; $columns]">
     
    53345443<xsl:template match="/*/middle//section[not(myns:unnumbered) and not(ancestor::section)]" mode="links">
    53355444  <xsl:variable name="sectionNumber"><xsl:call-template name="get-section-number" /></xsl:variable>
    5336   <link rel="Chapter" title="{$sectionNumber} {@title}" href="#{$anchor-prefix}.section.{$sectionNumber}" />
     5445  <xsl:variable name="title">
     5446    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
     5447      <xsl:value-of select="$sectionNumber"/>
     5448      <xsl:text> </xsl:text>
     5449    </xsl:if>
     5450    <xsl:value-of select="@title"/>
     5451  </xsl:variable>
     5452  <link rel="Chapter" title="{$title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
    53375453  <xsl:apply-templates mode="links" />
    53385454</xsl:template>
     
    53405456<xsl:template match="/*/back//section[not(myns:unnumbered) and not(ancestor::section)]" mode="links">
    53415457  <xsl:variable name="sectionNumber"><xsl:call-template name="get-section-number" /></xsl:variable>
    5342   <link rel="Appendix" title="{$sectionNumber} {@title}" href="#{$anchor-prefix}.section.{$sectionNumber}" />
     5458  <xsl:variable name="title">
     5459    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
     5460      <xsl:value-of select="$sectionNumber"/>
     5461      <xsl:text> </xsl:text>
     5462    </xsl:if>
     5463    <xsl:value-of select="@title"/>
     5464  </xsl:variable>
     5465  <link rel="Appendix" title="{$title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
    53435466  <xsl:apply-templates mode="links" />
    53445467</xsl:template>
     
    54185541    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    54195542    <!-- when RCS keyword substitution in place, add version info -->
    5420     <xsl:if test="contains('$Revision: 1.439 $',':')">
    5421       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.439 $', 'Revision: '),'$','')),', ')" />
     5543    <xsl:if test="contains('$Revision: 1.447 $',':')">
     5544      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.447 $', 'Revision: '),'$','')),', ')" />
    54225545    </xsl:if>
    5423     <xsl:if test="contains('$Date: 2009-06-09 18:43:39 $',':')">
    5424       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-06-09 18:43:39 $', 'Date: '),'$','')),', ')" />
     5546    <xsl:if test="contains('$Date: 2009-08-04 19:54:03 $',':')">
     5547      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-08-04 19:54:03 $', 'Date: '),'$','')),', ')" />
    54255548    </xsl:if>
    54265549    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    54545577  <xsl:variable name="anchor" select="@anchor"/>
    54555578  <xsl:choose>
    5456     <xsl:when test="@x:fixed-section-number">
     5579    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number!=''">
    54575580      <xsl:value-of select="@x:fixed-section-number"/>
     5581    </xsl:when>
     5582    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number=''">
     5583      <xsl:text>unnumbered-</xsl:text>
     5584      <xsl:number count="section[@x:fixed-section-number='']" level="any"/>
    54585585    </xsl:when>
    54595586    <xsl:when test="$has-edits or ancestor::*/@x:fixed-section-number">
Note: See TracChangeset for help on using the changeset viewer.