Ignore:
Timestamp:
05/08/09 13:56:13 (10 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/rfc2629toXHTML.xslt

    r599 r662  
    182182
    183183<xsl:variable name="ipr-2009-02" select="(     $ipr-2008-11 and ($xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric &gt;= 02))   )"/>
     184
     185<!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html -->
     186<xsl:variable name="abstract-first" select="(     /rfc/@number and (       $xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric &gt;= 07)     )   )"/>
    184187
    185188<!-- funding switch --> 
     
    500503<xsl:template match="back">
    501504
    502   <!-- add references section first, no matter where it appears in the
    503     source document -->
    504   <!-- as of April 2004, process from middle section
    505   <xsl:apply-templates select="references" />
    506   -->
    507  
    508505  <!-- add editorial comments -->
    509506  <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
     
    519516  <xsl:apply-templates select="*[not(self::references) and not(self::ed:replace and .//references)]"/>
    520517
     518  <!-- insert the index if index entries exist -->
     519  <!-- note it always comes before the authors section -->
     520  <xsl:if test="$has-index">
     521    <xsl:call-template name="insertIndex"/>
     522  </xsl:if>
     523
     524  <!-- Authors section is the absolute last thing, except for copyright stuff -->
    521525  <xsl:if test="$xml2rfc-ext-authors-section='end'">
    522526    <xsl:call-template name="insertAuthors"/>
     
    540544  </xsl:if>
    541545 
    542   <!-- insert the index if index entries exist -->
    543   <xsl:if test="$has-index">
    544     <xsl:call-template name="insertIndex"/>
    545   </xsl:if>
    546 
    547546</xsl:template>
    548547
     
    657656  </xsl:choose>           
    658657
    659   <xsl:if test="not($xml2rfc-private)">
    660  
    661     <!-- Get status info formatted as per RFC2629-->
    662     <xsl:variable name="preamble">
    663       <xsl:call-template name="insertPreamble"/>
    664     </xsl:variable>
    665    
    666     <!-- emit it -->
    667     <xsl:choose>
    668       <xsl:when test="function-available('exslt:node-set')">
    669         <xsl:apply-templates select="exslt:node-set($preamble)"/>
    670       </xsl:when>
    671       <xsl:otherwise>
    672         <xsl:call-template name="error">
    673           <xsl:with-param name="msg" select="$node-set-warning"/>
    674         </xsl:call-template>
    675       </xsl:otherwise>
    676     </xsl:choose>
     658  <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     659    <xsl:call-template name="emit-ietf-preamble"/>
    677660  </xsl:if>
    678661 
     
    683666  <xsl:apply-templates select="ed:replace[.//note]"/>
    684667   
     668  <xsl:if test="not($xml2rfc-private) and $abstract-first">
     669    <xsl:call-template name="emit-ietf-preamble"/>
     670  </xsl:if>
     671
    685672  <xsl:if test="$xml2rfc-toc='yes'">
    686673    <xsl:apply-templates select="/" mode="toc"/>
     
    690677</xsl:template>
    691678
     679<xsl:template name="emit-ietf-preamble">
     680  <!-- Get status info formatted as per RFC2629-->
     681  <xsl:variable name="preamble">
     682    <xsl:call-template name="insertPreamble"/>
     683  </xsl:variable>
     684 
     685  <!-- emit it -->
     686  <xsl:choose>
     687    <xsl:when test="function-available('exslt:node-set')">
     688      <xsl:apply-templates select="exslt:node-set($preamble)"/>
     689    </xsl:when>
     690    <xsl:otherwise>
     691      <xsl:call-template name="error">
     692        <xsl:with-param name="msg" select="$node-set-warning"/>
     693      </xsl:call-template>
     694    </xsl:otherwise>
     695  </xsl:choose>
     696</xsl:template>
    692697
    693698<xsl:template match="iref">
     
    13631368            <xsl:otherwise/>
    13641369          </xsl:choose>
    1365           <meta name="DC.Date.Issued" scheme="ISO8601" content="{$xml2rfc-ext-pub-year}-{$xml2rfc-ext-pub-month-numeric}"/>
     1370          <meta name="DC.Date.Issued" scheme="ISO8601">
     1371            <xsl:attribute name="content">
     1372              <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$xml2rfc-ext-pub-month-numeric)"/>
     1373              <xsl:if test="$xml2rfc-ext-pub-day != '' and not(/rfc/@number)">
     1374                <xsl:value-of select="concat('-',format-number($xml2rfc-ext-pub-day,'00'))"/>
     1375              </xsl:if>
     1376            </xsl:attribute>
     1377          </meta>
    13661378 
    13671379          <xsl:if test="/rfc/@obsoletes!=''">
     
    15361548    </xsl:if>
    15371549    <xsl:choose>
    1538       <xsl:when test="$sectionNumber='1'">
     1550      <xsl:when test="$sectionNumber='1' or $sectionNumber='A'">
    15391551        <!-- pagebreak, this the first section -->
    15401552        <xsl:attribute name="class">np</xsl:attribute>
     
    15481560    <xsl:call-template name="insertInsDelClass"/>
    15491561       
    1550     <xsl:if test="$sectionNumber!=''">
     1562    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
    15511563      <a xmlns="http://www.w3.org/1999/xhtml" href="#{$anchor-prefix}.section.{$sectionNumber}">
    15521564        <xsl:call-template name="emit-section-number">
     
    16931705      </xsl:call-template>
    16941706    </xsl:when>
    1695 
     1707   
    16961708    <!-- Section links -->
    16971709    <xsl:when test="$node/self::section or $node/self::appendix">
    1698       <xsl:apply-templates/>
    1699       <xsl:text> (</xsl:text>
    1700       <a xmlns="http://www.w3.org/1999/xhtml" href="#{@target}">
    1701         <!-- insert id when a backlink to this xref is needed in the index -->
    1702         <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
    1703           <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    1704         </xsl:if>
    1705         <xsl:call-template name="render-section-ref">
    1706           <xsl:with-param name="from" select="."/>
    1707           <xsl:with-param name="to" select="$node"/>
    1708         </xsl:call-template>
    1709       </a>
    1710       <xsl:text>)</xsl:text>
     1710      <xsl:choose>
     1711        <xsl:when test="@format='none'">
     1712          <a xmlns="http://www.w3.org/1999/xhtml" href="#{@target}">
     1713            <!-- insert id when a backlink to this xref is needed in the index -->
     1714            <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
     1715              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1716            </xsl:if>
     1717            <xsl:apply-templates/>
     1718          </a>
     1719        </xsl:when>
     1720        <xsl:otherwise>
     1721          <xsl:apply-templates/>
     1722          <xsl:text> (</xsl:text>
     1723          <a xmlns="http://www.w3.org/1999/xhtml" href="#{@target}">
     1724            <!-- insert id when a backlink to this xref is needed in the index -->
     1725            <xsl:if test="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]">
     1726              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1727            </xsl:if>
     1728            <xsl:call-template name="render-section-ref">
     1729              <xsl:with-param name="from" select="."/>
     1730              <xsl:with-param name="to" select="$node"/>
     1731            </xsl:call-template>
     1732          </a>
     1733          <xsl:text>)</xsl:text>
     1734        </xsl:otherwise>
     1735      </xsl:choose>
    17111736    </xsl:when>
    17121737
     
    22242249<xsl:template name="expirydate">
    22252250  <xsl:choose>
     2251    <xsl:when test="$xml2rfc-ext-pub-day &gt;= 1">
     2252      <xsl:call-template name="normalize-date">
     2253        <xsl:with-param name="year" select="$xml2rfc-ext-pub-year"/>
     2254        <xsl:with-param name="month" select="$xml2rfc-ext-pub-month-numeric"/>
     2255        <xsl:with-param name="day" select="$xml2rfc-ext-pub-day + 185"/>
     2256      </xsl:call-template>
     2257    </xsl:when>
    22262258    <xsl:when test="$xml2rfc-ext-pub-month='January'">July <xsl:value-of select="$xml2rfc-ext-pub-year"/></xsl:when>
    22272259    <xsl:when test="$xml2rfc-ext-pub-month='February'">August <xsl:value-of select="$xml2rfc-ext-pub-year"/></xsl:when>
     
    22402272</xsl:template>
    22412273
     2274<xsl:template name="normalize-date">
     2275  <xsl:param name="year"/>
     2276  <xsl:param name="month"/>
     2277  <xsl:param name="day"/>
     2278
     2279  <xsl:variable name="isleap" select="(($year mod 4) = 0 and ($year mod 100 != 0)) or ($year mod 400) = 0"/>
     2280
     2281  <!--<xsl:message>
     2282    <xsl:value-of select="concat($year,' ',$month,' ',$day)"/>
     2283  </xsl:message>-->
     2284 
     2285  <xsl:variable name="dim">
     2286    <xsl:choose>
     2287      <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>
     2288      <xsl:when test="$month=2 and $isleap">29</xsl:when>
     2289      <xsl:when test="$month=2 and not($isleap)">28</xsl:when>
     2290      <xsl:otherwise>30</xsl:otherwise>
     2291    </xsl:choose>
     2292  </xsl:variable>
     2293 
     2294  <xsl:choose>
     2295    <xsl:when test="$day &gt; $dim and $month=12">
     2296      <xsl:call-template name="normalize-date">
     2297        <xsl:with-param name="year" select="$year + 1"/>
     2298        <xsl:with-param name="month" select="1"/>
     2299        <xsl:with-param name="day" select="$day - $dim"/>
     2300      </xsl:call-template>
     2301    </xsl:when>
     2302    <xsl:when test="$day &gt; $dim">
     2303      <xsl:call-template name="normalize-date">
     2304        <xsl:with-param name="year" select="$year"/>
     2305        <xsl:with-param name="month" select="$month + 1"/>
     2306        <xsl:with-param name="day" select="$day - $dim"/>
     2307      </xsl:call-template>
     2308    </xsl:when>
     2309    <xsl:otherwise>
     2310      <xsl:call-template name="get-month-as-name">
     2311        <xsl:with-param name="month" select="$month"/>
     2312      </xsl:call-template>
     2313      <xsl:value-of select="concat(' ',$day,', ',$year)"/>
     2314    </xsl:otherwise>
     2315  </xsl:choose>
     2316
     2317</xsl:template>
     2318 
    22422319<xsl:template name="get-month-as-num">
    22432320  <xsl:param name="month"/>
     
    23012378    <xsl:call-template name="insert-conditional-hrule"/>
    23022379   
    2303     <h1 xmlns="http://www.w3.org/1999/xhtml" id="{$anchor-prefix}.authors">
    2304       <xsl:call-template name="insert-conditional-pagebreak"/>
    2305       <xsl:if test="$number != ''">
    2306         <a href="#{$anchor-prefix}.section.{$number}" id="{$anchor-prefix}.section.{$number}"><xsl:value-of select="$number"/>.</a>
    2307         <xsl:text> </xsl:text>
    2308       </xsl:if>
    2309       <a href="#{$anchor-prefix}.authors"><xsl:call-template name="get-authors-section-title"/></a>
    2310     </h1>
    2311  
    2312     <xsl:apply-templates select="/rfc/front/author"/>
     2380    <div xmlns="http://www.w3.org/1999/xhtml" class="avoidbreak">
     2381      <h1 id="{$anchor-prefix}.authors">
     2382        <xsl:call-template name="insert-conditional-pagebreak"/>
     2383        <xsl:if test="$number != ''">
     2384          <a href="#{$anchor-prefix}.section.{$number}" id="{$anchor-prefix}.section.{$number}"><xsl:value-of select="$number"/>.</a>
     2385          <xsl:text> </xsl:text>
     2386        </xsl:if>
     2387        <a href="#{$anchor-prefix}.authors"><xsl:call-template name="get-authors-section-title"/></a>
     2388      </h1>
     2389   
     2390      <xsl:apply-templates select="/rfc/front/author"/>
     2391    </div>
    23132392  </xsl:if>
    23142393</xsl:template>
     
    26612740  border-width: 1px;
    26622741}
     2742table.left {
     2743  margin-right: auto;
     2744}
     2745table.right {
     2746  margin-left: auto;
     2747}
     2748table.center {
     2749  margin-left: auto;
     2750  margin-right: auto;
     2751}
    26632752caption {
    26642753  caption-side: bottom;
     
    27392828  margin-left: 0em;
    27402829  margin-right: 0em;
     2830}
     2831.avoidbreak {
     2832  page-break-inside: avoid;
    27412833}
    27422834</xsl:if><xsl:if test="//x:bcp14">.bcp14 {
     
    35723664       
    35733665        <!-- special case: RFC5378 escape applies to RFCs as well -->
    3574         <!-- <xsl:if test="/rfc/@ipr = 'pre5378Trust200902'">
     3666        <!-- currently only applied to RFCs, need to discuss for IDs -->
     3667        <xsl:if test="/rfc/@number and /rfc/@ipr = 'pre5378Trust200902'">
    35753668          <t>
    35763669            This document may contain material from IETF Documents or IETF Contributions published or
     
    35833676            other than English.
    35843677          </t>
    3585         </xsl:if> -->
     3678        </xsl:if>
    35863679       
    35873680      </section>
     
    36573750            </xsl:otherwise>
    36583751          </xsl:choose>
    3659           <xsl:if test="$number != ''">
     3752          <xsl:if test="$number != '' and not(contains($number,'unnumbered-'))">
    36603753            <xsl:call-template name="emit-section-number">
    36613754              <xsl:with-param name="no" select="$number"/>
     
    36823775<xsl:template match="back" mode="toc">
    36833776
    3684   <!-- <xsl:apply-templates select="references" mode="toc" /> -->
    3685 
    36863777  <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
    36873778    <li xmlns="http://www.w3.org/1999/xhtml">
     
    36973788  </xsl:if>
    36983789  <xsl:apply-templates select="*[not(self::references)]" mode="toc"/>
     3790
     3791  <!-- insert the index if index entries exist -->
     3792  <xsl:if test="$has-index">
     3793    <li xmlns="http://www.w3.org/1999/xhtml">
     3794      <xsl:call-template name="insert-toc-line">
     3795        <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
     3796        <xsl:with-param name="title" select="'Index'"/>
     3797      </xsl:call-template>
     3798    </li>
     3799  </xsl:if>
    36993800
    37003801  <xsl:if test="$xml2rfc-ext-authors-section='end'">
     
    37123813  </xsl:if>
    37133814 
    3714   <!-- insert the index if index entries exist -->
    3715   <xsl:if test="//iref">
    3716     <li xmlns="http://www.w3.org/1999/xhtml">
    3717       <xsl:call-template name="insert-toc-line">
    3718         <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
    3719         <xsl:with-param name="title" select="'Index'"/>
    3720       </xsl:call-template>
    3721     </li>
    3722   </xsl:if>
    3723 
    37243815</xsl:template>
    37253816
     
    48394930<xsl:template name="sectionnumberAndEdits">
    48404931  <xsl:choose>
    4841     <xsl:when test="ancestor::ed:del">del-<xsl:number count="ed:del//section" level="any"/></xsl:when>
    4842     <xsl:when test="@x:fixed-section-number">
     4932    <xsl:when test="ancestor::ed:del">
     4933      <xsl:text>del-</xsl:text>
     4934      <xsl:number count="ed:del//section" level="any"/>
     4935    </xsl:when>
     4936    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number!=''">
    48434937      <xsl:value-of select="@x:fixed-section-number"/>
     4938    </xsl:when>
     4939    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number=''">
     4940      <xsl:text>unnumbered-</xsl:text>
     4941      <xsl:number count="section[@x:fixed-section-number='']" level="any"/>
    48444942    </xsl:when>
    48454943    <xsl:when test="self::section and parent::ed:ins and local-name(../..)='replace'">
     
    49435041
    49445042  <div xmlns="http://www.w3.org/1999/xhtml" id="{$anch}">
     5043
    49455044    <xsl:if test="@anchor!=''">
    49465045      <div id="{@anchor}"/>
     
    49555054        <xsl:otherwise>full</xsl:otherwise>
    49565055      </xsl:choose>
     5056      <xsl:choose>
     5057        <xsl:when test="@align='left'"> left</xsl:when>
     5058        <xsl:when test="@align='right'"> right</xsl:when>
     5059        <xsl:when test="@align='center' or not(@align) or @align=''"> center</xsl:when>
     5060        <xsl:otherwise/>
     5061      </xsl:choose>
     5062
    49575063    </xsl:variable>
    49585064
    4959     <table summary="{preamble}" class="{$style}" cellpadding="3" cellspacing="0">
    4960 
     5065    <table class="{$style}" cellpadding="3" cellspacing="0">
    49615066      <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
    49625067        <xsl:variable name="n"><xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/></xsl:variable>
     
    49755080        <xsl:variable name="columns" select="count(ttcol)"/>
    49765081        <xsl:variable name="fields" select="c | ed:replace/ed:ins/c | ed:replace/ed:del/c"/>
    4977         <xsl:for-each select="$fields[(position() mod $columns) = 1]">
     5082        <xsl:for-each select="$fields[$columns=1 or (position() mod $columns) = 1]">
    49785083          <tr>
    49795084            <xsl:for-each select=". | following-sibling::c[position() &lt; $columns]">
     
    51225227<xsl:template match="/*/middle//section[not(myns:unnumbered) and not(ancestor::section)]" mode="links">
    51235228  <xsl:variable name="sectionNumber"><xsl:call-template name="get-section-number"/></xsl:variable>
    5124   <link xmlns="http://www.w3.org/1999/xhtml" rel="Chapter" title="{$sectionNumber} {@title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
     5229  <xsl:variable name="title">
     5230    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
     5231      <xsl:value-of select="$sectionNumber"/>
     5232      <xsl:text> </xsl:text>
     5233    </xsl:if>
     5234    <xsl:value-of select="@title"/>
     5235  </xsl:variable>
     5236  <link xmlns="http://www.w3.org/1999/xhtml" rel="Chapter" title="{$title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
    51255237  <xsl:apply-templates mode="links"/>
    51265238</xsl:template>
     
    51285240<xsl:template match="/*/back//section[not(myns:unnumbered) and not(ancestor::section)]" mode="links">
    51295241  <xsl:variable name="sectionNumber"><xsl:call-template name="get-section-number"/></xsl:variable>
    5130   <link xmlns="http://www.w3.org/1999/xhtml" rel="Appendix" title="{$sectionNumber} {@title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
     5242  <xsl:variable name="title">
     5243    <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
     5244      <xsl:value-of select="$sectionNumber"/>
     5245      <xsl:text> </xsl:text>
     5246    </xsl:if>
     5247    <xsl:value-of select="@title"/>
     5248  </xsl:variable>
     5249  <link xmlns="http://www.w3.org/1999/xhtml" rel="Appendix" title="{$title}" href="#{$anchor-prefix}.section.{$sectionNumber}"/>
    51315250  <xsl:apply-templates mode="links"/>
    51325251</xsl:template>
     
    52065325    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    52075326    <!-- when RCS keyword substitution in place, add version info -->
    5208     <xsl:if test="contains('$Revision: 1.439 $',':')">
    5209       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.439 $', 'Revision: '),'$','')),', ')"/>
     5327    <xsl:if test="contains('$Revision: 1.447 $',':')">
     5328      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.447 $', 'Revision: '),'$','')),', ')"/>
    52105329    </xsl:if>
    5211     <xsl:if test="contains('$Date: 2009-06-09 18:43:39 $',':')">
    5212       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-06-09 18:43:39 $', 'Date: '),'$','')),', ')"/>
     5330    <xsl:if test="contains('$Date: 2009-08-04 19:54:03 $',':')">
     5331      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-08-04 19:54:03 $', 'Date: '),'$','')),', ')"/>
    52135332    </xsl:if>
    52145333    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/>
     
    52425361  <xsl:variable name="anchor" select="@anchor"/>
    52435362  <xsl:choose>
    5244     <xsl:when test="@x:fixed-section-number">
     5363    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number!=''">
    52455364      <xsl:value-of select="@x:fixed-section-number"/>
     5365    </xsl:when>
     5366    <xsl:when test="@x:fixed-section-number and @x:fixed-section-number=''">
     5367      <xsl:text>unnumbered-</xsl:text>
     5368      <xsl:number count="section[@x:fixed-section-number='']" level="any"/>
    52465369    </xsl:when>
    52475370    <xsl:when test="$has-edits or ancestor::*/@x:fixed-section-number">
Note: See TracChangeset for help on using the changeset viewer.