Ignore:
Timestamp:
31/01/10 23:09:48 (10 years ago)
Author:
julian.reschke@…
Message:

Update to latest version of xml2rfc and rfc2629.xslt, bump document dates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629.xslt

    r741 r754  
    22    XSLT transformation from RFC2629 XML format to HTML
    33
    4     Copyright (c) 2006-2009, Julian Reschke (julian.reschke@greenbytes.de)
     4    Copyright (c) 2006-2010, Julian Reschke (julian.reschke@greenbytes.de)
    55    All rights reserved.
    66
     
    290290</xsl:param>
    291291
    292 <!-- experimental support for RFC 5741, work in progress -->
    293 
    294 <xsl:param name="xml2rfc-ext-hab">
    295   <xsl:call-template name="parse-pis">
    296     <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
    297     <xsl:with-param name="attr" select="'h-a-b'"/>
    298     <xsl:with-param name="default" select="'no'"/>
    299   </xsl:call-template>
    300 </xsl:param>
    301 
    302292<!-- experimental support for TLP 4.0, work in progress -->
    303293
     
    436426    <xsl:when test="$pub-yearmonth >= 201001 or
    437427      ($rfcno=5741 or $rfcno=5742 or $rfcno=5743)"
     428      >2010</xsl:when>
     429    <xsl:otherwise/>
     430  </xsl:choose>   
     431</xsl:variable>
     432
     433<xsl:variable name="rfc-boilerplate">
     434  <xsl:choose>
     435    <!-- RFC boilerplate as defined in RFC 5741, and deployed end of Dec 2009 -->
     436    <xsl:when test="$pub-yearmonth >= 201001 or
     437      ($rfcno=5741 or $rfcno=5742 or $rfcno=5743)"
     438      >2010</xsl:when>
     439    <xsl:when test="$xml2rfc-ext-tlp='4'">2010</xsl:when>
     440    <xsl:otherwise/>
     441  </xsl:choose>   
     442</xsl:variable>
     443
     444<xsl:variable name="id-boilerplate">
     445  <xsl:choose>
     446    <!-- ID boilerplate approved by IESG on Jan 14 2010-->
     447    <xsl:when test="$pub-yearmonth >= 201004"
    438448      >2010</xsl:when>
    439449    <xsl:otherwise/>
     
    494504  )" />
    495505
     506<!-- this makes the Jan 2010 TLP text depend on the tlp ext PI
     507     for IDs, and around 2010-01 for RFCs-->
     508<xsl:variable name="ipr-2010-01" select="(
     509    ( not(/rfc/@number) and $xml2rfc-ext-tlp='4' )
     510    or
     511    (
     512      /rfc/@number and ($pub-yearmonth >= 201001 or
     513      $rfcno=5741 or $rfcno=5742 or $rfcno=5743)
     514    )
     515  )" />
     516
    496517<!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html -->
    497518<!-- for IDs, implement the change as 2009-11 -->
     
    522543<!-- does the document contain edits? -->
    523544<xsl:variable name="has-edits" select="//ed:ins | //ed:del | //ed:replace" />
    524 
    525 <!-- Templates for the various elements of rfc2629.dtd -->
    526545             
    527546<xsl:template match="text()[not(ancestor::artwork)]">
    528   <xsl:variable name="starts-with-ws" select="translate(substring(.,1,1),'&#9;&#10;&#13;&#32;','')"/>
    529   <xsl:variable name="ends-with-ws" select="translate(substring(.,string-length(.),1),'&#9;&#10;&#13;&#32;','')"/>
     547  <xsl:variable name="ws" select="'&#9;&#10;&#13;&#32;'"/>
     548  <xsl:variable name="starts-with-ws" select="translate(substring(.,1,1),$ws,'')"/>
     549  <xsl:variable name="ends-with-ws" select="translate(substring(.,string-length(.),1),$ws,'')"/>
    530550  <!--<xsl:message> Orig: "<xsl:value-of select="."/>"</xsl:message>
    531551  <xsl:message>Start: "<xsl:value-of select="$starts-with-ws"/>"</xsl:message>
     
    886906</xsl:template>
    887907
    888 <xsl:template match="back">
     908<!-- this is a named template because <back> may be absent -->
     909<xsl:template name="back">
    889910
    890911  <!-- add editorial comments -->
     
    899920     
    900921  <!-- add all other top-level sections under <back> -->
    901   <xsl:apply-templates select="*[not(self::references) and not(self::ed:replace and .//references)]" />
     922  <xsl:apply-templates select="back/*[not(self::references) and not(self::ed:replace and .//references)]" />
    902923
    903924  <!-- insert the index if index entries exist -->
     
    16971718      <link rel="Author" href="#{$anchor-prefix}.authors" />
    16981719      <xsl:if test="$xml2rfc-private=''">
    1699         <link rel="Copyright" href="#{$anchor-prefix}.copyright" />
     1720        <xsl:choose>
     1721          <xsl:when test="$no-copylong">
     1722            <link rel="Copyright" href="#{$anchor-prefix}.copyrightnotice" />
     1723          </xsl:when>
     1724          <xsl:otherwise>
     1725            <link rel="Copyright" href="#{$anchor-prefix}.copyright" />
     1726          </xsl:otherwise>
     1727        </xsl:choose>
    17001728      </xsl:if>
    17011729      <xsl:if test="$has-index">
     
    17351763      <xsl:if test="$xml2rfc-ext-support-rfc2731!='no'">
    17361764        <!-- Dublin Core Metadata -->
    1737         <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" />
     1765        <link rel="schema.dct" href="http://purl.org/dc/terms/" />
    17381766             
    17391767        <!-- DC creator, see RFC2731 -->
     
    17421770            <xsl:call-template name="format-initials"/>
    17431771          </xsl:variable>
    1744           <meta name="DC.Creator" content="{concat(@surname,', ',$initials)}" />
     1772          <meta name="dct.creator" content="{concat(@surname,', ',$initials)}" />
    17451773        </xsl:for-each>
    17461774       
     
    17481776          <xsl:choose>
    17491777            <xsl:when test="@number">
    1750               <meta name="DC.Identifier" content="urn:ietf:rfc:{@number}" />
     1778              <meta name="dct.identifier" content="urn:ietf:rfc:{@number}" />
    17511779            </xsl:when>
    17521780            <xsl:when test="@docName">
    1753               <meta name="DC.Identifier" content="urn:ietf:id:{@docName}" />
     1781              <meta name="dct.identifier" content="urn:ietf:id:{@docName}" />
    17541782            </xsl:when>
    17551783            <xsl:otherwise/>
    17561784          </xsl:choose>
    1757           <meta name="DC.Date.Issued" scheme="ISO8601">
     1785          <meta name="dct.issued" scheme="ISO8601">
    17581786            <xsl:attribute name="content">
    17591787              <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$pub-month-numeric)"/>
     
    17721800 
    17731801        <xsl:if test="front/abstract">
    1774           <meta name="DC.Description.Abstract" content="{normalize-space(front/abstract)}" />
     1802          <meta name="dct.abstract" content="{normalize-space(front/abstract)}" />
    17751803        </xsl:if>     
    17761804
    17771805        <xsl:if test="@number">
    1778           <meta name="DC.isPartOf" content="urn:issn:2070-1721" />
     1806          <meta name="dct.isPartOf" content="urn:issn:2070-1721" />
    17791807        </xsl:if>     
    17801808
    17811809      </xsl:if>
    17821810     
    1783       <!-- this replicates dc.description.abstract, but is used by Google & friends -->
     1811      <!-- this replicates dct.abstract, but is used by Google & friends -->
    17841812      <xsl:if test="front/abstract">
    17851813        <meta name="description" content="{normalize-space(front/abstract)}" />
     
    17931821      <xsl:apply-templates select="front" />
    17941822      <xsl:apply-templates select="middle" />
    1795       <xsl:apply-templates select="back" />
     1823      <xsl:call-template name="back" />
    17961824    </body>
    17971825  </html>
     
    25092537      </xsl:when>
    25102538      <xsl:otherwise>
     2539        <xsl:if test="starts-with(/rfc/@docName,'draft-ietf-') and not(/rfc/front/workgroup)">
     2540          <xsl:call-template name="info">
     2541            <xsl:with-param name="inline" select="'no'"/>
     2542            <xsl:with-param name="msg">WG submissions should include a /rfc/front/workgroup element</xsl:with-param>
     2543          </xsl:call-template>
     2544        </xsl:if>
    25112545        <myns:item>Network Working Group</myns:item>
    25122546      </xsl:otherwise>
     
    25142548    <myns:item>
    25152549       <xsl:choose>
    2516         <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet Draft</xsl:when>
     2550        <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet-Draft</xsl:when>
    25172551        <xsl:otherwise>Request for Comments: <xsl:value-of select="/rfc/@number"/></xsl:otherwise>
    25182552      </xsl:choose>
    25192553    </myns:item>
    2520     <xsl:if test="/rfc/@obsoletes and /rfc/@obsoletes!=''">
     2554    <xsl:if test="/rfc/@obsoletes!=''">
    25212555      <myns:item>
    25222556        <xsl:text>Obsoletes: </xsl:text>
     
    25372571      </myns:item>
    25382572    </xsl:if>
    2539     <xsl:if test="/rfc/@updates and /rfc/@updates!=''">
     2573    <xsl:if test="/rfc/@updates!=''">
    25402574      <myns:item>
    25412575        <xsl:text>Updates: </xsl:text>
     
    28342868          <t>
    28352869            This document is subject to the rights, licenses and restrictions
    2836             contained in BCP 78<xsl:if test="$submissionType='independent'"> and at <eref target="http://www.rfc-editor.org/copyright.html"/></xsl:if>, and except as set forth therein, the authors
     2870            contained in BCP 78<xsl:if test="$submissionType='independent'"> and at <eref target="http://www.rfc-editor.org/copyright.html">http://www.rfc-editor.org/copyright.html</eref></xsl:if>, and except as set forth therein, the authors
    28372871            retain all their rights.
    28382872          </t>
     
    28712905          <t>
    28722906            The limited permissions granted above are perpetual and will not be
    2873             revoked by the Internet Society or its successors or assignees.
     2907            revoked by the Internet Society or its successors or assigns.
    28742908          </t>
    28752909          <t>
     
    29042938            of such proprietary rights by implementers or users of this
    29052939            specification can be obtained from the IETF on-line IPR repository
    2906             at <eref target="http://www.ietf.org/ipr"/>.
     2940            at <eref target="http://www.ietf.org/ipr">http://www.ietf.org/ipr</eref>.
    29072941          </t>       
    29082942          <t>
     
    39794013          </xsl:when>
    39804014 
    3981           <!-- as of Feb 2010 -->
    3982           <xsl:when test="$xml2rfc-ext-tlp='4' and (/rfc/@ipr = 'trust200902'
     4015          <!-- as of Jan 2010, TLP 4.0 -->
     4016          <xsl:when test="$ipr-2010-01 and (/rfc/@ipr = 'trust200902'
    39834017                          or /rfc/@ipr = 'noModificationTrust200902'
    39844018                          or /rfc/@ipr = 'noDerivativesTrust200902'
     
    40324066        </xsl:choose>
    40334067      </t>
    4034       <t>
    4035         Internet-Drafts are working documents of the Internet Engineering
    4036         Task Force (IETF), its areas, and its working groups.
    4037         Note that other groups may also distribute working documents as
    4038         Internet-Drafts.
    4039       </t>
     4068      <xsl:choose>
     4069        <xsl:when test="$id-boilerplate='2010'">
     4070          <t>
     4071            Internet-Drafts are working documents of the Internet Engineering
     4072            Task Force (IETF). Note that other groups may also distribute
     4073            working documents as Internet-Drafts. The list of current
     4074            Internet-Drafts is at <eref target='http://datatracker.ietf.org/drafts/current/'>http://datatracker.ietf.org/drafts/current/</eref>.
     4075          </t>
     4076        </xsl:when>
     4077        <xsl:otherwise>
     4078          <t>
     4079            Internet-Drafts are working documents of the Internet Engineering
     4080            Task Force (IETF), its areas, and its working groups.
     4081            Note that other groups may also distribute working documents as
     4082            Internet-Drafts.
     4083          </t>
     4084        </xsl:otherwise>
     4085      </xsl:choose>
    40404086      <t>
    40414087        Internet-Drafts are draft documents valid for a maximum of six months
     
    40444090        them other than as &#8220;work in progress&#8221;.
    40454091      </t>
    4046       <t>
    4047         The list of current Internet-Drafts can be accessed at
    4048         <eref target='http://www.ietf.org/ietf/1id-abstracts.txt'/>.
    4049       </t>
    4050       <t>
    4051         The list of Internet-Draft Shadow Directories can be accessed at
    4052         <eref target='http://www.ietf.org/shadow.html'/>.
    4053       </t>
     4092      <xsl:if test="$id-boilerplate=''">
     4093        <t>
     4094          The list of current Internet-Drafts can be accessed at
     4095          <eref target='http://www.ietf.org/ietf/1id-abstracts.txt'>http://www.ietf.org/ietf/1id-abstracts.txt</eref>.
     4096        </t>
     4097        <t>
     4098          The list of Internet-Draft Shadow Directories can be accessed at
     4099          <eref target='http://www.ietf.org/shadow.html'>http://www.ietf.org/shadow.html</eref>.
     4100        </t>
     4101      </xsl:if>
    40544102      <t>
    40554103        This Internet-Draft will expire in <xsl:call-template name="expirydate" />.
     
    40574105    </xsl:when>
    40584106
    4059     <xsl:when test="/rfc/@category='bcp' and $xml2rfc-ext-hab='yes'">
     4107    <xsl:when test="/rfc/@category='bcp' and $rfc-boilerplate='2010'">
    40604108      <t>
    40614109        This memo documents an Internet Best Current Practice.
     
    40694117      </t>
    40704118    </xsl:when>
    4071     <xsl:when test="/rfc/@category='exp' and $xml2rfc-ext-hab='yes'">
     4119    <xsl:when test="/rfc/@category='exp' and $rfc-boilerplate='2010'">
    40724120      <t>
    40734121        This document is not an Internet Standards Track specification; it is
     
    40834131      </t>
    40844132    </xsl:when>
    4085     <xsl:when test="/rfc/@category='historic' and $xml2rfc-ext-hab='yes'">
     4133    <xsl:when test="/rfc/@category='historic' and $rfc-boilerplate='2010'">
    40864134      <t>
    40874135        This document is not an Internet Standards Track specification; it is
     
    40964144      </t>
    40974145    </xsl:when>
    4098     <xsl:when test="/rfc/@category='std' and $xml2rfc-ext-hab='yes'">
     4146    <xsl:when test="/rfc/@category='std' and $rfc-boilerplate='2010'">
    40994147      <t>
    41004148        This is an Internet Standards Track document.
     
    41104158      </t>
    41114159    </xsl:when>
    4112     <xsl:when test="(/rfc/@category='info' or not(/rfc/@category)) and $xml2rfc-ext-hab='yes'">
     4160    <xsl:when test="(/rfc/@category='info' or not(/rfc/@category)) and $rfc-boilerplate='2010'">
    41134161      <t>
    41144162        This document is not an Internet Standards Track specification; it is
     
    41354183   
    41364184  <!-- 2nd and 3rd paragraph -->
    4137   <xsl:if test="$xml2rfc-ext-hab='yes'">
     4185  <xsl:if test="$rfc-boilerplate='2010' and /rfc/@number">
    41384186    <t>
    41394187      <xsl:if test="/rfc/@category='exp'">
     
    42454293        </t>
    42464294        <xsl:choose>
    4247           <xsl:when test="$ipr-2009-09 and $xml2rfc-ext-tlp='4'">
     4295          <xsl:when test="$ipr-2010-01">
    42484296            <t>
    42494297              This document is subject to BCP 78 and the IETF Trust's Legal
     
    43974445</xsl:template>
    43984446
    4399 <xsl:template match="back" mode="toc">
     4447<xsl:template name="back-toc">
    44004448
    44014449  <xsl:if test="//cref and $xml2rfc-comments='yes' and $xml2rfc-inline!='yes'">
     
    44114459    <xsl:apply-templates select="/rfc/front" mode="toc" />
    44124460  </xsl:if>
    4413   <xsl:apply-templates select="*[not(self::references)]" mode="toc" />
     4461  <xsl:apply-templates select="back/*[not(self::references)]" mode="toc" />
    44144462
    44154463  <!-- insert the index if index entries exist -->
     
    45994647
    46004648<xsl:template match="rfc" mode="toc">
    4601   <xsl:apply-templates select="middle|back" mode="toc" />
     4649  <xsl:apply-templates select="middle" mode="toc" />
     4650  <xsl:call-template name="back-toc" />
    46024651</xsl:template>
    46034652
     
    46854734<xsl:template name="rfc-or-id-link">
    46864735  <xsl:param name="name" />
    4687   <xsl:call-template name="check-front-matter-ref">
    4688     <xsl:with-param name="name" select="$name"/>
    4689   </xsl:call-template>
    4690   <a>
    4691     <xsl:attribute name="href">
    4692       <xsl:choose>
    4693         <xsl:when test="starts-with($name,'draft-')">
    4694           <xsl:value-of select="concat($internetDraftUrlPrefix,$name,$internetDraftUrlPostfix)"/>
    4695         </xsl:when>
    4696         <xsl:otherwise>
    4697           <xsl:value-of select="concat($rfcUrlPrefix,$name,$rfcUrlPostfix)"/>
    4698         </xsl:otherwise>
    4699       </xsl:choose>
    4700     </xsl:attribute>
    4701     <xsl:value-of select="$name" />
    4702   </a>
     4736 
     4737  <xsl:choose>
     4738    <xsl:when test="starts-with($name,'draft-')">
     4739      <a href="{concat($internetDraftUrlPrefix,$name,$internetDraftUrlPostfix)}"><xsl:value-of select="$name"/></a>
     4740      <xsl:call-template name="check-front-matter-ref">
     4741        <xsl:with-param name="name" select="$name"/>
     4742      </xsl:call-template>
     4743    </xsl:when>
     4744    <xsl:when test="number($name)=$name">
     4745      <a href="{concat($rfcUrlPrefix,$name,$rfcUrlPostfix)}"><xsl:value-of select="$name"/></a>
     4746      <xsl:call-template name="check-front-matter-ref">
     4747        <xsl:with-param name="name" select="$name"/>
     4748      </xsl:call-template>
     4749    </xsl:when>
     4750    <xsl:otherwise>
     4751      <xsl:value-of select="$name"/>
     4752      <xsl:call-template name="warning">
     4753        <xsl:with-param name="inline" select="'no'"/>
     4754        <xsl:with-param name="msg" select="concat('In metadata obsoletes/updates, RFC number of draft name is expected - found: ',$name)"/>
     4755      </xsl:call-template>
     4756    </xsl:otherwise>
     4757  </xsl:choose>
    47034758</xsl:template>
    47044759
     
    47734828    <xsl:when test="contains($list,',')">
    47744829      <xsl:variable name="rfcNo" select="substring-before($list,',')" />
    4775       <meta name="DC.Relation.Replaces" content="urn:ietf:rfc:{$rfcNo}" />
     4830      <meta name="dct.replaces" content="urn:ietf:rfc:{$rfcNo}" />
    47764831      <xsl:call-template name="rfclist-for-dcmeta">
    47774832        <xsl:with-param name="list" select="normalize-space(substring-after($list,','))" />
     
    47804835    <xsl:otherwise>
    47814836      <xsl:variable name="rfcNo" select="$list" />
    4782       <meta name="DC.Relation.Replaces" content="urn:ietf:rfc:{$rfcNo}" />
     4837      <meta name="dct.replaces" content="urn:ietf:rfc:{$rfcNo}" />
    47834838    </xsl:otherwise>
    47844839  </xsl:choose>
     
    48404895<!-- Notes -->
    48414896<xsl:template match="x:note">
     4897  <xsl:variable name="p">
     4898    <xsl:call-template name="get-paragraph-number" />
     4899  </xsl:variable>
     4900
    48424901  <div class="note">
     4902    <xsl:if test="$p!='' and not(ancestor::ed:del) and not(ancestor::ed:ins)">
     4903      <xsl:attribute name="id"><xsl:value-of select="$anchor-prefix"/>.section.<xsl:value-of select="$p"/></xsl:attribute>
     4904    </xsl:if>
    48434905    <xsl:apply-templates/>
    48444906  </div>
     
    56625724</xsl:template>
    56635725
     5726<xsl:template name="info">
     5727  <xsl:param name="msg"/>
     5728  <xsl:param name="msg2"/>
     5729  <xsl:param name="inline"/>
     5730  <xsl:call-template name="emit-message">
     5731    <xsl:with-param name="level">INFO</xsl:with-param>
     5732    <xsl:with-param name="msg" select="$msg"/>
     5733    <xsl:with-param name="msg2" select="$msg2"/>
     5734    <xsl:with-param name="inline" select="$inline"/>
     5735  </xsl:call-template>
     5736</xsl:template>
     5737
    56645738<xsl:template name="error">
    56655739  <xsl:param name="msg"/>
     
    59806054    <xsl:when test="$xml2rfc-header!=''"><xsl:value-of select="$xml2rfc-header" /></xsl:when>
    59816055    <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, header not set -->
    5982     <xsl:when test="/rfc/@ipr and not(/rfc/@number)">INTERNET DRAFT</xsl:when>
     6056    <xsl:when test="/rfc/@ipr and not(/rfc/@number)">Internet-Draft</xsl:when>
    59836057    <xsl:otherwise>RFC <xsl:value-of select="/rfc/@number"/></xsl:otherwise>
    59846058  </xsl:choose>
     
    59896063    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    59906064    <!-- when RCS keyword substitution in place, add version info -->
    5991     <xsl:if test="contains('$Revision: 1.497 $',':')">
    5992       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.497 $', 'Revision: '),'$','')),', ')" />
     6065    <xsl:if test="contains('$Revision: 1.508 $',':')">
     6066      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.508 $', 'Revision: '),'$','')),', ')" />
    59936067    </xsl:if>
    5994     <xsl:if test="contains('$Date: 2009-12-30 19:57:37 $',':')">
    5995       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-12-30 19:57:37 $', 'Date: '),'$','')),', ')" />
     6068    <xsl:if test="contains('$Date: 2010-01-29 12:52:17 $',':')">
     6069      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2010-01-29 12:52:17 $', 'Date: '),'$','')),', ')" />
    59966070    </xsl:if>
    59976071    <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.