Ignore:
Timestamp:
Oct 2, 2009, 3:46:42 AM (10 years ago)
Author:
julian.reschke@…
Message:

Bump up document dates, update to latest versions of rfc2629.xslt and xml2rfc.tcl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629toXHTML.xslt

    r689 r704  
    77<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" encoding="UTF-8" method="xml"/>
    88
    9 <!-- process some of the processing instructions supported by Marshall T. Rose's
    10      xml2rfc sofware, see <http://xml.resource.org/> -->
    11 
    12 <!-- delimiters in PIs -->
    13 <xsl:variable name="quote-chars">"'</xsl:variable>     
    14      
    159<!-- rfc comments PI -->
    1610
    17 <xsl:param name="xml2rfc-comments" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'comments=')], concat($quote-chars,' '), ''),         'comments=')"/>
     11<xsl:param name="xml2rfc-comments">
     12  <xsl:call-template name="parse-pis">
     13    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     14    <xsl:with-param name="attr" select="'comments'"/>
     15    <xsl:with-param name="default" select="'no'"/>
     16  </xsl:call-template>
     17</xsl:param>
    1818
    1919<!-- rfc compact PI -->
    2020
    21 <xsl:param name="xml2rfc-compact" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'compact=')], concat($quote-chars,' '), ''),         'compact=')"/>
     21<xsl:param name="xml2rfc-compact">
     22  <xsl:call-template name="parse-pis">
     23    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     24    <xsl:with-param name="attr" select="'compact'"/>
     25    <xsl:with-param name="default" select="$xml2rfc-rfcedstyle"/>
     26  </xsl:call-template>
     27</xsl:param>
    2228
    2329<!-- rfc footer PI -->
    2430
    25 <xsl:param name="xml2rfc-footer" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'footer=')], concat($quote-chars,' '), ''),         'footer=')"/>
     31<xsl:param name="xml2rfc-footer">
     32  <xsl:call-template name="parse-pis">
     33    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     34    <xsl:with-param name="attr" select="'footer'"/>
     35  </xsl:call-template>
     36</xsl:param>
    2637
    2738<!-- rfc header PI -->
    2839
    29 <xsl:param name="xml2rfc-header" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'header=')], concat($quote-chars,' '), ''),         'header=')"/>
     40<xsl:param name="xml2rfc-header">
     41  <xsl:call-template name="parse-pis">
     42    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     43    <xsl:with-param name="attr" select="'header'"/>
     44  </xsl:call-template>
     45</xsl:param>
    3046
    3147<!-- rfc inline PI -->
    3248
    33 <xsl:param name="xml2rfc-inline" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'inline=')], concat($quote-chars,' '), ''),         'inline=')"/>
    34 
    35 <!-- rfc strict PI -->
    36 
    37 <xsl:param name="xml2rfc-strict" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'strict=')], concat($quote-chars,' '), ''),         'strict=')"/>
     49<xsl:param name="xml2rfc-inline">
     50  <xsl:call-template name="parse-pis">
     51    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     52    <xsl:with-param name="attr" select="'inline'"/>
     53    <xsl:with-param name="default" select="'no'"/>
     54  </xsl:call-template>
     55</xsl:param>
    3856
    3957<!-- include a table of contents if a processing instruction <?rfc?>
    4058     exists with contents toc="yes". Can be overriden by an XSLT parameter -->
    4159
    42 <xsl:param name="xml2rfc-toc" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'toc=')], concat($quote-chars,' '), ''),         'toc=')"/>
     60<xsl:param name="xml2rfc-toc">
     61  <xsl:call-template name="parse-pis">
     62    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     63    <xsl:with-param name="attr" select="'toc'"/>
     64    <xsl:with-param name="default" select="'no'"/>
     65  </xsl:call-template>
     66</xsl:param>
    4367
    4468<!-- optional tocdepth-->
    4569
    46 <xsl:param name="xml2rfc-tocdepth" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'tocdepth=')], concat($quote-chars,' '), ''),         'tocdepth=')"/>
     70<xsl:param name="xml2rfc-tocdepth">
     71  <xsl:call-template name="parse-pis">
     72    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     73    <xsl:with-param name="attr" select="'tocdepth'"/>
     74    <xsl:with-param name="default" select="'3'"/>
     75  </xsl:call-template>
     76</xsl:param>
    4777
    4878<xsl:variable name="parsedTocDepth">
     
    6090     exists with contents tocblock="no". Can be overriden by an XSLT parameter -->
    6191
    62 <xsl:param name="xml2rfc-topblock" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'topblock=')], concat($quote-chars,' '), ''),         'topblock=')"/>
     92<xsl:param name="xml2rfc-topblock">
     93  <xsl:call-template name="parse-pis">
     94    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     95    <xsl:with-param name="attr" select="'topblock'"/>
     96    <xsl:with-param name="default" select="'yes'"/>
     97  </xsl:call-template>
     98</xsl:param>
    6399
    64100<!-- Format to the RFC Editor's taste -->
    65101
    66 <xsl:param name="xml2rfc-rfcedstyle" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'rfcedstyle=')], concat($quote-chars,' '), ''),         'rfcedstyle=')"/>
     102<xsl:param name="xml2rfc-rfcedstyle">
     103  <xsl:call-template name="parse-pis">
     104    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     105    <xsl:with-param name="attr" select="'rfcedstyle'"/>
     106    <xsl:with-param name="default" select="'no'"/>
     107  </xsl:call-template>
     108</xsl:param>
     109
     110<!-- the name of an automatically inserted references section -->
     111
     112<xsl:param name="xml2rfc-refparent">
     113  <xsl:call-template name="parse-pis">
     114    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     115    <xsl:with-param name="attr" select="'refparent'"/>
     116    <xsl:with-param name="default" select="'References'"/>
     117  </xsl:call-template>
     118</xsl:param>
    67119
    68120<!-- use symbolic reference names instead of numeric ones unless a processing instruction <?rfc?>
    69121     exists with contents symrefs="no". Can be overriden by an XSLT parameter -->
    70122
    71 <xsl:param name="xml2rfc-symrefs" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'symrefs=')], concat($quote-chars,' '), ''),         'symrefs=')"/>
     123<xsl:param name="xml2rfc-symrefs">
     124  <xsl:call-template name="parse-pis">
     125    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     126    <xsl:with-param name="attr" select="'symrefs'"/>
     127    <xsl:with-param name="default" select="'yes'"/>
     128  </xsl:call-template>
     129</xsl:param>
    72130
    73131<!-- sort references if a processing instruction <?rfc?>
    74132     exists with contents sortrefs="yes". Can be overriden by an XSLT parameter -->
    75133
    76 <xsl:param name="xml2rfc-sortrefs" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'sortrefs=')], concat($quote-chars,' '), ''),         'sortrefs=')"/>
     134<xsl:param name="xml2rfc-sortrefs">
     135  <xsl:call-template name="parse-pis">
     136    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     137    <xsl:with-param name="attr" select="'sortrefs'"/>
     138    <xsl:with-param name="default" select="'no'"/>
     139  </xsl:call-template>
     140</xsl:param>
    77141
    78142<!-- insert editing marks if a processing instruction <?rfc?>
    79143     exists with contents editing="yes". Can be overriden by an XSLT parameter -->
    80144
    81 <xsl:param name="xml2rfc-editing" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'editing=')], concat($quote-chars,' '), ''),         'editing=')"/>
     145<xsl:param name="xml2rfc-editing">
     146  <xsl:call-template name="parse-pis">
     147    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     148    <xsl:with-param name="attr" select="'editing'"/>
     149    <xsl:with-param name="default" select="'no'"/>
     150  </xsl:call-template>
     151</xsl:param>
    82152
    83153<!-- make it a private paper -->
    84154
    85 <xsl:param name="xml2rfc-private" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'private=')], $quote-chars, ''),         'private=')"/>
     155<xsl:param name="xml2rfc-private">
     156  <xsl:call-template name="parse-pis">
     157    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     158    <xsl:with-param name="attr" select="'private'"/>
     159  </xsl:call-template>
     160</xsl:param>
    86161
    87162<!-- background image? -->
    88163
    89 <xsl:param name="xml2rfc-background" select="substring-after(       translate(/processing-instruction('rfc')[contains(.,'background=')], $quote-chars, ''),         'background=')"/>
     164<xsl:param name="xml2rfc-background">
     165  <xsl:call-template name="parse-pis">
     166    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     167    <xsl:with-param name="attr" select="'background'"/>
     168  </xsl:call-template>
     169</xsl:param>
    90170
    91171<!-- extension for XML parsing in artwork -->
    92172
    93 <xsl:param name="xml2rfc-ext-parse-xml-in-artwork" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'parse-xml-in-artwork=')], concat($quote-chars,' '), ''),         'parse-xml-in-artwork=')"/>
     173<xsl:param name="xml2rfc-ext-parse-xml-in-artwork">
     174  <xsl:call-template name="parse-pis">
     175    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     176    <xsl:with-param name="attr" select="'parse-xml-in-artwork'"/>
     177    <xsl:with-param name="default" select="'no'"/>
     178  </xsl:call-template>
     179</xsl:param>
    94180
    95181<!-- extension for excluding DCMI properties in meta tag (RFC2731) -->
    96182
    97 <xsl:param name="xml2rfc-ext-support-rfc2731" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'support-rfc2731=')], concat($quote-chars,' '), ''),         'support-rfc2731=')"/>
     183<xsl:param name="xml2rfc-ext-support-rfc2731">
     184  <xsl:call-template name="parse-pis">
     185    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     186    <xsl:with-param name="attr" select="'support-rfc2731'"/>
     187    <xsl:with-param name="default" select="'yes'"/>
     188  </xsl:call-template>
     189</xsl:param>
    98190
    99191<!-- extension for allowing markup inside artwork -->
    100192
    101 <xsl:param name="xml2rfc-ext-allow-markup-in-artwork" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'allow-markup-in-artwork=')], concat($quote-chars,' '), ''),         'allow-markup-in-artwork=')"/>
     193<xsl:param name="xml2rfc-ext-allow-markup-in-artwork">
     194  <xsl:call-template name="parse-pis">
     195    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     196    <xsl:with-param name="attr" select="'allow-markup-in-artwork'"/>
     197    <xsl:with-param name="default" select="'no'"/>
     198  </xsl:call-template>
     199</xsl:param>
    102200
    103201<!-- extension for including references into index -->
    104202
    105 <xsl:param name="xml2rfc-ext-include-references-in-index" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'include-references-in-index=')], concat($quote-chars,' '), ''),         'include-references-in-index=')"/>
     203<xsl:param name="xml2rfc-ext-include-references-in-index">
     204  <xsl:call-template name="parse-pis">
     205    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     206    <xsl:with-param name="attr" select="'include-references-in-index'"/>
     207    <xsl:with-param name="default" select="'no'"/>
     208  </xsl:call-template>
     209</xsl:param>
    106210
    107211<!-- position of author's section -->
    108212
    109 <xsl:param name="xml2rfc-ext-authors-section" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'authors-section=')], concat($quote-chars,' '), ''),         'authors-section=')"/>
     213<xsl:param name="xml2rfc-ext-authors-section">
     214  <xsl:call-template name="parse-pis">
     215    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     216    <xsl:with-param name="attr" select="'authors-section'"/>
     217  </xsl:call-template>
     218</xsl:param>
    110219
    111220<!-- justification? -->
    112221
    113 <xsl:param name="xml2rfc-ext-justification" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'justification=')], concat($quote-chars,' '), ''),         'justification=')"/>
     222<xsl:param name="xml2rfc-ext-justification">
     223  <xsl:call-template name="parse-pis">
     224    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     225    <xsl:with-param name="attr" select="'justification'"/>
     226    <xsl:with-param name="default" select="'no'"/>
     227  </xsl:call-template>
     228</xsl:param>
     229
     230<!-- switch for doublesided layout -->
     231
     232<xsl:param name="xml2rfc-ext-duplex">
     233  <xsl:call-template name="parse-pis">
     234    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     235    <xsl:with-param name="attr" select="'duplex'"/>
     236    <xsl:with-param name="default" select="'no'"/>
     237  </xsl:call-template>
     238</xsl:param>
    114239
    115240<!-- trailing dots in section numbers -->
    116241
    117 <xsl:param name="xml2rfc-ext-sec-no-trailing-dots" select="substring-after(       translate(/processing-instruction('rfc-ext')[contains(.,'sec-no-trailing-dots=')], concat($quote-chars,' '), ''),         'sec-no-trailing-dots=')"/>
     242<xsl:param name="xml2rfc-ext-sec-no-trailing-dots">
     243  <xsl:call-template name="parse-pis">
     244    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     245    <xsl:with-param name="attr" select="'sec-no-trailing-dots'"/>
     246  </xsl:call-template>
     247</xsl:param>
    118248
    119249<!-- choose whether or not to do mailto links -->
    120250 
    121 <xsl:param name="xml2rfc-linkmailto" select="substring-after(        translate(/processing-instruction('rfc')[contains(.,'linkmailto=')], concat($quote-chars,' '), ''),          'linkmailto=')"/>
    122 
     251<xsl:param name="xml2rfc-linkmailto">
     252  <xsl:call-template name="parse-pis">
     253    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     254    <xsl:with-param name="attr" select="'linkmailto'"/>
     255    <xsl:with-param name="default" select="'yes'"/>
     256  </xsl:call-template>
     257</xsl:param>
    123258
    124259<!-- iprnotified switch -->
    125260 
    126 <xsl:param name="xml2rfc-iprnotified" select="substring-after(        translate(/processing-instruction('rfc')[contains(.,'iprnotified=')], concat($quote-chars,' '), ''),          'iprnotified=')"/>
     261<xsl:param name="xml2rfc-iprnotified">
     262  <xsl:call-template name="parse-pis">
     263    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     264    <xsl:with-param name="attr" select="'iprnotified'"/>
     265    <xsl:with-param name="default" select="'no'"/>
     266  </xsl:call-template>
     267</xsl:param>
    127268
    128269<!-- URL templates for RFCs and Internet Drafts. -->
     
    175316<xsl:variable name="ipr-rfc3667" select="(   /rfc/@number &gt; 3708) or   not(     (/rfc/@ipr = 'full2026') or     (/rfc/@ipr = 'noDerivativeWorks2026') or     (/rfc/@ipr = 'noDerivativeWorksNow') or     (/rfc/@ipr = 'none') or     (/rfc/@ipr = '') or     not(/rfc/@ipr)   )"/>
    176317
    177 <xsl:variable name="ipr-rfc4748" select="(   $ipr-rfc3667 and     (       (/rfc/@number &gt; 4671) or       ($xml2rfc-ext-pub-year &gt; 2006) or       ($xml2rfc-ext-pub-year &gt; 2005 and $xml2rfc-ext-pub-month-numeric &gt;= 11)     )   )"/>
    178 
    179 <xsl:variable name="ipr-2007-08" select="(   $ipr-rfc4748 and     (       (/rfc/@number &gt; 5000         and /rfc/@number != 5020         and /rfc/@number != 5021         and /rfc/@number != 5034         and /rfc/@number != 5052         and /rfc/@number != 5065         and /rfc/@number != 5094) or       ($xml2rfc-ext-pub-year &gt;= 2008) or       (not(/rfc/@number) and $xml2rfc-ext-pub-year &gt;= 2007 and $xml2rfc-ext-pub-month-numeric &gt;= 9)     )   )"/>
    180 
    181 <xsl:variable name="ipr-2008-11" select="(     /rfc/@number and     ($xml2rfc-ext-pub-year &gt;= 2009 or ($xml2rfc-ext-pub-year &gt;= 2008 and $xml2rfc-ext-pub-month-numeric &gt;= 11))   )   or   (     /rfc/@ipr = 'trust200811' or     /rfc/@ipr = 'noModificationTrust200811' or     /rfc/@ipr = 'noDerivativesTrust200902' or     /rfc/@ipr = 'trust200902' or     /rfc/@ipr = 'noModificationTrust200902' or     /rfc/@ipr = 'noDerivativesTrust200902' or     /rfc/@ipr = 'pre5378Trust200902'   )"/>
    182 
    183 <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))   )"/>
     318<xsl:variable name="rfcno" select="/rfc/@number"/> 
     319 
     320<xsl:variable name="ipr-rfc4748" select="(   $ipr-rfc3667 and     ( $rfcno &gt;= 4715 and ( $rfcno != 4718 and $rfcno != 4735 and $rfcno != 4749 ))     or     ( $rfcno=4578 or $rfcno=4582 or $rfcno=4583 or $rfcno=4628 or $rfcno=4629 or $rfcno=4639 or $rfcno=4651 or $rfcno=4682 or $rfcno=4684 or $rfcno=4695 or $rfcno=4696 )     or     ( not(/rfc/@number) and $pub-yearmonth &gt;= 200611)   )"/>
     321
     322<xsl:variable name="ipr-2007-08" select="(   $ipr-rfc4748 and     (       ($rfcno &gt; 5000         and $rfcno != 5020         and $rfcno != 5021         and $rfcno != 5034         and $rfcno != 5052         and $rfcno != 5065         and $rfcno != 5094) or       ($xml2rfc-ext-pub-year &gt;= 2008) or       (not(/rfc/@number) and $pub-yearmonth &gt;= 200709)     )   )"/>
     323
     324<xsl:variable name="ipr-2008-11" select="(     /rfc/@number and $pub-yearmonth &gt;= 200811   )   or   (     /rfc/@ipr = 'trust200811' or     /rfc/@ipr = 'noModificationTrust200811' or     /rfc/@ipr = 'noDerivativesTrust200902' or     /rfc/@ipr = 'trust200902' or     /rfc/@ipr = 'noModificationTrust200902' or     /rfc/@ipr = 'noDerivativesTrust200902' or     /rfc/@ipr = 'pre5378Trust200902'   )"/>
     325
     326<xsl:variable name="ipr-2009-02" select="(     $ipr-2008-11 and $pub-yearmonth &gt;= 200902   )"/>
     327
     328<!-- this makes the Sep 2009 TLP text depend on the publication date to be >= 2009-12
     329     for IDs, and around 2009-09 for RFCs-->
     330<xsl:variable name="ipr-2009-09" select="(     ( not(/rfc/@number) and $pub-yearmonth &gt;= 200912 )     or     (       /rfc/@number and $pub-yearmonth &gt;= 200909 and       $rfcno!=5582 and $rfcno!=5621 and $rfcno!=5632 and $rfcno!=5645 and $rfcno!=5646 and $rfcno!=5681      )   )"/>
    184331
    185332<!-- 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)     )   )"/>
     333<!-- for IDs, implement the change as 2009-12 -->
     334<xsl:variable name="abstract-first" select="(     (/rfc/@number and $pub-yearmonth &gt;= 200907)     or     (not(/rfc/@number) and $pub-yearmonth &gt;= 200912)   )"/>
    187335
    188336<!-- funding switch --> 
    189 <xsl:variable name="funding0" select="(   /rfc/@number &gt; 2499) or   (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 1999   )"/>
    190  
    191 <xsl:variable name="funding1" select="(   /rfc/@number &gt; 4320) or   (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 2006   )"/>
     337<xsl:variable name="funding0" select="(   $rfcno &gt; 2499) or   (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 1999   )"/>
     338 
     339<xsl:variable name="funding1" select="(   $rfcno &gt; 4320) or   (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 2006   )"/>
    192340
    193341<xsl:variable name="no-funding" select="$ipr-2007-08"/>
     
    261409    <xsl:otherwise/>
    262410  </xsl:choose>
     411</xsl:template>
     412
     413<xsl:template name="insert-begin-code">
     414  <xsl:if test="@x:isCodeComponent='yes'">
     415    <pre xmlns="http://www.w3.org/1999/xhtml" class="ccmarker cct"><span>&lt;CODE BEGINS&gt;</span></pre>
     416  </xsl:if>
     417</xsl:template>
     418
     419<xsl:template name="insert-end-code">
     420  <xsl:if test="@x:isCodeComponent='yes'">
     421    <pre xmlns="http://www.w3.org/1999/xhtml" class="ccmarker ccb"><span>&lt;CODE ENDS&gt;</span></pre>
     422  </xsl:if>
    263423</xsl:template>
    264424
     
    304464    <xsl:when test="@align='right'">
    305465      <div xmlns="http://www.w3.org/1999/xhtml" style="display:table; margin-left: auto; margin-right: 0pt;">
     466        <xsl:call-template name="insert-begin-code"/>
    306467        <pre style="margin-left: 0em;">
    307468          <xsl:call-template name="add-artwork-class"/>
     
    309470          <xsl:copy-of select="$display"/>
    310471        </pre>         
     472        <xsl:call-template name="insert-end-code"/>
    311473      </div>
    312474    </xsl:when>
    313475    <xsl:when test="@align='center'">
    314476      <div xmlns="http://www.w3.org/1999/xhtml" style="display:table; margin-left: auto; margin-right: auto;">
     477        <xsl:call-template name="insert-begin-code"/>
    315478        <pre style="margin-left: 0em;">
    316479          <xsl:call-template name="add-artwork-class"/>
     
    318481          <xsl:copy-of select="$display"/>
    319482        </pre>         
     483        <xsl:call-template name="insert-end-code"/>
    320484      </div>
    321485    </xsl:when>
    322486    <xsl:otherwise>
     487      <xsl:call-template name="insert-begin-code"/>
    323488      <pre xmlns="http://www.w3.org/1999/xhtml">
    324489        <xsl:call-template name="add-artwork-class"/>
     
    326491        <xsl:copy-of select="$display"/>
    327492      </pre>
     493      <xsl:call-template name="insert-end-code"/>
    328494    </xsl:otherwise>
    329495  </xsl:choose>
     
    455621            <xsl:for-each select="address/postal/street">
    456622              <span class="street-address vcardline">
    457                 <xsl:value-of select="."/>
     623                <xsl:call-template name="extract-normalized">
     624                  <xsl:with-param name="node" select="."/>
     625                  <xsl:with-param name="name" select="'street'"/>
     626                </xsl:call-template>
    458627              </span>
    459628            </xsl:for-each>
     
    461630          <xsl:if test="address/postal/city|address/postal/region|address/postal/code">
    462631            <span class="vcardline">
    463               <xsl:if test="address/postal/city"><span class="locality"><xsl:value-of select="address/postal/city"/></span>, </xsl:if>
    464               <xsl:if test="address/postal/region"><span class="region"><xsl:value-of select="address/postal/region"/></span> </xsl:if>
    465               <xsl:if test="address/postal/code"><span class="postal-code"><xsl:value-of select="address/postal/code"/></span></xsl:if>
     632              <xsl:if test="address/postal/city">
     633                <span class="locality">
     634                  <xsl:call-template name="extract-normalized">
     635                    <xsl:with-param name="node" select="address/postal/city"/>
     636                    <xsl:with-param name="name" select="'address/postal/city'"/>
     637                  </xsl:call-template>
     638                </span>
     639                <xsl:text>, </xsl:text>
     640              </xsl:if>
     641              <xsl:if test="address/postal/region">
     642                <span class="region">
     643                  <xsl:call-template name="extract-normalized">
     644                    <xsl:with-param name="node" select="address/postal/region"/>
     645                    <xsl:with-param name="name" select="'address/postal/region'"/>
     646                  </xsl:call-template>
     647                </span>
     648                <xsl:text> </xsl:text>
     649              </xsl:if>
     650              <xsl:if test="address/postal/code">
     651                <span class="postal-code">
     652                  <xsl:call-template name="extract-normalized">
     653                    <xsl:with-param name="node" select="address/postal/code"/>
     654                    <xsl:with-param name="name" select="'address/postal/code'"/>
     655                  </xsl:call-template>
     656                </span>
     657              </xsl:if>
    466658            </span>
    467659          </xsl:if>
    468660          <xsl:if test="address/postal/country">
    469             <span class="country-name vcardline"><xsl:value-of select="address/postal/country"/></span>
     661            <span class="country-name vcardline">
     662              <xsl:call-template name="extract-normalized">
     663                <xsl:with-param name="node" select="address/postal/country"/>
     664                <xsl:with-param name="name" select="'address/postal/country'"/>
     665              </xsl:call-template>
     666            </span>
    470667          </xsl:if>
    471668        </span>
     
    541738  </xsl:if>
    542739
    543   <xsl:if test="not($xml2rfc-private)">
     740  <xsl:if test="$xml2rfc-private=''">
    544741    <!-- copyright statements -->
    545742    <xsl:variable name="copyright"><xsl:call-template name="insertCopyright"/></xsl:variable>
     
    602799     
    603800    <!-- insert the collected information -->
    604     <table xmlns="http://www.w3.org/1999/xhtml" summary="header information" class="header" border="0" cellpadding="1" cellspacing="1">
     801    <table xmlns="http://www.w3.org/1999/xhtml" class="header" border="0" cellpadding="1" cellspacing="1">
    605802      <xsl:choose>
    606803        <xsl:when test="function-available('exslt:node-set')">
     
    670867  </xsl:choose>           
    671868
    672   <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     869  <xsl:if test="$xml2rfc-private='' and not($abstract-first)">
    673870    <xsl:call-template name="emit-ietf-preamble"/>
    674871  </xsl:if>
     
    680877  <xsl:apply-templates select="ed:replace[.//note]"/>
    681878   
    682   <xsl:if test="not($xml2rfc-private) and $abstract-first">
     879  <xsl:if test="$xml2rfc-private='' and $abstract-first">
    683880    <xsl:call-template name="emit-ietf-preamble"/>
    684881  </xsl:if>
     
    12311428        </xsl:call-template>
    12321429      </a>
    1233       <xsl:text> References</xsl:text>
     1430      <xsl:text> </xsl:text>
     1431      <xsl:value-of select="$xml2rfc-refparent"/>
    12341432    </h1>
    12351433  </xsl:if>
     
    12441442  <xsl:variable name="title">
    12451443    <xsl:choose>
    1246       <xsl:when test="not(@title) or @title=''">References</xsl:when>
     1444      <xsl:when test="not(@title) or @title=''"><xsl:value-of select="$xml2rfc-refparent"/></xsl:when>
    12471445      <xsl:otherwise><xsl:value-of select="@title"/></xsl:otherwise>
    12481446    </xsl:choose>
     
    12721470  </xsl:element>
    12731471 
    1274   <table xmlns="http://www.w3.org/1999/xhtml" summary="{$title}">
     1472  <table xmlns="http://www.w3.org/1999/xhtml">
    12751473    <xsl:choose>
    12761474      <xsl:when test="$xml2rfc-sortrefs='yes' and $xml2rfc-symrefs!='no'">
     
    12971495  </xsl:if>
    12981496 
     1497  <xsl:variable name="ignored">
     1498    <xsl:call-template name="parse-pis">
     1499      <xsl:with-param name="nodes" select="//processing-instruction('rfc-ext')"/>
     1500      <xsl:with-param name="attr" select="'SANITYCHECK'"/>
     1501    </xsl:call-template>
     1502  </xsl:variable>
     1503
    12991504  <xsl:variable name="lang">
    13001505    <xsl:call-template name="get-lang"/>
     
    13131518        <xsl:apply-templates select="front/title" mode="get-text-content"/>
    13141519      </title>
    1315       <style type="text/css" title="Xml2Rfc (sans serif)">
    1316         <xsl:call-template name="insertCss"/>
    1317       </style>
     1520      <xsl:call-template name="insertCss"/>
    13181521      <!-- <link rel="alternate stylesheet" type="text/css" media="screen" title="Plain (typewriter)" href="rfc2629tty.css" /> -->
    13191522           
     
    13231526      </xsl:if>
    13241527      <link rel="Author" href="#{$anchor-prefix}.authors"/>
    1325       <xsl:if test="not($xml2rfc-private)">
     1528      <xsl:if test="$xml2rfc-private=''">
    13261529        <link rel="Copyright" href="#{$anchor-prefix}.copyright"/>
    13271530      </xsl:if>
     
    13721575        </xsl:for-each>
    13731576       
    1374         <xsl:if test="not($xml2rfc-private)">
     1577        <xsl:if test="$xml2rfc-private=''">
    13751578          <xsl:choose>
    13761579            <xsl:when test="@number">
     
    13841587          <meta name="DC.Date.Issued" scheme="ISO8601">
    13851588            <xsl:attribute name="content">
    1386               <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$xml2rfc-ext-pub-month-numeric)"/>
     1589              <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$pub-month-numeric)"/>
    13871590              <xsl:if test="$xml2rfc-ext-pub-day != '' and not(@number)">
    13881591                <xsl:value-of select="concat('-',format-number($xml2rfc-ext-pub-day,'00'))"/>
     
    16781881  </xsl:attribute>
    16791882  <xsl:choose>
    1680     <xsl:when test="@format='counter'">
     1883    <xsl:when test="$from/@format='counter'">
    16811884      <xsl:value-of select="$refnum"/>
    16821885    </xsl:when>
    1683     <xsl:when test="@format='title'">
     1886    <xsl:when test="$from/@format='title'">
    16841887      <xsl:value-of select="$to/@title"/>
    16851888    </xsl:when>
     
    17571960
    17581961    <xsl:otherwise>
    1759       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}"><xsl:apply-templates/></a>
     1962      <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
     1963        <xsl:if test="@format='none'">
     1964          <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     1965            <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1966          </xsl:if>
     1967        </xsl:if>
     1968        <xsl:apply-templates/>
     1969      </a>
    17601970      <xsl:if test="not(@format='none')">
    17611971        <xsl:for-each select="$src/rfc/back/references//reference[@anchor=$target]">
     
    17801990<xsl:template match="xref[not(node())]">
    17811991
    1782   <xsl:variable name="target" select="@target"/>
    1783   <xsl:variable name="anchor"><xsl:value-of select="$anchor-prefix"/>.xref.<xsl:value-of select="@target"/>.<xsl:number level="any" count="xref[@target=$target]"/></xsl:variable>
    1784   <xsl:variable name="node" select="key('anchor-item',$target)"/>
    1785   <xsl:if test="count($node)=0 and not(ancestor::ed:del)">
    1786     <xsl:call-template name="error">
    1787       <xsl:with-param name="msg" select="concat('Undefined target: ',@target)"/>
    1788     </xsl:call-template>
    1789   </xsl:if>
    1790 
    1791   <xsl:choose>
    1792  
    1793     <!-- Section links -->
    1794     <xsl:when test="$node/self::section or $node/self::appendix">
    1795       <a xmlns="http://www.w3.org/1999/xhtml" href="#{@target}">
    1796         <!-- insert id when a backlink to this xref is needed in the index -->
    1797         <xsl:if test="key('iref-xanch',$target) | key('iref-xanch','')[../@anchor=$target]">
    1798           <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    1799         </xsl:if>
    1800         <xsl:call-template name="render-section-ref">
    1801           <xsl:with-param name="from" select="."/>
    1802           <xsl:with-param name="to" select="$node"/>
    1803         </xsl:call-template>
    1804       </a>
    1805     </xsl:when>
    1806 
    1807     <!-- Figure links -->
    1808     <xsl:when test="$node/self::figure">
    1809       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
    1810         <xsl:variable name="figcnt">
    1811           <xsl:for-each select="$node">
    1812             <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
    1813           </xsl:for-each>
    1814         </xsl:variable>
    1815         <xsl:choose>
    1816           <xsl:when test="@format='counter'">
    1817             <xsl:value-of select="$figcnt"/>
    1818           </xsl:when>
    1819           <xsl:when test="@format='title'">
    1820             <xsl:value-of select="$node/@title"/>
    1821           </xsl:when>
    1822           <xsl:otherwise>
    1823             <xsl:value-of select="normalize-space(concat('Figure ',$figcnt))"/>
    1824           </xsl:otherwise>
    1825         </xsl:choose>
    1826       </a>
    1827     </xsl:when>
     1992  <xsl:variable name="xref" select="."/>
     1993  <xsl:variable name="anchor"><xsl:value-of select="$anchor-prefix"/>.xref.<xsl:value-of select="$xref/@target"/>.<xsl:number level="any" count="xref[@target=$xref/@target]"/></xsl:variable>
     1994
     1995  <!-- ensure we have the right context, this <xref> may be processed from within the boilerplate -->
     1996  <xsl:for-each select="$src">
     1997
     1998    <xsl:variable name="node" select="key('anchor-item',$xref/@target)"/>
     1999    <xsl:if test="count($node)=0 and not($node/ancestor::ed:del)">
     2000      <xsl:call-template name="error">
     2001        <xsl:with-param name="msg" select="concat('Undefined target: ',$xref/@target)"/>
     2002      </xsl:call-template>
     2003    </xsl:if>
     2004 
     2005    <xsl:choose>
    18282006   
    1829     <!-- Table links -->
    1830     <xsl:when test="$node/self::texttable">
    1831       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
    1832         <xsl:variable name="tabcnt">
    1833           <xsl:for-each select="$node">
    1834             <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
    1835           </xsl:for-each>
    1836         </xsl:variable>
    1837         <xsl:choose>
    1838           <xsl:when test="@format='counter'">
    1839             <xsl:value-of select="$tabcnt"/>
    1840           </xsl:when>
    1841           <xsl:when test="@format='title'">
    1842             <xsl:value-of select="$node/@title"/>
    1843           </xsl:when>
    1844           <xsl:otherwise>
    1845             <xsl:value-of select="normalize-space(concat('Table ',$tabcnt))"/>
    1846           </xsl:otherwise>
    1847         </xsl:choose>
    1848       </a>
    1849     </xsl:when>
    1850    
    1851     <!-- Paragraph links -->
    1852     <xsl:when test="$node/self::t">
    1853       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
    1854         <xsl:variable name="tcnt">
    1855           <xsl:for-each select="$node">
    1856             <xsl:call-template name="get-paragraph-number"/>
    1857           </xsl:for-each>
    1858         </xsl:variable>
    1859         <xsl:choose>
    1860           <xsl:when test="@format='counter'">
    1861             <xsl:value-of select="$tcnt"/>
    1862           </xsl:when>
    1863           <xsl:when test="@format='title'">
    1864             <xsl:value-of select="$node/@title"/>
    1865           </xsl:when>
    1866           <xsl:otherwise>
    1867             <xsl:value-of select="normalize-space(concat('Paragraph ',substring-after($tcnt,'p.')))"/>
    1868           </xsl:otherwise>
    1869         </xsl:choose>
    1870       </a>
    1871     </xsl:when>
    1872 
    1873     <!-- Comment links -->
    1874     <xsl:when test="$node/self::cref">
    1875       <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
    1876         <xsl:variable name="name">
    1877           <xsl:for-each select="$node">
    1878             <xsl:call-template name="get-comment-name"/>
    1879           </xsl:for-each>
    1880         </xsl:variable>
    1881         <xsl:choose>
    1882           <xsl:when test="@format='counter'">
    1883             <xsl:value-of select="$name"/>
    1884           </xsl:when>
    1885           <xsl:when test="@format='title'">
    1886             <xsl:value-of select="$node/@title"/>
    1887           </xsl:when>
    1888           <xsl:otherwise>
    1889             <xsl:value-of select="normalize-space(concat('Comment ',$name))"/>
    1890           </xsl:otherwise>
    1891         </xsl:choose>
    1892       </a>
    1893     </xsl:when>
    1894 
    1895     <!-- Reference links -->
    1896     <xsl:when test="$node/self::reference">
    1897 
    1898       <xsl:variable name="href">
    1899         <xsl:call-template name="computed-target">
    1900           <xsl:with-param name="bib" select="$node"/>
    1901           <xsl:with-param name="ref" select="."/>
    1902         </xsl:call-template>
    1903       </xsl:variable>
    1904      
    1905       <xsl:variable name="sec">
    1906         <xsl:choose>
    1907           <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
    1908             <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
    1909             <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after(current()/@x:rel,'#')]"/>
    1910             <xsl:if test="not($nodes)">
    1911               <xsl:call-template name="error">
    1912                 <xsl:with-param name="msg">Anchor '<xsl:value-of select="substring-after(current()/@x:rel,'#')"/>' not found in <xsl:value-of select="$node/x:source/@href"/>.</xsl:with-param>
    1913               </xsl:call-template>
    1914             </xsl:if>
    1915             <xsl:for-each select="$nodes">
    1916               <xsl:call-template name="get-section-number"/>
    1917             </xsl:for-each>
    1918           </xsl:when>
    1919           <xsl:otherwise>
    1920             <xsl:value-of select="@x:sec"/>
    1921           </xsl:otherwise>
    1922         </xsl:choose>
    1923       </xsl:variable>
    1924      
    1925       <xsl:variable name="secterm">
    1926         <xsl:choose>
    1927           <!-- starts with letter? -->
    1928           <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
    1929           <xsl:otherwise>Section</xsl:otherwise>
    1930         </xsl:choose>
    1931       </xsl:variable>
    1932 
    1933       <xsl:variable name="fmt">
    1934         <xsl:choose>
    1935           <xsl:when test="@x:fmt!=''"><xsl:value-of select="@x:fmt"/></xsl:when>
    1936           <xsl:when test="ancestor::artwork">,</xsl:when>
    1937           <xsl:otherwise>of</xsl:otherwise>
    1938         </xsl:choose>
    1939       </xsl:variable>
    1940 
    1941       <xsl:variable name="title">
    1942         <xsl:choose>
    1943           <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
    1944             <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
    1945             <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after(current()/@x:rel,'#')]"/>
    1946             <xsl:if test="not($nodes)">
    1947               <xsl:call-template name="error">
    1948                 <xsl:with-param name="msg">Anchor '<xsl:value-of select="substring-after(current()/@x:rel,'#')"/>' not found in <xsl:value-of select="$node/x:source/@href"/>.</xsl:with-param>
    1949               </xsl:call-template>
    1950             </xsl:if>
    1951             <xsl:for-each select="$nodes">
    1952               <xsl:value-of select="@title"/>
    1953             </xsl:for-each>
    1954           </xsl:when>
    1955           <xsl:otherwise/>
    1956         </xsl:choose>
    1957       </xsl:variable>
    1958 
    1959       <!--
    1960       Formats:
    1961      
    1962         ()      [XXXX] (Section SS)
    1963         ,       [XXXX], Section SS
    1964         of      Section SS of [XXXX]
    1965         sec     Section SS
    1966         number  SS
    1967       -->
    1968      
    1969       <xsl:if test="$fmt and not($fmt='()' or $fmt=',' or $fmt='of' or $fmt='sec' or $fmt='anchor' or $fmt='number')">
    1970         <xsl:call-template name="error">
    1971           <xsl:with-param name="msg" select="concat('unknown xref/@x:fmt extension: ',$fmt)"/>
    1972         </xsl:call-template>
    1973       </xsl:if>
    1974 
    1975       <xsl:if test="$sec!=''">
    1976              
    1977         <xsl:choose>
    1978           <xsl:when test="$fmt='of' or $fmt='sec'">
    1979             <xsl:choose>
    1980               <xsl:when test="$href!=''">
    1981                 <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
    1982                   <xsl:if test="$title!=''">
    1983                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    1984                   </xsl:if>
    1985                   <xsl:if test="$fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
    1986                     <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    1987                   </xsl:if>
    1988                   <xsl:value-of select="$secterm"/>
    1989                   <xsl:text> </xsl:text>
    1990                   <xsl:value-of select="$sec"/>
    1991                 </a>
    1992               </xsl:when>
    1993               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    1994             </xsl:choose>
    1995             <xsl:if test="$fmt='of'">
    1996               <xsl:text> of </xsl:text>
    1997             </xsl:if>
    1998           </xsl:when>
    1999           <xsl:when test="$fmt='number'">
    2000             <xsl:choose>
    2001               <xsl:when test="$href!=''">
    2002                 <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
    2003                   <xsl:if test="$title!=''">
    2004                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    2005                   </xsl:if>
    2006                   <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
    2007                     <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    2008                   </xsl:if>
    2009                   <xsl:value-of select="$sec"/>
    2010                 </a>
    2011               </xsl:when>
    2012               <xsl:otherwise><xsl:value-of select="$sec"/></xsl:otherwise>
    2013             </xsl:choose>
    2014           </xsl:when>
    2015           <xsl:otherwise/>
    2016         </xsl:choose>
    2017       </xsl:if>
    2018 
    2019       <xsl:if test="$sec='' or ($fmt!='sec' and $fmt!='number')">
    2020         <a xmlns="http://www.w3.org/1999/xhtml" href="#{$target}">
    2021           <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2007      <!-- Section links -->
     2008      <xsl:when test="$node/self::section or $node/self::appendix">
     2009        <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2010          <!-- insert id when a backlink to this xref is needed in the index -->
     2011          <xsl:if test="key('iref-xanch',$xref/@target) | key('iref-xanch','')[../@anchor=$xref/@target]">
    20222012            <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    20232013          </xsl:if>
    2024           <cite title="{normalize-space($node/front/title)}">
    2025             <xsl:variable name="val">
    2026               <xsl:call-template name="referencename">
    2027                 <xsl:with-param name="node" select="$node"/>
    2028               </xsl:call-template>
    2029             </xsl:variable>
    2030             <xsl:choose>
    2031               <xsl:when test="$fmt='anchor'">
    2032                 <!-- remove brackets -->
    2033                 <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
    2034               </xsl:when>
    2035               <xsl:otherwise>
    2036                 <xsl:value-of select="$val"/>
    2037               </xsl:otherwise>
    2038             </xsl:choose>
    2039           </cite>
     2014          <xsl:call-template name="render-section-ref">
     2015            <xsl:with-param name="from" select="$xref"/>
     2016            <xsl:with-param name="to" select="$node"/>
     2017          </xsl:call-template>
    20402018        </a>
    2041       </xsl:if>
     2019      </xsl:when>
     2020 
     2021      <!-- Figure links -->
     2022      <xsl:when test="$node/self::figure">
     2023        <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2024          <xsl:variable name="figcnt">
     2025            <xsl:for-each select="$node">
     2026              <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
     2027            </xsl:for-each>
     2028          </xsl:variable>
     2029          <xsl:choose>
     2030            <xsl:when test="$xref/@format='counter'">
     2031              <xsl:value-of select="$figcnt"/>
     2032            </xsl:when>
     2033            <xsl:when test="$xref/@format='title'">
     2034              <xsl:value-of select="$node/@title"/>
     2035            </xsl:when>
     2036            <xsl:otherwise>
     2037              <xsl:value-of select="normalize-space(concat('Figure ',$figcnt))"/>
     2038            </xsl:otherwise>
     2039          </xsl:choose>
     2040        </a>
     2041      </xsl:when>
    20422042     
    2043       <xsl:if test="$sec!=''">
    2044         <xsl:choose>
    2045           <xsl:when test="$fmt='()'">
    2046             <xsl:text> (</xsl:text>
    2047             <xsl:choose>
    2048               <xsl:when test="$href!=''">
    2049                 <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}"><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></a>
    2050               </xsl:when>
    2051               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    2052             </xsl:choose>
    2053             <xsl:text>)</xsl:text>
    2054           </xsl:when>
    2055           <xsl:when test="$fmt=','">
    2056             <xsl:text>, </xsl:text>
    2057             <xsl:choose>
    2058               <xsl:when test="$href!=''">
    2059                 <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
    2060                   <xsl:if test="$title!=''">
    2061                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    2062                   </xsl:if>
    2063                   <xsl:value-of select="$secterm"/>
    2064                   <xsl:text> </xsl:text>
    2065                   <xsl:value-of select="$sec"/>
    2066                 </a>
    2067               </xsl:when>
    2068               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    2069             </xsl:choose>
    2070           </xsl:when>
    2071           <xsl:otherwise/>
    2072         </xsl:choose>
    2073       </xsl:if>
    2074     </xsl:when>
    2075    
    2076     <xsl:otherwise>
    2077       <xsl:call-template name="error">
    2078         <xsl:with-param name="msg" select="concat('xref to unknown element: ',name($node))"/>
    2079       </xsl:call-template>
    2080     </xsl:otherwise>
    2081   </xsl:choose>
     2043      <!-- Table links -->
     2044      <xsl:when test="$node/self::texttable">
     2045        <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2046          <xsl:variable name="tabcnt">
     2047            <xsl:for-each select="$node">
     2048              <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]"/>
     2049            </xsl:for-each>
     2050          </xsl:variable>
     2051          <xsl:choose>
     2052            <xsl:when test="$xref/@format='counter'">
     2053              <xsl:value-of select="$tabcnt"/>
     2054            </xsl:when>
     2055            <xsl:when test="$xref/@format='title'">
     2056              <xsl:value-of select="$node/@title"/>
     2057            </xsl:when>
     2058            <xsl:otherwise>
     2059              <xsl:value-of select="normalize-space(concat('Table ',$tabcnt))"/>
     2060            </xsl:otherwise>
     2061          </xsl:choose>
     2062        </a>
     2063      </xsl:when>
     2064     
     2065      <!-- Paragraph links -->
     2066      <xsl:when test="$node/self::t">
     2067        <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2068          <xsl:variable name="tcnt">
     2069            <xsl:for-each select="$node">
     2070              <xsl:call-template name="get-paragraph-number"/>
     2071            </xsl:for-each>
     2072          </xsl:variable>
     2073          <xsl:choose>
     2074            <xsl:when test="$xref/@format='counter'">
     2075              <xsl:value-of select="$tcnt"/>
     2076            </xsl:when>
     2077            <xsl:when test="$xref/@format='title'">
     2078              <xsl:value-of select="$node/@title"/>
     2079            </xsl:when>
     2080            <xsl:otherwise>
     2081              <xsl:value-of select="normalize-space(concat('Paragraph ',substring-after($tcnt,'p.')))"/>
     2082            </xsl:otherwise>
     2083          </xsl:choose>
     2084        </a>
     2085      </xsl:when>
     2086 
     2087      <!-- Comment links -->
     2088      <xsl:when test="$node/self::cref">
     2089        <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2090          <xsl:variable name="name">
     2091            <xsl:for-each select="$node">
     2092              <xsl:call-template name="get-comment-name"/>
     2093            </xsl:for-each>
     2094          </xsl:variable>
     2095          <xsl:choose>
     2096            <xsl:when test="$xref/@format='counter'">
     2097              <xsl:value-of select="$name"/>
     2098            </xsl:when>
     2099            <xsl:when test="$xref/@format='title'">
     2100              <xsl:value-of select="$node/@title"/>
     2101            </xsl:when>
     2102            <xsl:otherwise>
     2103              <xsl:value-of select="normalize-space(concat('Comment ',$name))"/>
     2104            </xsl:otherwise>
     2105          </xsl:choose>
     2106        </a>
     2107      </xsl:when>
     2108 
     2109      <!-- Reference links -->
     2110      <xsl:when test="$node/self::reference">
     2111 
     2112        <xsl:variable name="href">
     2113          <xsl:call-template name="computed-target">
     2114            <xsl:with-param name="bib" select="$node"/>
     2115            <xsl:with-param name="ref" select="$xref"/>
     2116          </xsl:call-template>
     2117        </xsl:variable>
     2118       
     2119        <xsl:variable name="sec">
     2120          <xsl:choose>
     2121            <xsl:when test="starts-with($xref/@x:rel,'#') and not($xref/@x:sec) and $node/x:source/@href">
     2122              <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
     2123              <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after($xref/@x:rel,'#')]"/>
     2124              <xsl:if test="not($nodes)">
     2125                <xsl:call-template name="error">
     2126                  <xsl:with-param name="msg">Anchor '<xsl:value-of select="substring-after($xref/@x:rel,'#')"/>' not found in <xsl:value-of select="$node/x:source/@href"/>.</xsl:with-param>
     2127                </xsl:call-template>
     2128              </xsl:if>
     2129              <xsl:for-each select="$nodes">
     2130                <xsl:call-template name="get-section-number"/>
     2131              </xsl:for-each>
     2132            </xsl:when>
     2133            <xsl:otherwise>
     2134              <xsl:value-of select="$xref/@x:sec"/>
     2135            </xsl:otherwise>
     2136          </xsl:choose>
     2137        </xsl:variable>
     2138       
     2139        <xsl:variable name="secterm">
     2140          <xsl:choose>
     2141            <!-- starts with letter? -->
     2142            <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
     2143            <xsl:otherwise>Section</xsl:otherwise>
     2144          </xsl:choose>
     2145        </xsl:variable>
     2146 
     2147        <xsl:variable name="fmt">
     2148          <xsl:choose>
     2149            <xsl:when test="$xref/@x:fmt!=''"><xsl:value-of select="$xref/@x:fmt"/></xsl:when>
     2150            <xsl:when test="$xref/ancestor::artwork">,</xsl:when>
     2151            <xsl:otherwise>of</xsl:otherwise>
     2152          </xsl:choose>
     2153        </xsl:variable>
     2154 
     2155        <xsl:variable name="title">
     2156          <xsl:choose>
     2157            <xsl:when test="starts-with($xref/@x:rel,'#') and not($xref/@x:sec) and $node/x:source/@href">
     2158              <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
     2159              <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after($xref//@x:rel,'#')]"/>
     2160              <xsl:if test="not($nodes)">
     2161                <xsl:call-template name="error">
     2162                  <xsl:with-param name="msg">Anchor '<xsl:value-of select="substring-after($xref//@x:rel,'#')"/>' not found in <xsl:value-of select="$node/x:source/@href"/>.</xsl:with-param>
     2163                </xsl:call-template>
     2164              </xsl:if>
     2165              <xsl:for-each select="$nodes">
     2166                <xsl:value-of select="@title"/>
     2167              </xsl:for-each>
     2168            </xsl:when>
     2169            <xsl:otherwise/>
     2170          </xsl:choose>
     2171        </xsl:variable>
     2172 
     2173        <!--
     2174        Formats:
     2175       
     2176          ()      [XXXX] (Section SS)
     2177          ,       [XXXX], Section SS
     2178          of      Section SS of [XXXX]
     2179          sec     Section SS
     2180          number  SS
     2181        -->
     2182       
     2183        <xsl:if test="$fmt and not($fmt='()' or $fmt=',' or $fmt='of' or $fmt='sec' or $fmt='anchor' or $fmt='number')">
     2184          <xsl:call-template name="error">
     2185            <xsl:with-param name="msg" select="concat('unknown xref/@x:fmt extension: ',$fmt)"/>
     2186          </xsl:call-template>
     2187        </xsl:if>
     2188 
     2189        <xsl:if test="$sec!=''">
     2190               
     2191          <xsl:choose>
     2192            <xsl:when test="$fmt='of' or $fmt='sec'">
     2193              <xsl:choose>
     2194                <xsl:when test="$href!=''">
     2195                  <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
     2196                    <xsl:if test="$title!=''">
     2197                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2198                    </xsl:if>
     2199                    <xsl:if test="$fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
     2200                      <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2201                    </xsl:if>
     2202                    <xsl:value-of select="$secterm"/>
     2203                    <xsl:text> </xsl:text>
     2204                    <xsl:value-of select="$sec"/>
     2205                  </a>
     2206                </xsl:when>
     2207                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2208              </xsl:choose>
     2209              <xsl:if test="$fmt='of'">
     2210                <xsl:text> of </xsl:text>
     2211              </xsl:if>
     2212            </xsl:when>
     2213            <xsl:when test="$fmt='number'">
     2214              <xsl:choose>
     2215                <xsl:when test="$href!=''">
     2216                  <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
     2217                    <xsl:if test="$title!=''">
     2218                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2219                    </xsl:if>
     2220                    <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2221                      <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2222                    </xsl:if>
     2223                    <xsl:value-of select="$sec"/>
     2224                  </a>
     2225                </xsl:when>
     2226                <xsl:otherwise><xsl:value-of select="$sec"/></xsl:otherwise>
     2227              </xsl:choose>
     2228            </xsl:when>
     2229            <xsl:otherwise/>
     2230          </xsl:choose>
     2231        </xsl:if>
     2232 
     2233        <xsl:if test="$sec='' or ($fmt!='sec' and $fmt!='number')">
     2234          <a xmlns="http://www.w3.org/1999/xhtml" href="#{$xref/@target}">
     2235            <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2236              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2237            </xsl:if>
     2238            <cite title="{normalize-space($node/front/title)}">
     2239              <xsl:variable name="val">
     2240                <xsl:call-template name="referencename">
     2241                  <xsl:with-param name="node" select="$node"/>
     2242                </xsl:call-template>
     2243              </xsl:variable>
     2244              <xsl:choose>
     2245                <xsl:when test="$fmt='anchor'">
     2246                  <!-- remove brackets -->
     2247                  <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
     2248                </xsl:when>
     2249                <xsl:otherwise>
     2250                  <xsl:value-of select="$val"/>
     2251                </xsl:otherwise>
     2252              </xsl:choose>
     2253            </cite>
     2254          </a>
     2255        </xsl:if>
     2256       
     2257        <xsl:if test="$sec!=''">
     2258          <xsl:choose>
     2259            <xsl:when test="$fmt='()'">
     2260              <xsl:text> (</xsl:text>
     2261              <xsl:choose>
     2262                <xsl:when test="$href!=''">
     2263                  <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}"><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></a>
     2264                </xsl:when>
     2265                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2266              </xsl:choose>
     2267              <xsl:text>)</xsl:text>
     2268            </xsl:when>
     2269            <xsl:when test="$fmt=','">
     2270              <xsl:text>, </xsl:text>
     2271              <xsl:choose>
     2272                <xsl:when test="$href!=''">
     2273                  <a xmlns="http://www.w3.org/1999/xhtml" href="{$href}">
     2274                    <xsl:if test="$title!=''">
     2275                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2276                    </xsl:if>
     2277                    <xsl:value-of select="$secterm"/>
     2278                    <xsl:text> </xsl:text>
     2279                    <xsl:value-of select="$sec"/>
     2280                  </a>
     2281                </xsl:when>
     2282                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2283              </xsl:choose>
     2284            </xsl:when>
     2285            <xsl:otherwise/>
     2286          </xsl:choose>
     2287        </xsl:if>
     2288      </xsl:when>
     2289     
     2290      <xsl:otherwise>
     2291        <xsl:call-template name="error">
     2292          <xsl:with-param name="msg" select="concat('xref to unknown element: ',name($node))"/>
     2293        </xsl:call-template>
     2294      </xsl:otherwise>
     2295    </xsl:choose>
     2296  </xsl:for-each>
    20822297</xsl:template>
    20832298
     
    21012316  <xsl:param name="mode"/>
    21022317  <!-- default case -->
    2103   <xsl:if test="not($xml2rfc-private)">
     2318  <xsl:if test="$xml2rfc-private=''">
    21042319    <xsl:choose>
    21052320      <xsl:when test="/rfc/front/workgroup">
     
    21702385   
    21712386  <!-- private case -->
    2172   <xsl:if test="$xml2rfc-private">
     2387  <xsl:if test="$xml2rfc-private!=''">
    21732388    <myns:item><xsl:value-of select="$xml2rfc-private"/></myns:item>
    21742389  </xsl:if>
     
    22722487      <xsl:call-template name="normalize-date">
    22732488        <xsl:with-param name="year" select="$xml2rfc-ext-pub-year"/>
    2274         <xsl:with-param name="month" select="$xml2rfc-ext-pub-month-numeric"/>
     2489        <xsl:with-param name="month" select="$pub-month-numeric"/>
    22752490        <xsl:with-param name="day" select="$xml2rfc-ext-pub-day + 185"/>
    22762491      </xsl:call-template>
     
    24252640          <t>
    24262641            <xsl:choose>
    2427               <xsl:when test="$ipr-2007-08"/>
    24282642              <xsl:when test="$ipr-rfc4748">
    24292643                Copyright © The IETF Trust (<xsl:value-of select="$xml2rfc-ext-pub-year"/>).
     
    25922806
    25932807<xsl:template name="insertCss">
     2808<style xmlns="http://www.w3.org/1999/xhtml" type="text/css" title="Xml2Rfc (sans serif)">
    25942809a {
    25952810  text-decoration: none;
     
    26982913  background-color: lightyellow;
    26992914  padding: .25em;
    2700 }
     2915}<xsl:if test="//artwork[@x:isCodeComponent='yes']"><!-- support "<CODE BEGINS>" and "<CODE ENDS>" markers-->
     2916pre.ccmarker {
     2917  background-color: white;
     2918  color: gray;
     2919}
     2920pre.ccmarker &gt; span {
     2921  font-size: small;
     2922}
     2923pre.cct {
     2924  margin-bottom: -1em;
     2925}
     2926pre.ccb {
     2927  margin-top: -1em;
     2928}</xsl:if>
    27012929pre.text2 {
    27022930  border-style: dotted;
     
    30213249  }
    30223250</xsl:if>}
    3023 
     3251<xsl:choose><xsl:when test="$xml2rfc-ext-duplex='yes'">
     3252@page:right {
     3253  @top-left {
     3254       content: "<xsl:call-template name="get-header-left"/>";
     3255  }
     3256  @top-right {
     3257       content: "<xsl:call-template name="get-header-right"/>";
     3258  }
     3259  @top-center {
     3260       content: "<xsl:call-template name="get-header-center"/>";
     3261  }
     3262  @bottom-left {
     3263       content: "<xsl:call-template name="get-author-summary"/>";
     3264  }
     3265  @bottom-center {
     3266       content: "<xsl:call-template name="get-category-long"/>";
     3267  }
     3268  @bottom-right {
     3269       content: "[Page " counter(page) "]";
     3270  }
     3271}
     3272@page:left {
     3273  @top-left {
     3274       content: "<xsl:call-template name="get-header-right"/>";
     3275  }
     3276  @top-right {
     3277       content: "<xsl:call-template name="get-header-left"/>";
     3278  }
     3279  @top-center {
     3280       content: "<xsl:call-template name="get-header-center"/>";
     3281  }
     3282  @bottom-left {
     3283       content: "[Page " counter(page) "]";
     3284  }
     3285  @bottom-center {
     3286       content: "<xsl:call-template name="get-category-long"/>";
     3287  }
     3288  @bottom-right {
     3289       content: "<xsl:call-template name="get-author-summary"/>";
     3290  }
     3291}
     3292</xsl:when><xsl:otherwise>
    30243293@page {
    30253294  @top-left {
     
    30423311  }
    30433312}
    3044 
     3313</xsl:otherwise></xsl:choose>
    30453314@page:first {
    30463315    @top-left {
     
    30543323    }
    30553324}
     3325</style>
    30563326</xsl:template>
    30573327
     
    34093679</xsl:template>
    34103680
    3411 
    3412 
    3413 
    34143681<xsl:template name="insertPreamble" myns:namespaceless-elements="xml2rfc">
     3682
     3683  <xsl:variable name="escapeclause">
     3684    This document may contain material from IETF Documents or IETF Contributions published or
     3685    made publicly available before November 10, 2008. The person(s) controlling the copyright in
     3686    some of this material may not have granted the IETF Trust the right to allow modifications of such
     3687    material outside the IETF Standards Process. Without obtaining an adequate license from the
     3688    person(s) controlling the copyright in such materials, this document may not be modified outside
     3689    the IETF Standards Process, and derivative works of it may not be created outside the IETF
     3690    Standards Process, except to format it for publication as an RFC or to translate it into languages
     3691    other than English.
     3692  </xsl:variable>
    34153693
    34163694  <section myns:unnumbered="unnumbered" myns:notoclink="notoclink" anchor="{$anchor-prefix}.status">
     
    34703748            translate it into languages other than English<xsl:if test="/rfc/@iprExtract">,
    34713749            other than to extract <xref target="{/rfc/@iprExtract}"/> as-is
    3472             for separate use.</xsl:if>.
     3750            for separate use</xsl:if>.
    34733751          </xsl:when>
    34743752          <xsl:when test="/rfc/@ipr = 'noDerivatives3667'">
     
    34813759            document may not be modified, and derivative works of it may
    34823760            not be created<xsl:if test="/rfc/@iprExtract">, other than to extract
    3483             <xref target="{/rfc/@iprExtract}"/> as-is for separate use.</xsl:if>.
     3761            <xref target="{/rfc/@iprExtract}"/> as-is for separate use</xsl:if>.
    34843762          </xsl:when>
    34853763         
     
    35013779            translate it into languages other than English<xsl:if test="/rfc/@iprExtract">,
    35023780            other than to extract <xref target="{/rfc/@iprExtract}"/> as-is
    3503             for separate use.</xsl:if>.
     3781            for separate use</xsl:if>.
    35043782          </xsl:when>
    35053783          <xsl:when test="/rfc/@ipr = 'noDerivatives3978'">
     
    35103788            document may not be modified, and derivative works of it may
    35113789            not be created<xsl:if test="/rfc/@iprExtract">, other than to extract
    3512             <xref target="{/rfc/@iprExtract}"/> as-is for separate use.</xsl:if>.
     3790            <xref target="{/rfc/@iprExtract}"/> as-is for separate use</xsl:if>.
    35133791          </xsl:when>
    35143792 
    3515           <!-- as of Nov 2008 -->
    3516           <xsl:when test="/rfc/@ipr = 'trust200811'                           or /rfc/@ipr = 'noModificationTrust200811'                           or  /rfc/@ipr = 'noDerivativesTrust200811'">
    3517             This Internet-Draft is submitted to IETF pursuant to, and in full
    3518             conformance with, the provisions of BCP 78 and BCP 79.
     3793          <!-- as of Nov 2008, Feb 2009 and Sep 2009 -->
     3794          <xsl:when test="/rfc/@ipr = 'trust200811'                           or /rfc/@ipr = 'noModificationTrust200811'                           or /rfc/@ipr = 'noDerivativesTrust200811'                           or /rfc/@ipr = 'trust200902'                           or /rfc/@ipr = 'noModificationTrust200902'                           or /rfc/@ipr = 'noDerivativesTrust200902'                           or /rfc/@ipr = 'pre5378Trust200902'">
     3795            This Internet-Draft is submitted to IETF in full conformance with
     3796            the provisions of BCP 78 and BCP 79.
    35193797          </xsl:when>
    3520  
    3521           <!-- as of Feb 2009 -->
    3522           <xsl:when test="/rfc/@ipr = 'trust200902'                           or /rfc/@ipr = 'noModificationTrust200902'                           or /rfc/@ipr = 'noDerivativesTrust200902'                           or /rfc/@ipr = 'pre5378Trust200902'">
    3523             This Internet-Draft is submitted to IETF pursuant to, and in full
    3524             conformance with, the provisions of BCP 78 and BCP 79.
    3525           </xsl:when>
    3526           <xsl:when test="/rfc/@ipr = 'noModificationTrust200902'">
    3527             This document may not be modified, and derivative works of it may
    3528             not be created, except to format it for publication as an RFC or
    3529             to translate it into languages other than English.
    3530           </xsl:when>
    3531           <xsl:when test="/rfc/@ipr = 'noDerivativesTrust200902'">
    3532             This document may not be modified, and derivative works of it may
    3533             not be created, and it may not be published except as an Internet-Draft.
    3534           </xsl:when>
    3535           <xsl:when test="/rfc/@ipr = 'pre5378Trust200902'">
    3536             This document may contain material from IETF Documents or IETF Contributions published or
    3537             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3538             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3539             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3540             person(s) controlling the copyright in such materials, this document may not be modified outside
    3541             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3542             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3543             other than English.
    3544           </xsl:when>
    3545  
    35463798          <xsl:otherwise>
    35473799            CONFORMANCE UNDEFINED.
     
    35603812            not be created, and it may not be published except as an Internet-Draft.
    35613813          </xsl:when>
    3562 
    35633814          <xsl:when test="/rfc/@ipr = 'noModificationTrust200902'">
    35643815            This document may not be modified, and derivative works of it may
     
    35703821            not be created, and it may not be published except as an Internet-Draft.
    35713822          </xsl:when>
    3572           <xsl:when test="/rfc/@ipr = 'pre5378Trust200902'">
    3573             This document may contain material from IETF Documents or IETF Contributions published or
    3574             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3575             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3576             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3577             person(s) controlling the copyright in such materials, this document may not be modified outside
    3578             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3579             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3580             other than English.
     3823          <!-- escape clause moved to Copyright Notice as of 2009-12 -->
     3824          <xsl:when test="/rfc/@ipr = 'pre5378Trust200902' and $pub-yearmonth &lt; 200912">
     3825            <xsl:value-of select="$escapeclause"/>
    35813826          </xsl:when>
    35823827
     
    36613906        </t>
    36623907        <xsl:choose>
     3908          <xsl:when test="$ipr-2009-09">
     3909            <t>
     3910              This document is subject to BCP 78 and the IETF Trust's Legal
     3911              Provisions Relating to IETF Documents (<eref target="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</eref>)
     3912              in effect on the date of publication of this document. Please
     3913              review these documents carefully, as they describe your rights
     3914              and restrictions with respect to this document. Code Components
     3915              extracted from this document must include Simplified BSD License
     3916              text as described in Section 4.e of the Trust Legal Provisions
     3917              and are provided without warranty as described in the BSD License.
     3918            </t>
     3919          </xsl:when>
    36633920          <xsl:when test="$ipr-2009-02">
    36643921            <t>
     
    36843941       
    36853942        <!-- special case: RFC5378 escape applies to RFCs as well -->
    3686         <!-- currently only applied to RFCs, need to discuss for IDs -->
    3687         <xsl:if test="/rfc/@number and /rfc/@ipr = 'pre5378Trust200902'">
     3943        <!-- for IDs historically in Status Of This Memo, over here starting 2009-12 -->
     3944        <xsl:if test="(/rfc/@number or $pub-yearmonth &gt;= 200912) and /rfc/@ipr = 'pre5378Trust200902'">
    36883945          <t>
    3689             This document may contain material from IETF Documents or IETF Contributions published or
    3690             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3691             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3692             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3693             person(s) controlling the copyright in such materials, this document may not be modified outside
    3694             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3695             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3696             other than English.
     3946            <xsl:value-of select="$escapeclause"/>
    36973947          </t>
    36983948        </xsl:if>
     
    38244074
    38254075  <!-- copyright statements -->
    3826   <xsl:if test="not($xml2rfc-private) and not($no-copylong)">
     4076  <xsl:if test="$xml2rfc-private='' and not($no-copylong)">
    38274077    <li xmlns="http://www.w3.org/1999/xhtml">
    38284078      <xsl:call-template name="insert-toc-line">
     
    38734123          <xsl:choose>
    38744124            <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
    3875             <xsl:otherwise>References</xsl:otherwise>
     4125            <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    38764126          </xsl:choose>
    38774127        </xsl:variable>
     
    38964146          </xsl:with-param>
    38974147          <xsl:with-param name="target" select="concat($anchor-prefix,'.references')"/>
    3898           <xsl:with-param name="title" select="'References'"/>
     4148          <xsl:with-param name="title" select="$xml2rfc-refparent"/>
    38994149        </xsl:call-template>
    39004150 
     
    39054155              <xsl:choose>
    39064156                <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
    3907                 <xsl:otherwise>References</xsl:otherwise>
     4157                <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    39084158              </xsl:choose>
    39094159            </xsl:variable>
     
    43834633
    43844634<xsl:template match="/" mode="cleanup-edits">
    4385         <xsl:copy><xsl:apply-templates select="node()" mode="cleanup-edits"/></xsl:copy>
     4635  <xsl:copy><xsl:apply-templates select="node()" mode="cleanup-edits"/></xsl:copy>
    43864636</xsl:template>
    43874637
     
    45974847  </xsl:variable>
    45984848 
    4599   <table xmlns="http://www.w3.org/1999/xhtml" summary="issue {@name}" class="{$class}">
     4849  <table xmlns="http://www.w3.org/1999/xhtml" class="{$class}">
    46004850    <tr>
    46014851      <td colspan="3">
     
    47404990
    47414991  <h2 xmlns="http://www.w3.org/1999/xhtml" id="{$anchor-prefix}.issues-list"><a href="#{$anchor-prefix}.issues-list">Issues list</a></h2>
    4742   <table xmlns="http://www.w3.org/1999/xhtml" summary="Issues list">
     4992  <table xmlns="http://www.w3.org/1999/xhtml">
    47434993    <thead>
    47444994      <tr>
     
    51305380                  </xsl:when>
    51315381                  <xsl:when test="$col/@align='left' or not($col/@align)">
    5132                     <!-- that's the default, nothing to do here -->
     5382                    <xsl:attribute name="class">left</xsl:attribute>
    51335383                  </xsl:when>
    51345384                  <xsl:otherwise>
    5135                     <xsl:message>Unknown align attribute on ttcol: <xsl:value-of select="$col/@align"/></xsl:message>
     5385                    <xsl:call-template name="warning">
     5386                      <xsl:with-param name="inline" select="'no'"/>
     5387                      <xsl:with-param name="msg">Unknown align attribute on ttcol: <xsl:value-of select="$col/@align"/></xsl:with-param>                     
     5388                    </xsl:call-template>
    51365389                  </xsl:otherwise>
    51375390                </xsl:choose>
     
    52035456          </a>
    52045457          <xsl:text>: </xsl:text>
    5205           <xsl:apply-templates select="text()|eref"/>
     5458          <xsl:apply-templates select="text()|eref|xref"/>
    52065459          <xsl:if test="@source"> --<xsl:value-of select="@source"/></xsl:if>
    52075460          <xsl:text>]</xsl:text>
     
    52105463          <xsl:attribute name="title">
    52115464            <xsl:if test="@source"><xsl:value-of select="@source"/>: </xsl:if>
    5212             <xsl:apply-templates select="text()|eref"/>
     5465            <xsl:apply-templates select="text()|eref|xref"/>
    52135466          </xsl:attribute>
    52145467          <xsl:text>[</xsl:text>
     
    53035556        <xsl:attribute name="title">
    53045557          <xsl:call-template name="get-references-section-number"/>
    5305           <xsl:text> References</xsl:text>
     5558          <xsl:text> </xsl:text>
     5559          <xsl:value-of select="$xml2rfc-refparent"/>
    53065560        </xsl:attribute>
    53075561      </xsl:otherwise>
     
    53285582<xsl:template name="get-category-long">
    53295583  <xsl:choose>
    5330     <xsl:when test="$xml2rfc-footer"><xsl:value-of select="$xml2rfc-footer"/></xsl:when>
    5331     <xsl:when test="$xml2rfc-private"/> <!-- private draft, footer not set -->
     5584    <xsl:when test="$xml2rfc-footer!=''"><xsl:value-of select="$xml2rfc-footer"/></xsl:when>
     5585    <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, footer not set -->
    53325586    <xsl:when test="/rfc/@category='bcp'">Best Current Practice</xsl:when>
    53335587    <xsl:when test="/rfc/@category='historic'">Historic</xsl:when>
     
    53525606<xsl:template name="get-header-left">
    53535607  <xsl:choose>
    5354     <xsl:when test="$xml2rfc-header"><xsl:value-of select="$xml2rfc-header"/></xsl:when>
    5355     <xsl:when test="$xml2rfc-private"/> <!-- private draft, header not set -->
     5608    <xsl:when test="$xml2rfc-header!=''"><xsl:value-of select="$xml2rfc-header"/></xsl:when>
     5609    <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, header not set -->
    53565610    <xsl:when test="/rfc/@ipr and not(/rfc/@number)">INTERNET DRAFT</xsl:when>
    53575611    <xsl:otherwise>RFC <xsl:value-of select="/rfc/@number"/></xsl:otherwise>
     
    53635617    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    53645618    <!-- when RCS keyword substitution in place, add version info -->
    5365     <xsl:if test="contains('$Revision: 1.451 $',':')">
    5366       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.451 $', 'Revision: '),'$','')),', ')"/>
     5619    <xsl:if test="contains('$Revision: 1.475 $',':')">
     5620      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.475 $', 'Revision: '),'$','')),', ')"/>
    53675621    </xsl:if>
    5368     <xsl:if test="contains('$Date: 2009-08-28 12:08:05 $',':')">
    5369       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-08-28 12:08:05 $', 'Date: '),'$','')),', ')"/>
     5622    <xsl:if test="contains('$Date: 2009-10-02 10:40:00 $',':')">
     5623      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-10-02 10:40:00 $', 'Date: '),'$','')),', ')"/>
    53705624    </xsl:if>
    53715625    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))"/>
     
    55075761</xsl:template>
    55085762
     5763<xsl:template name="extract-normalized">
     5764  <xsl:param name="node"/>
     5765  <xsl:param name="name"/>
     5766  <xsl:variable name="text" select="normalize-space($node)"/>
     5767  <xsl:if test="string-length($node) != string-length($text)">
     5768    <xsl:call-template name="warning">
     5769      <xsl:with-param name="inline" select="'no'"/>
     5770      <xsl:with-param name="msg">excessive whitespace in <xsl:value-of select="$name"/>: '<xsl:value-of select="$node"/>'</xsl:with-param>
     5771    </xsl:call-template>
     5772  </xsl:if>
     5773  <xsl:value-of select="$text"/>
     5774</xsl:template>
     5775
    55095776<!-- checking for email element -->
    55105777<xsl:template name="extract-email">
     
    55735840</xsl:template>
    55745841
     5842<!-- parsing of processing instructions -->
     5843<xsl:template name="parse-pis">
     5844  <xsl:param name="nodes"/>
     5845  <xsl:param name="attr"/>
     5846  <xsl:param name="sep"/>
     5847  <xsl:param name="ret"/>
     5848  <xsl:param name="default"/>
     5849 
     5850  <xsl:choose>
     5851    <xsl:when test="count($nodes)=0">
     5852      <xsl:choose>
     5853        <xsl:when test="$ret!=''">
     5854          <xsl:value-of select="$ret"/>
     5855        </xsl:when>
     5856        <xsl:otherwise>
     5857          <xsl:value-of select="$default"/>
     5858        </xsl:otherwise>   
     5859      </xsl:choose>
     5860    </xsl:when>
     5861    <xsl:otherwise>
     5862      <xsl:variable name="ret2">
     5863        <xsl:for-each select="$nodes[1]">
     5864          <xsl:call-template name="parse-one-pi">
     5865            <xsl:with-param name="str" select="."/>
     5866            <xsl:with-param name="attr" select="$attr"/>
     5867            <xsl:with-param name="sep" select="$sep"/>
     5868            <xsl:with-param name="ret" select="$ret"/>
     5869          </xsl:call-template>
     5870        </xsl:for-each>
     5871      </xsl:variable>
     5872     
     5873      <xsl:call-template name="parse-pis">
     5874        <xsl:with-param name="nodes" select="$nodes[position()!=1]"/>
     5875        <xsl:with-param name="attr" select="$attr"/>
     5876        <xsl:with-param name="sep" select="$sep"/>
     5877        <xsl:with-param name="ret" select="$ret2"/>
     5878        <xsl:with-param name="default" select="$default"/>
     5879      </xsl:call-template>
     5880     
     5881    </xsl:otherwise>
     5882  </xsl:choose>
     5883
     5884</xsl:template>
     5885
     5886<xsl:template name="parse-one-pi">
     5887  <xsl:param name="str"/>
     5888  <xsl:param name="attr"/>
     5889  <xsl:param name="sep"/>
     5890  <xsl:param name="ret"/>
     5891
     5892  <xsl:variable name="str2">
     5893    <xsl:call-template name="eat-leading-whitespace">
     5894      <xsl:with-param name="str" select="$str"/>
     5895    </xsl:call-template>
     5896  </xsl:variable>
     5897 
     5898  <xsl:choose>
     5899    <xsl:when test="$str2=''">
     5900      <!-- done -->
     5901      <xsl:value-of select="$ret"/>
     5902    </xsl:when>
     5903    <xsl:otherwise>
     5904      <xsl:variable name="attrname" select="substring-before($str2,'=')"/>
     5905     
     5906      <xsl:choose>
     5907        <xsl:when test="$attrname=''">
     5908          <xsl:call-template name="warning">
     5909            <xsl:with-param name="msg">bad PI syntax: <xsl:value-of select="$str2"/></xsl:with-param>
     5910            <xsl:with-param name="inline" select="'no'"/>
     5911          </xsl:call-template>
     5912          <xsl:value-of select="$ret"/>
     5913        </xsl:when>
     5914        <xsl:otherwise>
     5915          <xsl:variable name="remainder" select="substring($str2,2+string-length($attrname))"/>
     5916          <xsl:choose>
     5917            <xsl:when test="string-length($remainder) &lt; 2">
     5918              <xsl:call-template name="warning">
     5919                <xsl:with-param name="msg">bad PI value syntax: <xsl:value-of select="$remainder"/></xsl:with-param>
     5920                <xsl:with-param name="inline" select="'no'"/>
     5921              </xsl:call-template>
     5922              <xsl:value-of select="$ret"/>
     5923            </xsl:when>
     5924            <xsl:otherwise>
     5925              <xsl:variable name="rem">
     5926                <xsl:call-template name="eat-leading-whitespace">
     5927                  <xsl:with-param name="str" select="$remainder"/>
     5928                </xsl:call-template>
     5929              </xsl:variable>
     5930              <xsl:variable name="qchars">'"</xsl:variable>
     5931              <xsl:variable name="qchar" select="substring($rem,1,1)"/>
     5932              <xsl:variable name="rem2" select="substring($rem,2)"/>
     5933              <xsl:choose>
     5934                <xsl:when test="not(contains($qchars,$qchar))">
     5935                  <xsl:call-template name="warning">
     5936                    <xsl:with-param name="msg">pseudo-attribute value needs to be quoted: <xsl:value-of select="$rem"/></xsl:with-param>
     5937                    <xsl:with-param name="inline" select="'no'"/>
     5938                  </xsl:call-template>
     5939                  <xsl:value-of select="$ret"/>
     5940                </xsl:when>
     5941                <xsl:when test="not(contains($rem2,$qchar))">
     5942                  <xsl:call-template name="warning">
     5943                    <xsl:with-param name="msg">unmatched quote in: <xsl:value-of select="$rem2"/></xsl:with-param>
     5944                    <xsl:with-param name="inline" select="'no'"/>
     5945                  </xsl:call-template>
     5946                  <xsl:value-of select="$ret"/>
     5947                </xsl:when>
     5948                <xsl:otherwise>
     5949                  <xsl:variable name="value" select="substring-before($rem2,$qchar)"/>
     5950
     5951                  <!-- check pseudo-attribute names -->
     5952                  <xsl:if test="name()='rfc-ext' and $attr='SANITYCHECK'">
     5953                    <xsl:choose>
     5954                      <xsl:when test="$attrname='allow-markup-in-artwork'"/>
     5955                      <xsl:when test="$attrname='authors-section'"/>
     5956                      <xsl:when test="$attrname='duplex'"/>
     5957                      <xsl:when test="$attrname='include-references-in-index'"/>
     5958                      <xsl:when test="$attrname='justification'"/>
     5959                      <xsl:when test="$attrname='parse-xml-in-artwork'"/>
     5960                      <xsl:when test="$attrname='sec-no-trailing-dots'"/>
     5961                      <xsl:otherwise>
     5962                        <xsl:call-template name="warning">
     5963                          <xsl:with-param name="msg">unsupported rfc-ext pseudo-attribute '<xsl:value-of select="$attrname"/>'</xsl:with-param>
     5964                          <xsl:with-param name="inline" select="'no'"/>
     5965                        </xsl:call-template>
     5966                      </xsl:otherwise>
     5967                    </xsl:choose>
     5968                  </xsl:if>
     5969                 
     5970                  <xsl:choose>
     5971                    <xsl:when test="$attrname != $attr">
     5972                      <!-- pseudo-attr does not match, continue -->
     5973                      <xsl:call-template name="parse-one-pi">
     5974                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     5975                        <xsl:with-param name="attr" select="$attr"/>
     5976                        <xsl:with-param name="sep" select="$sep"/>
     5977                        <xsl:with-param name="ret" select="$ret"/>
     5978                      </xsl:call-template>
     5979                    </xsl:when>
     5980                    <xsl:when test="$sep='' and $ret!=''">
     5981                      <!-- pseudo-attr does match, but we only want one value -->
     5982                      <xsl:if test="$ret != $value">
     5983                        <xsl:call-template name="warning">
     5984                          <xsl:with-param name="msg">duplicate pseudo-attribute <xsl:value-of select="$attr"/>, overwriting value <xsl:value-of select="$ret"/></xsl:with-param>
     5985                          <xsl:with-param name="inline" select="'no'"/>
     5986                        </xsl:call-template>
     5987                      </xsl:if>
     5988                      <xsl:call-template name="parse-one-pi">
     5989                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     5990                        <xsl:with-param name="attr" select="$attr"/>
     5991                        <xsl:with-param name="sep" select="$sep"/>
     5992                        <xsl:with-param name="ret" select="$value"/>
     5993                      </xsl:call-template>
     5994                    </xsl:when>
     5995                    <xsl:otherwise>
     5996                      <!-- pseudo-attr does match -->
     5997                      <xsl:call-template name="parse-one-pi">
     5998                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     5999                        <xsl:with-param name="attr" select="$attr"/>
     6000                        <xsl:with-param name="sep" select="$sep"/>
     6001                        <xsl:with-param name="ret">
     6002                          <xsl:choose> 
     6003                            <xsl:when test="$ret!=''">
     6004                              <xsl:value-of select="concat($ret,$sep,$value)"/>
     6005                            </xsl:when>
     6006                            <xsl:otherwise>
     6007                              <xsl:value-of select="$value"/>
     6008                            </xsl:otherwise>
     6009                          </xsl:choose>
     6010                        </xsl:with-param>
     6011                      </xsl:call-template>
     6012                    </xsl:otherwise>                 
     6013                 
     6014                  </xsl:choose>
     6015                 
     6016                </xsl:otherwise>
     6017              </xsl:choose>
     6018            </xsl:otherwise>
     6019          </xsl:choose>
     6020        </xsl:otherwise>
     6021      </xsl:choose>
     6022    </xsl:otherwise>
     6023  </xsl:choose>
     6024 
     6025</xsl:template>
     6026
     6027<xsl:template name="eat-leading-whitespace">
     6028  <xsl:param name="str"/>
     6029
     6030  <xsl:choose>
     6031    <xsl:when test="$str=''">
     6032    </xsl:when>
     6033    <xsl:when test="translate(substring($str,1,1),' &#xA;&#xD;&#x9;',' ')=' '">
     6034      <xsl:call-template name="eat-leading-whitespace">
     6035        <xsl:with-param name="str" select="substring($str,2)"/>
     6036      </xsl:call-template>
     6037    </xsl:when>
     6038    <xsl:otherwise>
     6039      <xsl:value-of select="$str"/>
     6040    </xsl:otherwise>
     6041  </xsl:choose>
     6042 
     6043</xsl:template>
     6044
    55756045<!-- diag support -->
    55766046<xsl:template name="lineno">
     
    56196089<xsl:variable name="may-default-dates">
    56206090  <xsl:choose>
    5621     <xsl:when test="function-available('date:year') and function-available('date:month-in-year') and date:day-in-month()">
     6091    <xsl:when test="function-available('date:year') and function-available('date:month-in-year') and function-available('date:day-in-month')">
    56226092      <xsl:variable name="year-specified" select="/rfc/front/date/@year and /rfc/front/date/@year!=''"/>
    56236093      <xsl:variable name="month-specified" select="/rfc/front/date/@month and /rfc/front/date/@month!=''"/>
     
    56476117      <xsl:value-of select="/rfc/front/date/@year"/>
    56486118    </xsl:when>
    5649     <xsl:when test="function-available('date:year')">
    5650       <xsl:if test="/rfc/front/date/@month and /rfc/front/date/@month!=''">
    5651         <xsl:call-template name="error">
    5652           <xsl:with-param name="msg" select="'defaulting publication year although month was specified'"/>
    5653         </xsl:call-template>
    5654       </xsl:if>
    5655       <xsl:if test="/rfc/front/date/@day and /rfc/front/date/@day!=''">
    5656         <xsl:call-template name="error">
    5657           <xsl:with-param name="msg" select="'defaulting publication year although day was specified'"/>
    5658         </xsl:call-template>
    5659       </xsl:if>
     6119    <xsl:when test="function-available('date:year') and $may-default-dates='yes'">
    56606120      <xsl:value-of select="date:year()"/>
     6121    </xsl:when>
     6122    <xsl:when test="function-available('date:year') and $may-default-dates!='yes'">
     6123      <xsl:call-template name="warning">
     6124        <xsl:with-param name="inline" select="'no'"/>
     6125        <xsl:with-param name="msg" select="$may-default-dates"/>
     6126      </xsl:call-template>
    56616127    </xsl:when>
    56626128    <xsl:otherwise>
     
    56926158</xsl:param>
    56936159
    5694 <xsl:param name="xml2rfc-ext-pub-month-numeric">
     6160<xsl:param name="pub-month-numeric">
    56956161  <xsl:call-template name="get-month-as-num">
    56966162    <xsl:with-param name="month" select="$xml2rfc-ext-pub-month"/>
     
    57106176</xsl:param>
    57116177
     6178<xsl:param name="pub-yearmonth">
     6179  <!-- year or 0000 -->
     6180  <xsl:choose>
     6181    <xsl:when test="$xml2rfc-ext-pub-year!=''">
     6182      <xsl:value-of select="format-number($xml2rfc-ext-pub-year,'0000')"/>
     6183    </xsl:when>
     6184    <xsl:otherwise>0000</xsl:otherwise>
     6185  </xsl:choose>
     6186  <!-- month or 00 -->
     6187  <xsl:choose>
     6188    <xsl:when test="$pub-month-numeric &gt; 0">
     6189      <xsl:value-of select="format-number($pub-month-numeric,'00')"/>
     6190    </xsl:when>
     6191    <xsl:otherwise>00</xsl:otherwise>
     6192  </xsl:choose>
     6193
     6194</xsl:param>
     6195
    57126196</xsl:transform>
Note: See TracChangeset for help on using the changeset viewer.