Ignore:
Timestamp:
02/10/09 10:46:42 (12 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/rfc2629.xslt

    r689 r704  
    5151<xsl:output method="html" encoding="iso-8859-1" version="4.0" doctype-public="-//W3C//DTD HTML 4.01//EN" indent="no"/>
    5252
    53 <!-- process some of the processing instructions supported by Marshall T. Rose's
    54      xml2rfc sofware, see <http://xml.resource.org/> -->
    55 
    56 <!-- delimiters in PIs -->
    57 <xsl:variable name="quote-chars">"'</xsl:variable>     
    58      
    5953<!-- rfc comments PI -->
    6054
    61 <xsl:param name="xml2rfc-comments"
    62   select="substring-after(
    63       translate(/processing-instruction('rfc')[contains(.,'comments=')], concat($quote-chars,' '), ''),
    64         'comments=')"
    65 />
     55<xsl:param name="xml2rfc-comments">
     56  <xsl:call-template name="parse-pis">
     57    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     58    <xsl:with-param name="attr" select="'comments'"/>
     59    <xsl:with-param name="default" select="'no'"/>
     60  </xsl:call-template>
     61</xsl:param>
    6662
    6763<!-- rfc compact PI -->
    6864
    69 <xsl:param name="xml2rfc-compact"
    70   select="substring-after(
    71       translate(/processing-instruction('rfc')[contains(.,'compact=')], concat($quote-chars,' '), ''),
    72         'compact=')"
    73 />
     65<xsl:param name="xml2rfc-compact">
     66  <xsl:call-template name="parse-pis">
     67    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     68    <xsl:with-param name="attr" select="'compact'"/>
     69    <xsl:with-param name="default" select="$xml2rfc-rfcedstyle"/>
     70  </xsl:call-template>
     71</xsl:param>
    7472
    7573<!-- rfc footer PI -->
    7674
    77 <xsl:param name="xml2rfc-footer"
    78   select="substring-after(
    79       translate(/processing-instruction('rfc')[contains(.,'footer=')], concat($quote-chars,' '), ''),
    80         'footer=')"
    81 />
     75<xsl:param name="xml2rfc-footer">
     76  <xsl:call-template name="parse-pis">
     77    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     78    <xsl:with-param name="attr" select="'footer'"/>
     79  </xsl:call-template>
     80</xsl:param>
    8281
    8382<!-- rfc header PI -->
    8483
    85 <xsl:param name="xml2rfc-header"
    86   select="substring-after(
    87       translate(/processing-instruction('rfc')[contains(.,'header=')], concat($quote-chars,' '), ''),
    88         'header=')"
    89 />
     84<xsl:param name="xml2rfc-header">
     85  <xsl:call-template name="parse-pis">
     86    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     87    <xsl:with-param name="attr" select="'header'"/>
     88  </xsl:call-template>
     89</xsl:param>
    9090
    9191<!-- rfc inline PI -->
    9292
    93 <xsl:param name="xml2rfc-inline"
    94   select="substring-after(
    95       translate(/processing-instruction('rfc')[contains(.,'inline=')], concat($quote-chars,' '), ''),
    96         'inline=')"
    97 />
    98 
    99 <!-- rfc strict PI -->
    100 
    101 <xsl:param name="xml2rfc-strict"
    102   select="substring-after(
    103       translate(/processing-instruction('rfc')[contains(.,'strict=')], concat($quote-chars,' '), ''),
    104         'strict=')"
    105 />
     93<xsl:param name="xml2rfc-inline">
     94  <xsl:call-template name="parse-pis">
     95    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     96    <xsl:with-param name="attr" select="'inline'"/>
     97    <xsl:with-param name="default" select="'no'"/>
     98  </xsl:call-template>
     99</xsl:param>
    106100
    107101<!-- include a table of contents if a processing instruction <?rfc?>
    108102     exists with contents toc="yes". Can be overriden by an XSLT parameter -->
    109103
    110 <xsl:param name="xml2rfc-toc"
    111   select="substring-after(
    112       translate(/processing-instruction('rfc')[contains(.,'toc=')], concat($quote-chars,' '), ''),
    113         'toc=')"
    114 />
     104<xsl:param name="xml2rfc-toc">
     105  <xsl:call-template name="parse-pis">
     106    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     107    <xsl:with-param name="attr" select="'toc'"/>
     108    <xsl:with-param name="default" select="'no'"/>
     109  </xsl:call-template>
     110</xsl:param>
    115111
    116112<!-- optional tocdepth-->
    117113
    118 <xsl:param name="xml2rfc-tocdepth"
    119   select="substring-after(
    120       translate(/processing-instruction('rfc')[contains(.,'tocdepth=')], concat($quote-chars,' '), ''),
    121         'tocdepth=')"
    122 />
     114<xsl:param name="xml2rfc-tocdepth">
     115  <xsl:call-template name="parse-pis">
     116    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     117    <xsl:with-param name="attr" select="'tocdepth'"/>
     118    <xsl:with-param name="default" select="'3'"/>
     119  </xsl:call-template>
     120</xsl:param>
    123121
    124122<xsl:variable name="parsedTocDepth">
     
    136134     exists with contents tocblock="no". Can be overriden by an XSLT parameter -->
    137135
    138 <xsl:param name="xml2rfc-topblock"
    139   select="substring-after(
    140       translate(/processing-instruction('rfc')[contains(.,'topblock=')], concat($quote-chars,' '), ''),
    141         'topblock=')"
    142 />
     136<xsl:param name="xml2rfc-topblock">
     137  <xsl:call-template name="parse-pis">
     138    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     139    <xsl:with-param name="attr" select="'topblock'"/>
     140    <xsl:with-param name="default" select="'yes'"/>
     141  </xsl:call-template>
     142</xsl:param>
    143143
    144144<!-- Format to the RFC Editor's taste -->
    145145
    146 <xsl:param name="xml2rfc-rfcedstyle"
    147   select="substring-after(
    148       translate(/processing-instruction('rfc')[contains(.,'rfcedstyle=')], concat($quote-chars,' '), ''),
    149         'rfcedstyle=')"
    150 />
     146<xsl:param name="xml2rfc-rfcedstyle">
     147  <xsl:call-template name="parse-pis">
     148    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     149    <xsl:with-param name="attr" select="'rfcedstyle'"/>
     150    <xsl:with-param name="default" select="'no'"/>
     151  </xsl:call-template>
     152</xsl:param>
     153
     154<!-- the name of an automatically inserted references section -->
     155
     156<xsl:param name="xml2rfc-refparent">
     157  <xsl:call-template name="parse-pis">
     158    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     159    <xsl:with-param name="attr" select="'refparent'"/>
     160    <xsl:with-param name="default" select="'References'"/>
     161  </xsl:call-template>
     162</xsl:param>
    151163
    152164<!-- use symbolic reference names instead of numeric ones unless a processing instruction <?rfc?>
    153165     exists with contents symrefs="no". Can be overriden by an XSLT parameter -->
    154166
    155 <xsl:param name="xml2rfc-symrefs"
    156   select="substring-after(
    157       translate(/processing-instruction('rfc')[contains(.,'symrefs=')], concat($quote-chars,' '), ''),
    158         'symrefs=')"
    159 />
     167<xsl:param name="xml2rfc-symrefs">
     168  <xsl:call-template name="parse-pis">
     169    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     170    <xsl:with-param name="attr" select="'symrefs'"/>
     171    <xsl:with-param name="default" select="'yes'"/>
     172  </xsl:call-template>
     173</xsl:param>
    160174
    161175<!-- sort references if a processing instruction <?rfc?>
    162176     exists with contents sortrefs="yes". Can be overriden by an XSLT parameter -->
    163177
    164 <xsl:param name="xml2rfc-sortrefs"
    165   select="substring-after(
    166       translate(/processing-instruction('rfc')[contains(.,'sortrefs=')], concat($quote-chars,' '), ''),
    167         'sortrefs=')"
    168 />
     178<xsl:param name="xml2rfc-sortrefs">
     179  <xsl:call-template name="parse-pis">
     180    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     181    <xsl:with-param name="attr" select="'sortrefs'"/>
     182    <xsl:with-param name="default" select="'no'"/>
     183  </xsl:call-template>
     184</xsl:param>
    169185
    170186<!-- insert editing marks if a processing instruction <?rfc?>
    171187     exists with contents editing="yes". Can be overriden by an XSLT parameter -->
    172188
    173 <xsl:param name="xml2rfc-editing"
    174   select="substring-after(
    175       translate(/processing-instruction('rfc')[contains(.,'editing=')], concat($quote-chars,' '), ''),
    176         'editing=')"
    177 />
     189<xsl:param name="xml2rfc-editing">
     190  <xsl:call-template name="parse-pis">
     191    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     192    <xsl:with-param name="attr" select="'editing'"/>
     193    <xsl:with-param name="default" select="'no'"/>
     194  </xsl:call-template>
     195</xsl:param>
    178196
    179197<!-- make it a private paper -->
    180198
    181 <xsl:param name="xml2rfc-private"
    182   select="substring-after(
    183       translate(/processing-instruction('rfc')[contains(.,'private=')], $quote-chars, ''),
    184         'private=')"
    185 />
     199<xsl:param name="xml2rfc-private">
     200  <xsl:call-template name="parse-pis">
     201    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     202    <xsl:with-param name="attr" select="'private'"/>
     203  </xsl:call-template>
     204</xsl:param>
    186205
    187206<!-- background image? -->
    188207
    189 <xsl:param name="xml2rfc-background"
    190   select="substring-after(
    191       translate(/processing-instruction('rfc')[contains(.,'background=')], $quote-chars, ''),
    192         'background=')"
    193 />
     208<xsl:param name="xml2rfc-background">
     209  <xsl:call-template name="parse-pis">
     210    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     211    <xsl:with-param name="attr" select="'background'"/>
     212  </xsl:call-template>
     213</xsl:param>
    194214
    195215<!-- extension for XML parsing in artwork -->
    196216
    197 <xsl:param name="xml2rfc-ext-parse-xml-in-artwork"
    198   select="substring-after(
    199       translate(/processing-instruction('rfc-ext')[contains(.,'parse-xml-in-artwork=')], concat($quote-chars,' '), ''),
    200         'parse-xml-in-artwork=')"
    201 />
     217<xsl:param name="xml2rfc-ext-parse-xml-in-artwork">
     218  <xsl:call-template name="parse-pis">
     219    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     220    <xsl:with-param name="attr" select="'parse-xml-in-artwork'"/>
     221    <xsl:with-param name="default" select="'no'"/>
     222  </xsl:call-template>
     223</xsl:param>
    202224
    203225<!-- extension for excluding DCMI properties in meta tag (RFC2731) -->
    204226
    205 <xsl:param name="xml2rfc-ext-support-rfc2731"
    206   select="substring-after(
    207       translate(/processing-instruction('rfc-ext')[contains(.,'support-rfc2731=')], concat($quote-chars,' '), ''),
    208         'support-rfc2731=')"
    209 />
     227<xsl:param name="xml2rfc-ext-support-rfc2731">
     228  <xsl:call-template name="parse-pis">
     229    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     230    <xsl:with-param name="attr" select="'support-rfc2731'"/>
     231    <xsl:with-param name="default" select="'yes'"/>
     232  </xsl:call-template>
     233</xsl:param>
    210234
    211235<!-- extension for allowing markup inside artwork -->
    212236
    213 <xsl:param name="xml2rfc-ext-allow-markup-in-artwork"
    214   select="substring-after(
    215       translate(/processing-instruction('rfc-ext')[contains(.,'allow-markup-in-artwork=')], concat($quote-chars,' '), ''),
    216         'allow-markup-in-artwork=')"
    217 />
     237<xsl:param name="xml2rfc-ext-allow-markup-in-artwork">
     238  <xsl:call-template name="parse-pis">
     239    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     240    <xsl:with-param name="attr" select="'allow-markup-in-artwork'"/>
     241    <xsl:with-param name="default" select="'no'"/>
     242  </xsl:call-template>
     243</xsl:param>
    218244
    219245<!-- extension for including references into index -->
    220246
    221 <xsl:param name="xml2rfc-ext-include-references-in-index"
    222   select="substring-after(
    223       translate(/processing-instruction('rfc-ext')[contains(.,'include-references-in-index=')], concat($quote-chars,' '), ''),
    224         'include-references-in-index=')"
    225 />
     247<xsl:param name="xml2rfc-ext-include-references-in-index">
     248  <xsl:call-template name="parse-pis">
     249    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     250    <xsl:with-param name="attr" select="'include-references-in-index'"/>
     251    <xsl:with-param name="default" select="'no'"/>
     252  </xsl:call-template>
     253</xsl:param>
    226254
    227255<!-- position of author's section -->
    228256
    229 <xsl:param name="xml2rfc-ext-authors-section"
    230   select="substring-after(
    231       translate(/processing-instruction('rfc-ext')[contains(.,'authors-section=')], concat($quote-chars,' '), ''),
    232         'authors-section=')"
    233 />
     257<xsl:param name="xml2rfc-ext-authors-section">
     258  <xsl:call-template name="parse-pis">
     259    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     260    <xsl:with-param name="attr" select="'authors-section'"/>
     261  </xsl:call-template>
     262</xsl:param>
    234263
    235264<!-- justification? -->
    236265
    237 <xsl:param name="xml2rfc-ext-justification"
    238   select="substring-after(
    239       translate(/processing-instruction('rfc-ext')[contains(.,'justification=')], concat($quote-chars,' '), ''),
    240         'justification=')"
    241 />
     266<xsl:param name="xml2rfc-ext-justification">
     267  <xsl:call-template name="parse-pis">
     268    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     269    <xsl:with-param name="attr" select="'justification'"/>
     270    <xsl:with-param name="default" select="'no'"/>
     271  </xsl:call-template>
     272</xsl:param>
     273
     274<!-- switch for doublesided layout -->
     275
     276<xsl:param name="xml2rfc-ext-duplex">
     277  <xsl:call-template name="parse-pis">
     278    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     279    <xsl:with-param name="attr" select="'duplex'"/>
     280    <xsl:with-param name="default" select="'no'"/>
     281  </xsl:call-template>
     282</xsl:param>
    242283
    243284<!-- trailing dots in section numbers -->
    244285
    245 <xsl:param name="xml2rfc-ext-sec-no-trailing-dots"
    246   select="substring-after(
    247       translate(/processing-instruction('rfc-ext')[contains(.,'sec-no-trailing-dots=')], concat($quote-chars,' '), ''),
    248         'sec-no-trailing-dots=')"
    249 />
     286<xsl:param name="xml2rfc-ext-sec-no-trailing-dots">
     287  <xsl:call-template name="parse-pis">
     288    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     289    <xsl:with-param name="attr" select="'sec-no-trailing-dots'"/>
     290  </xsl:call-template>
     291</xsl:param>
    250292
    251293<!-- choose whether or not to do mailto links -->
    252294 
    253 <xsl:param name="xml2rfc-linkmailto"
    254   select="substring-after(
    255       translate(/processing-instruction('rfc')[contains(.,'linkmailto=')], concat($quote-chars,' '), ''),
    256         'linkmailto=')"
    257 />
    258 
     295<xsl:param name="xml2rfc-linkmailto">
     296  <xsl:call-template name="parse-pis">
     297    <xsl:with-param name="nodes" select="/processing-instruction('rfc-ext')"/>
     298    <xsl:with-param name="attr" select="'linkmailto'"/>
     299    <xsl:with-param name="default" select="'yes'"/>
     300  </xsl:call-template>
     301</xsl:param>
    259302
    260303<!-- iprnotified switch -->
    261304 
    262 <xsl:param name="xml2rfc-iprnotified"
    263   select="substring-after(
    264       translate(/processing-instruction('rfc')[contains(.,'iprnotified=')], concat($quote-chars,' '), ''),
    265         'iprnotified=')"
    266 />
     305<xsl:param name="xml2rfc-iprnotified">
     306  <xsl:call-template name="parse-pis">
     307    <xsl:with-param name="nodes" select="/processing-instruction('rfc')"/>
     308    <xsl:with-param name="attr" select="'iprnotified'"/>
     309    <xsl:with-param name="default" select="'no'"/>
     310  </xsl:call-template>
     311</xsl:param>
    267312
    268313<!-- URL templates for RFCs and Internet Drafts. -->
     
    340385  )" />
    341386
     387<xsl:variable name="rfcno" select="/rfc/@number"/> 
     388 
    342389<xsl:variable name="ipr-rfc4748" select="(
    343390  $ipr-rfc3667 and
    344     (
    345       (/rfc/@number &gt; 4671) or
    346       ($xml2rfc-ext-pub-year &gt; 2006) or
    347       ($xml2rfc-ext-pub-year &gt; 2005 and $xml2rfc-ext-pub-month-numeric >= 11)
    348     )
     391    ( $rfcno &gt;= 4715 and ( $rfcno != 4718 and $rfcno != 4735 and $rfcno != 4749 ))
     392    or
     393    ( $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 )
     394    or
     395    ( not(/rfc/@number) and $pub-yearmonth >= 200611)
    349396  )" />
    350397
     
    352399  $ipr-rfc4748 and
    353400    (
    354       (/rfc/@number &gt; 5000
    355         and /rfc/@number != 5020
    356         and /rfc/@number != 5021
    357         and /rfc/@number != 5034
    358         and /rfc/@number != 5052
    359         and /rfc/@number != 5065
    360         and /rfc/@number != 5094) or
    361       ($xml2rfc-ext-pub-year &gt;= 2008) or
    362       (not(/rfc/@number) and $xml2rfc-ext-pub-year &gt;= 2007 and $xml2rfc-ext-pub-month-numeric >= 9)
     401      ($rfcno &gt; 5000
     402        and $rfcno != 5020
     403        and $rfcno != 5021
     404        and $rfcno != 5034
     405        and $rfcno != 5052
     406        and $rfcno != 5065
     407        and $rfcno != 5094) or
     408      ($xml2rfc-ext-pub-year >= 2008) or
     409      (not(/rfc/@number) and $pub-yearmonth >= 200709)
    363410    )
    364411  )" />
    365412
    366413<xsl:variable name="ipr-2008-11" select="(
    367     /rfc/@number and
    368     ($xml2rfc-ext-pub-year &gt;= 2009 or ($xml2rfc-ext-pub-year &gt;= 2008 and $xml2rfc-ext-pub-month-numeric >= 11))
     414    /rfc/@number and $pub-yearmonth >= 200811
    369415  )
    370416  or
     
    380426
    381427<xsl:variable name="ipr-2009-02" select="(
    382     $ipr-2008-11 and ($xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric >= 02))
     428    $ipr-2008-11 and $pub-yearmonth >= 200902
    383429  )" />
    384430
    385 <!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html -->
    386 <xsl:variable name="abstract-first" select="(
    387     /rfc/@number and (
    388       $xml2rfc-ext-pub-year &gt;= 2010 or ($xml2rfc-ext-pub-year &gt;= 2009 and $xml2rfc-ext-pub-month-numeric >= 07)
     431<!-- this makes the Sep 2009 TLP text depend on the publication date to be >= 2009-12
     432     for IDs, and around 2009-09 for RFCs-->
     433<xsl:variable name="ipr-2009-09" select="(
     434    ( not(/rfc/@number) and $pub-yearmonth >= 200912 )
     435    or
     436    (
     437      /rfc/@number and $pub-yearmonth >= 200909 and
     438      $rfcno!=5582 and $rfcno!=5621 and $rfcno!=5632 and $rfcno!=5645 and $rfcno!=5646 and $rfcno!=5681
    389439    )
    390440  )" />
    391441
     442<!-- see http://mailman.rfc-editor.org/pipermail/rfc-interest/2009-June/001373.html -->
     443<!-- for IDs, implement the change as 2009-12 -->
     444<xsl:variable name="abstract-first" select="(
     445    (/rfc/@number and $pub-yearmonth >= 200907)
     446    or
     447    (not(/rfc/@number) and $pub-yearmonth >= 200912)
     448  )" />
     449
    392450<!-- funding switch --> 
    393451<xsl:variable name="funding0" select="(
    394   /rfc/@number &gt; 2499) or
     452  $rfcno &gt; 2499) or
    395453  (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 1999
    396454  )" />
    397455 
    398456<xsl:variable name="funding1" select="(
    399   /rfc/@number &gt; 4320) or
     457  $rfcno &gt; 4320) or
    400458  (not(/rfc/@number) and /rfc/@docName and $xml2rfc-ext-pub-year &gt;= 2006
    401459  )" />
     
    471529    <xsl:otherwise/>
    472530  </xsl:choose>
     531</xsl:template>
     532
     533<xsl:template name="insert-begin-code">
     534  <xsl:if test="@x:isCodeComponent='yes'">
     535    <pre class="ccmarker cct"><span>&lt;CODE BEGINS></span></pre>
     536  </xsl:if>
     537</xsl:template>
     538
     539<xsl:template name="insert-end-code">
     540  <xsl:if test="@x:isCodeComponent='yes'">
     541    <pre class="ccmarker ccb"><span>&lt;CODE ENDS></span></pre>
     542  </xsl:if>
    473543</xsl:template>
    474544
     
    514584    <xsl:when test="@align='right'">
    515585      <div style="display:table; margin-left: auto; margin-right: 0pt;">
     586        <xsl:call-template name="insert-begin-code"/>
    516587        <pre style="margin-left: 0em;">
    517588          <xsl:call-template name="add-artwork-class"/>
     
    519590          <xsl:copy-of select="$display"/>
    520591        </pre>         
     592        <xsl:call-template name="insert-end-code"/>
    521593      </div>
    522594    </xsl:when>
    523595    <xsl:when test="@align='center'">
    524596      <div style="display:table; margin-left: auto; margin-right: auto;">
     597        <xsl:call-template name="insert-begin-code"/>
    525598        <pre style="margin-left: 0em;">
    526599          <xsl:call-template name="add-artwork-class"/>
     
    528601          <xsl:copy-of select="$display"/>
    529602        </pre>         
     603        <xsl:call-template name="insert-end-code"/>
    530604      </div>
    531605    </xsl:when>
    532606    <xsl:otherwise>
     607      <xsl:call-template name="insert-begin-code"/>
    533608      <pre>
    534609        <xsl:call-template name="add-artwork-class"/>
     
    536611        <xsl:copy-of select="$display"/>
    537612      </pre>
     613      <xsl:call-template name="insert-end-code"/>
    538614    </xsl:otherwise>
    539615  </xsl:choose>
     
    665741            <xsl:for-each select="address/postal/street">
    666742              <span class="street-address vcardline">
    667                 <xsl:value-of select="." />
     743                <xsl:call-template name="extract-normalized">
     744                  <xsl:with-param name="node" select="."/>
     745                  <xsl:with-param name="name" select="'street'"/>
     746                </xsl:call-template>
    668747              </span>
    669748            </xsl:for-each>
     
    671750          <xsl:if test="address/postal/city|address/postal/region|address/postal/code">
    672751            <span class="vcardline">
    673               <xsl:if test="address/postal/city"><span class="locality"><xsl:value-of select="address/postal/city" /></span>, </xsl:if>
    674               <xsl:if test="address/postal/region"><span class="region"><xsl:value-of select="address/postal/region" /></span>&#160;</xsl:if>
    675               <xsl:if test="address/postal/code"><span class="postal-code"><xsl:value-of select="address/postal/code" /></span></xsl:if>
     752              <xsl:if test="address/postal/city">
     753                <span class="locality">
     754                  <xsl:call-template name="extract-normalized">
     755                    <xsl:with-param name="node" select="address/postal/city"/>
     756                    <xsl:with-param name="name" select="'address/postal/city'"/>
     757                  </xsl:call-template>
     758                </span>
     759                <xsl:text>, </xsl:text>
     760              </xsl:if>
     761              <xsl:if test="address/postal/region">
     762                <span class="region">
     763                  <xsl:call-template name="extract-normalized">
     764                    <xsl:with-param name="node" select="address/postal/region"/>
     765                    <xsl:with-param name="name" select="'address/postal/region'"/>
     766                  </xsl:call-template>
     767                </span>
     768                <xsl:text>&#160;</xsl:text>
     769              </xsl:if>
     770              <xsl:if test="address/postal/code">
     771                <span class="postal-code">
     772                  <xsl:call-template name="extract-normalized">
     773                    <xsl:with-param name="node" select="address/postal/code"/>
     774                    <xsl:with-param name="name" select="'address/postal/code'"/>
     775                  </xsl:call-template>
     776                </span>
     777              </xsl:if>
    676778            </span>
    677779          </xsl:if>
    678780          <xsl:if test="address/postal/country">
    679             <span class="country-name vcardline"><xsl:value-of select="address/postal/country" /></span>
     781            <span class="country-name vcardline">
     782              <xsl:call-template name="extract-normalized">
     783                <xsl:with-param name="node" select="address/postal/country"/>
     784                <xsl:with-param name="name" select="'address/postal/country'"/>
     785              </xsl:call-template>
     786            </span>
    680787          </xsl:if>
    681788        </span>
     
    751858  </xsl:if>
    752859
    753   <xsl:if test="not($xml2rfc-private)">
     860  <xsl:if test="$xml2rfc-private=''">
    754861    <!-- copyright statements -->
    755862    <xsl:variable name="copyright"><xsl:call-template name="insertCopyright" /></xsl:variable>
     
    812919     
    813920    <!-- insert the collected information -->
    814     <table summary="header information" class="header" border="0" cellpadding="1" cellspacing="1">
     921    <table class="header" border="0" cellpadding="1" cellspacing="1">
    815922      <xsl:choose>
    816923        <xsl:when test="function-available('exslt:node-set')">
     
    880987  </xsl:choose>           
    881988
    882   <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     989  <xsl:if test="$xml2rfc-private='' and not($abstract-first)">
    883990    <xsl:call-template name="emit-ietf-preamble"/>
    884991  </xsl:if>
     
    890997  <xsl:apply-templates select="ed:replace[.//note]" />
    891998   
    892   <xsl:if test="not($xml2rfc-private) and $abstract-first">
     999  <xsl:if test="$xml2rfc-private='' and $abstract-first">
    8931000    <xsl:call-template name="emit-ietf-preamble"/>
    8941001  </xsl:if>
     
    14411548        </xsl:call-template>
    14421549      </a>
    1443       <xsl:text> References</xsl:text>
     1550      <xsl:text> </xsl:text>
     1551      <xsl:value-of select="$xml2rfc-refparent"/>
    14441552    </h1>
    14451553  </xsl:if>
     
    14541562  <xsl:variable name="title">
    14551563    <xsl:choose>
    1456       <xsl:when test="not(@title) or @title=''">References</xsl:when>
     1564      <xsl:when test="not(@title) or @title=''"><xsl:value-of select="$xml2rfc-refparent"/></xsl:when>
    14571565      <xsl:otherwise><xsl:value-of select="@title"/></xsl:otherwise>
    14581566    </xsl:choose>
     
    14821590  </xsl:element>
    14831591 
    1484   <table summary="{$title}">
     1592  <table>
    14851593    <xsl:choose>
    14861594      <xsl:when test="$xml2rfc-sortrefs='yes' and $xml2rfc-symrefs!='no'">
     
    15071615  </xsl:if>
    15081616 
     1617  <xsl:variable name="ignored">
     1618    <xsl:call-template name="parse-pis">
     1619      <xsl:with-param name="nodes" select="//processing-instruction('rfc-ext')"/>
     1620      <xsl:with-param name="attr" select="'SANITYCHECK'"/>
     1621    </xsl:call-template>
     1622  </xsl:variable>
     1623
    15091624  <xsl:variable name="lang">
    15101625    <xsl:call-template name="get-lang" />
     
    15231638        <xsl:apply-templates select="front/title" mode="get-text-content" />
    15241639      </title>
    1525       <style type="text/css" title="Xml2Rfc (sans serif)">
    1526         <xsl:call-template name="insertCss" />
    1527       </style>
     1640      <xsl:call-template name="insertCss" />
    15281641      <!-- <link rel="alternate stylesheet" type="text/css" media="screen" title="Plain (typewriter)" href="rfc2629tty.css" /> -->
    15291642           
     
    15331646      </xsl:if>
    15341647      <link rel="Author" href="#{$anchor-prefix}.authors" />
    1535       <xsl:if test="not($xml2rfc-private)">
     1648      <xsl:if test="$xml2rfc-private=''">
    15361649        <link rel="Copyright" href="#{$anchor-prefix}.copyright" />
    15371650      </xsl:if>
     
    15821695        </xsl:for-each>
    15831696       
    1584         <xsl:if test="not($xml2rfc-private)">
     1697        <xsl:if test="$xml2rfc-private=''">
    15851698          <xsl:choose>
    15861699            <xsl:when test="@number">
     
    15941707          <meta name="DC.Date.Issued" scheme="ISO8601">
    15951708            <xsl:attribute name="content">
    1596               <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$xml2rfc-ext-pub-month-numeric)"/>
     1709              <xsl:value-of select="concat($xml2rfc-ext-pub-year,'-',$pub-month-numeric)"/>
    15971710              <xsl:if test="$xml2rfc-ext-pub-day != '' and not(@number)">
    15981711                <xsl:value-of select="concat('-',format-number($xml2rfc-ext-pub-day,'00'))"/>
     
    18882001  </xsl:attribute>
    18892002  <xsl:choose>
    1890     <xsl:when test="@format='counter'">
     2003    <xsl:when test="$from/@format='counter'">
    18912004      <xsl:value-of select="$refnum"/>
    18922005    </xsl:when>
    1893     <xsl:when test="@format='title'">
     2006    <xsl:when test="$from/@format='title'">
    18942007      <xsl:value-of select="$to/@title"/>
    18952008    </xsl:when>
     
    19672080
    19682081    <xsl:otherwise>
    1969       <a href="#{$target}"><xsl:apply-templates /></a>
     2082      <a href="#{$target}">
     2083        <xsl:if test="@format='none'">
     2084          <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2085            <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2086          </xsl:if>
     2087        </xsl:if>
     2088        <xsl:apply-templates />
     2089      </a>
    19702090      <xsl:if test="not(@format='none')">
    19712091        <xsl:for-each select="$src/rfc/back/references//reference[@anchor=$target]">
     
    19902110<xsl:template match="xref[not(node())]">
    19912111
    1992   <xsl:variable name="target" select="@target" />
    1993   <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>
    1994   <xsl:variable name="node" select="key('anchor-item',$target)" />
    1995   <xsl:if test="count($node)=0 and not(ancestor::ed:del)">
    1996     <xsl:call-template name="error">
    1997       <xsl:with-param name="msg" select="concat('Undefined target: ',@target)"/>
    1998     </xsl:call-template>
    1999   </xsl:if>
    2000 
    2001   <xsl:choose>
    2002  
    2003     <!-- Section links -->
    2004     <xsl:when test="$node/self::section or $node/self::appendix">
    2005       <a href="#{@target}">
    2006         <!-- insert id when a backlink to this xref is needed in the index -->
    2007         <xsl:if test="key('iref-xanch',$target) | key('iref-xanch','')[../@anchor=$target]">
    2008           <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    2009         </xsl:if>
    2010         <xsl:call-template name="render-section-ref">
    2011           <xsl:with-param name="from" select="."/>
    2012           <xsl:with-param name="to" select="$node"/>
    2013         </xsl:call-template>
    2014       </a>
    2015     </xsl:when>
    2016 
    2017     <!-- Figure links -->
    2018     <xsl:when test="$node/self::figure">
    2019       <a href="#{$target}">
    2020         <xsl:variable name="figcnt">
    2021           <xsl:for-each select="$node">
    2022             <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
    2023           </xsl:for-each>
    2024         </xsl:variable>
    2025         <xsl:choose>
    2026           <xsl:when test="@format='counter'">
    2027             <xsl:value-of select="$figcnt" />
    2028           </xsl:when>
    2029           <xsl:when test="@format='title'">
    2030             <xsl:value-of select="$node/@title" />
    2031           </xsl:when>
    2032           <xsl:otherwise>
    2033             <xsl:value-of select="normalize-space(concat('Figure&#160;',$figcnt))"/>
    2034           </xsl:otherwise>
    2035         </xsl:choose>
    2036       </a>
    2037     </xsl:when>
     2112  <xsl:variable name="xref" select="."/>
     2113  <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>
     2114
     2115  <!-- ensure we have the right context, this <xref> may be processed from within the boilerplate -->
     2116  <xsl:for-each select="$src">
     2117
     2118    <xsl:variable name="node" select="key('anchor-item',$xref/@target)" />
     2119    <xsl:if test="count($node)=0 and not($node/ancestor::ed:del)">
     2120      <xsl:call-template name="error">
     2121        <xsl:with-param name="msg" select="concat('Undefined target: ',$xref/@target)"/>
     2122      </xsl:call-template>
     2123    </xsl:if>
     2124 
     2125    <xsl:choose>
    20382126   
    2039     <!-- Table links -->
    2040     <xsl:when test="$node/self::texttable">
    2041       <a href="#{$target}">
    2042         <xsl:variable name="tabcnt">
    2043           <xsl:for-each select="$node">
    2044             <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
    2045           </xsl:for-each>
    2046         </xsl:variable>
    2047         <xsl:choose>
    2048           <xsl:when test="@format='counter'">
    2049             <xsl:value-of select="$tabcnt" />
    2050           </xsl:when>
    2051           <xsl:when test="@format='title'">
    2052             <xsl:value-of select="$node/@title" />
    2053           </xsl:when>
    2054           <xsl:otherwise>
    2055             <xsl:value-of select="normalize-space(concat('Table&#160;',$tabcnt))"/>
    2056           </xsl:otherwise>
    2057         </xsl:choose>
    2058       </a>
    2059     </xsl:when>
    2060    
    2061     <!-- Paragraph links -->
    2062     <xsl:when test="$node/self::t">
    2063       <a href="#{$target}">
    2064         <xsl:variable name="tcnt">
    2065           <xsl:for-each select="$node">
    2066             <xsl:call-template name="get-paragraph-number" />
    2067           </xsl:for-each>
    2068         </xsl:variable>
    2069         <xsl:choose>
    2070           <xsl:when test="@format='counter'">
    2071             <xsl:value-of select="$tcnt" />
    2072           </xsl:when>
    2073           <xsl:when test="@format='title'">
    2074             <xsl:value-of select="$node/@title" />
    2075           </xsl:when>
    2076           <xsl:otherwise>
    2077             <xsl:value-of select="normalize-space(concat('Paragraph&#160;',substring-after($tcnt,'p.')))"/>
    2078           </xsl:otherwise>
    2079         </xsl:choose>
    2080       </a>
    2081     </xsl:when>
    2082 
    2083     <!-- Comment links -->
    2084     <xsl:when test="$node/self::cref">
    2085       <a href="#{$target}">
    2086         <xsl:variable name="name">
    2087           <xsl:for-each select="$node">
    2088             <xsl:call-template name="get-comment-name" />
    2089           </xsl:for-each>
    2090         </xsl:variable>
    2091         <xsl:choose>
    2092           <xsl:when test="@format='counter'">
    2093             <xsl:value-of select="$name" />
    2094           </xsl:when>
    2095           <xsl:when test="@format='title'">
    2096             <xsl:value-of select="$node/@title" />
    2097           </xsl:when>
    2098           <xsl:otherwise>
    2099             <xsl:value-of select="normalize-space(concat('Comment&#160;',$name))"/>
    2100           </xsl:otherwise>
    2101         </xsl:choose>
    2102       </a>
    2103     </xsl:when>
    2104 
    2105     <!-- Reference links -->
    2106     <xsl:when test="$node/self::reference">
    2107 
    2108       <xsl:variable name="href">
    2109         <xsl:call-template name="computed-target">
    2110           <xsl:with-param name="bib" select="$node"/>
    2111           <xsl:with-param name="ref" select="."/>
    2112         </xsl:call-template>
    2113       </xsl:variable>
    2114      
    2115       <xsl:variable name="sec">
    2116         <xsl:choose>
    2117           <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
    2118             <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
    2119             <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after(current()/@x:rel,'#')]"/>
    2120             <xsl:if test="not($nodes)">
    2121               <xsl:call-template name="error">
    2122                 <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>
    2123               </xsl:call-template>
    2124             </xsl:if>
    2125             <xsl:for-each select="$nodes">
    2126               <xsl:call-template name="get-section-number"/>
    2127             </xsl:for-each>
    2128           </xsl:when>
    2129           <xsl:otherwise>
    2130             <xsl:value-of select="@x:sec"/>
    2131           </xsl:otherwise>
    2132         </xsl:choose>
    2133       </xsl:variable>
    2134      
    2135       <xsl:variable name="secterm">
    2136         <xsl:choose>
    2137           <!-- starts with letter? -->
    2138           <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
    2139           <xsl:otherwise>Section</xsl:otherwise>
    2140         </xsl:choose>
    2141       </xsl:variable>
    2142 
    2143       <xsl:variable name="fmt">
    2144         <xsl:choose>
    2145           <xsl:when test="@x:fmt!=''"><xsl:value-of select="@x:fmt"/></xsl:when>
    2146           <xsl:when test="ancestor::artwork">,</xsl:when>
    2147           <xsl:otherwise>of</xsl:otherwise>
    2148         </xsl:choose>
    2149       </xsl:variable>
    2150 
    2151       <xsl:variable name="title">
    2152         <xsl:choose>
    2153           <xsl:when test="starts-with(@x:rel,'#') and not(@x:sec) and $node/x:source/@href">
    2154             <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
    2155             <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after(current()/@x:rel,'#')]"/>
    2156             <xsl:if test="not($nodes)">
    2157               <xsl:call-template name="error">
    2158                 <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>
    2159               </xsl:call-template>
    2160             </xsl:if>
    2161             <xsl:for-each select="$nodes">
    2162               <xsl:value-of select="@title"/>
    2163             </xsl:for-each>
    2164           </xsl:when>
    2165           <xsl:otherwise />
    2166         </xsl:choose>
    2167       </xsl:variable>
    2168 
    2169       <!--
    2170       Formats:
    2171      
    2172         ()      [XXXX] (Section SS)
    2173         ,       [XXXX], Section SS
    2174         of      Section SS of [XXXX]
    2175         sec     Section SS
    2176         number  SS
    2177       -->
    2178      
    2179       <xsl:if test="$fmt and not($fmt='()' or $fmt=',' or $fmt='of' or $fmt='sec' or $fmt='anchor' or $fmt='number')">
    2180         <xsl:call-template name="error">
    2181           <xsl:with-param name="msg" select="concat('unknown xref/@x:fmt extension: ',$fmt)"/>
    2182         </xsl:call-template>
    2183       </xsl:if>
    2184 
    2185       <xsl:if test="$sec!=''">
    2186              
    2187         <xsl:choose>
    2188           <xsl:when test="$fmt='of' or $fmt='sec'">
    2189             <xsl:choose>
    2190               <xsl:when test="$href!=''">
    2191                 <a href="{$href}">
    2192                   <xsl:if test="$title!=''">
    2193                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    2194                   </xsl:if>
    2195                   <xsl:if test="$fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
    2196                     <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    2197                   </xsl:if>
    2198                   <xsl:value-of select="$secterm"/>
    2199                   <xsl:text> </xsl:text>
    2200                   <xsl:value-of select="$sec"/>
    2201                 </a>
    2202               </xsl:when>
    2203               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    2204             </xsl:choose>
    2205             <xsl:if test="$fmt='of'">
    2206               <xsl:text> of </xsl:text>
    2207             </xsl:if>
    2208           </xsl:when>
    2209           <xsl:when test="$fmt='number'">
    2210             <xsl:choose>
    2211               <xsl:when test="$href!=''">
    2212                 <a href="{$href}">
    2213                   <xsl:if test="$title!=''">
    2214                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    2215                   </xsl:if>
    2216                   <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
    2217                     <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    2218                   </xsl:if>
    2219                   <xsl:value-of select="$sec"/>
    2220                 </a>
    2221               </xsl:when>
    2222               <xsl:otherwise><xsl:value-of select="$sec"/></xsl:otherwise>
    2223             </xsl:choose>
    2224           </xsl:when>
    2225           <xsl:otherwise />
    2226         </xsl:choose>
    2227       </xsl:if>
    2228 
    2229       <xsl:if test="$sec='' or ($fmt!='sec' and $fmt!='number')">
    2230         <a href="#{$target}">
    2231           <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2127      <!-- Section links -->
     2128      <xsl:when test="$node/self::section or $node/self::appendix">
     2129        <a href="#{$xref/@target}">
     2130          <!-- insert id when a backlink to this xref is needed in the index -->
     2131          <xsl:if test="key('iref-xanch',$xref/@target) | key('iref-xanch','')[../@anchor=$xref/@target]">
    22322132            <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    22332133          </xsl:if>
    2234           <cite title="{normalize-space($node/front/title)}">
    2235             <xsl:variable name="val">
    2236               <xsl:call-template name="referencename">
    2237                 <xsl:with-param name="node" select="$node" />
    2238               </xsl:call-template>
    2239             </xsl:variable>
    2240             <xsl:choose>
    2241               <xsl:when test="$fmt='anchor'">
    2242                 <!-- remove brackets -->
    2243                 <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
    2244               </xsl:when>
    2245               <xsl:otherwise>
    2246                 <xsl:value-of select="$val"/>
    2247               </xsl:otherwise>
    2248             </xsl:choose>
    2249           </cite>
     2134          <xsl:call-template name="render-section-ref">
     2135            <xsl:with-param name="from" select="$xref"/>
     2136            <xsl:with-param name="to" select="$node"/>
     2137          </xsl:call-template>
    22502138        </a>
    2251       </xsl:if>
     2139      </xsl:when>
     2140 
     2141      <!-- Figure links -->
     2142      <xsl:when test="$node/self::figure">
     2143        <a href="#{$xref/@target}">
     2144          <xsl:variable name="figcnt">
     2145            <xsl:for-each select="$node">
     2146              <xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
     2147            </xsl:for-each>
     2148          </xsl:variable>
     2149          <xsl:choose>
     2150            <xsl:when test="$xref/@format='counter'">
     2151              <xsl:value-of select="$figcnt" />
     2152            </xsl:when>
     2153            <xsl:when test="$xref/@format='title'">
     2154              <xsl:value-of select="$node/@title" />
     2155            </xsl:when>
     2156            <xsl:otherwise>
     2157              <xsl:value-of select="normalize-space(concat('Figure&#160;',$figcnt))"/>
     2158            </xsl:otherwise>
     2159          </xsl:choose>
     2160        </a>
     2161      </xsl:when>
    22522162     
    2253       <xsl:if test="$sec!=''">
    2254         <xsl:choose>
    2255           <xsl:when test="$fmt='()'">
    2256             <xsl:text> (</xsl:text>
    2257             <xsl:choose>
    2258               <xsl:when test="$href!=''">
    2259                 <a href="{$href}"><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></a>
    2260               </xsl:when>
    2261               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    2262             </xsl:choose>
    2263             <xsl:text>)</xsl:text>
    2264           </xsl:when>
    2265           <xsl:when test="$fmt=','">
    2266             <xsl:text>, </xsl:text>
    2267             <xsl:choose>
    2268               <xsl:when test="$href!=''">
    2269                 <a href="{$href}">
    2270                   <xsl:if test="$title!=''">
    2271                     <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
    2272                   </xsl:if>
    2273                   <xsl:value-of select="$secterm"/>
    2274                   <xsl:text> </xsl:text>
    2275                   <xsl:value-of select="$sec"/>
    2276                 </a>
    2277               </xsl:when>
    2278               <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
    2279             </xsl:choose>
    2280           </xsl:when>
    2281           <xsl:otherwise/>
    2282         </xsl:choose>
    2283       </xsl:if>
    2284     </xsl:when>
    2285    
    2286     <xsl:otherwise>
    2287       <xsl:call-template name="error">
    2288         <xsl:with-param name="msg" select="concat('xref to unknown element: ',name($node))"/>
    2289       </xsl:call-template>
    2290     </xsl:otherwise>
    2291   </xsl:choose>
     2163      <!-- Table links -->
     2164      <xsl:when test="$node/self::texttable">
     2165        <a href="#{$xref/@target}">
     2166          <xsl:variable name="tabcnt">
     2167            <xsl:for-each select="$node">
     2168              <xsl:number level="any" count="texttable[(@title!='' or @anchor!='') and not(@suppress-title='true')]" />
     2169            </xsl:for-each>
     2170          </xsl:variable>
     2171          <xsl:choose>
     2172            <xsl:when test="$xref/@format='counter'">
     2173              <xsl:value-of select="$tabcnt" />
     2174            </xsl:when>
     2175            <xsl:when test="$xref/@format='title'">
     2176              <xsl:value-of select="$node/@title" />
     2177            </xsl:when>
     2178            <xsl:otherwise>
     2179              <xsl:value-of select="normalize-space(concat('Table&#160;',$tabcnt))"/>
     2180            </xsl:otherwise>
     2181          </xsl:choose>
     2182        </a>
     2183      </xsl:when>
     2184     
     2185      <!-- Paragraph links -->
     2186      <xsl:when test="$node/self::t">
     2187        <a href="#{$xref/@target}">
     2188          <xsl:variable name="tcnt">
     2189            <xsl:for-each select="$node">
     2190              <xsl:call-template name="get-paragraph-number" />
     2191            </xsl:for-each>
     2192          </xsl:variable>
     2193          <xsl:choose>
     2194            <xsl:when test="$xref/@format='counter'">
     2195              <xsl:value-of select="$tcnt" />
     2196            </xsl:when>
     2197            <xsl:when test="$xref/@format='title'">
     2198              <xsl:value-of select="$node/@title" />
     2199            </xsl:when>
     2200            <xsl:otherwise>
     2201              <xsl:value-of select="normalize-space(concat('Paragraph&#160;',substring-after($tcnt,'p.')))"/>
     2202            </xsl:otherwise>
     2203          </xsl:choose>
     2204        </a>
     2205      </xsl:when>
     2206 
     2207      <!-- Comment links -->
     2208      <xsl:when test="$node/self::cref">
     2209        <a href="#{$xref/@target}">
     2210          <xsl:variable name="name">
     2211            <xsl:for-each select="$node">
     2212              <xsl:call-template name="get-comment-name" />
     2213            </xsl:for-each>
     2214          </xsl:variable>
     2215          <xsl:choose>
     2216            <xsl:when test="$xref/@format='counter'">
     2217              <xsl:value-of select="$name" />
     2218            </xsl:when>
     2219            <xsl:when test="$xref/@format='title'">
     2220              <xsl:value-of select="$node/@title" />
     2221            </xsl:when>
     2222            <xsl:otherwise>
     2223              <xsl:value-of select="normalize-space(concat('Comment&#160;',$name))"/>
     2224            </xsl:otherwise>
     2225          </xsl:choose>
     2226        </a>
     2227      </xsl:when>
     2228 
     2229      <!-- Reference links -->
     2230      <xsl:when test="$node/self::reference">
     2231 
     2232        <xsl:variable name="href">
     2233          <xsl:call-template name="computed-target">
     2234            <xsl:with-param name="bib" select="$node"/>
     2235            <xsl:with-param name="ref" select="$xref"/>
     2236          </xsl:call-template>
     2237        </xsl:variable>
     2238       
     2239        <xsl:variable name="sec">
     2240          <xsl:choose>
     2241            <xsl:when test="starts-with($xref/@x:rel,'#') and not($xref/@x:sec) and $node/x:source/@href">
     2242              <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
     2243              <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after($xref/@x:rel,'#')]"/>
     2244              <xsl:if test="not($nodes)">
     2245                <xsl:call-template name="error">
     2246                  <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>
     2247                </xsl:call-template>
     2248              </xsl:if>
     2249              <xsl:for-each select="$nodes">
     2250                <xsl:call-template name="get-section-number"/>
     2251              </xsl:for-each>
     2252            </xsl:when>
     2253            <xsl:otherwise>
     2254              <xsl:value-of select="$xref/@x:sec"/>
     2255            </xsl:otherwise>
     2256          </xsl:choose>
     2257        </xsl:variable>
     2258       
     2259        <xsl:variable name="secterm">
     2260          <xsl:choose>
     2261            <!-- starts with letter? -->
     2262            <xsl:when test="translate(substring($sec,1,1),$ucase,'')=''">Appendix</xsl:when>
     2263            <xsl:otherwise>Section</xsl:otherwise>
     2264          </xsl:choose>
     2265        </xsl:variable>
     2266 
     2267        <xsl:variable name="fmt">
     2268          <xsl:choose>
     2269            <xsl:when test="$xref/@x:fmt!=''"><xsl:value-of select="$xref/@x:fmt"/></xsl:when>
     2270            <xsl:when test="$xref/ancestor::artwork">,</xsl:when>
     2271            <xsl:otherwise>of</xsl:otherwise>
     2272          </xsl:choose>
     2273        </xsl:variable>
     2274 
     2275        <xsl:variable name="title">
     2276          <xsl:choose>
     2277            <xsl:when test="starts-with($xref/@x:rel,'#') and not($xref/@x:sec) and $node/x:source/@href">
     2278              <xsl:variable name="extdoc" select="document($node/x:source/@href)"/>
     2279              <xsl:variable name="nodes" select="$extdoc//*[@anchor=substring-after($xref//@x:rel,'#')]"/>
     2280              <xsl:if test="not($nodes)">
     2281                <xsl:call-template name="error">
     2282                  <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>
     2283                </xsl:call-template>
     2284              </xsl:if>
     2285              <xsl:for-each select="$nodes">
     2286                <xsl:value-of select="@title"/>
     2287              </xsl:for-each>
     2288            </xsl:when>
     2289            <xsl:otherwise />
     2290          </xsl:choose>
     2291        </xsl:variable>
     2292 
     2293        <!--
     2294        Formats:
     2295       
     2296          ()      [XXXX] (Section SS)
     2297          ,       [XXXX], Section SS
     2298          of      Section SS of [XXXX]
     2299          sec     Section SS
     2300          number  SS
     2301        -->
     2302       
     2303        <xsl:if test="$fmt and not($fmt='()' or $fmt=',' or $fmt='of' or $fmt='sec' or $fmt='anchor' or $fmt='number')">
     2304          <xsl:call-template name="error">
     2305            <xsl:with-param name="msg" select="concat('unknown xref/@x:fmt extension: ',$fmt)"/>
     2306          </xsl:call-template>
     2307        </xsl:if>
     2308 
     2309        <xsl:if test="$sec!=''">
     2310               
     2311          <xsl:choose>
     2312            <xsl:when test="$fmt='of' or $fmt='sec'">
     2313              <xsl:choose>
     2314                <xsl:when test="$href!=''">
     2315                  <a href="{$href}">
     2316                    <xsl:if test="$title!=''">
     2317                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2318                    </xsl:if>
     2319                    <xsl:if test="$fmt='sec' and $xml2rfc-ext-include-references-in-index='yes'">
     2320                      <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2321                    </xsl:if>
     2322                    <xsl:value-of select="$secterm"/>
     2323                    <xsl:text> </xsl:text>
     2324                    <xsl:value-of select="$sec"/>
     2325                  </a>
     2326                </xsl:when>
     2327                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2328              </xsl:choose>
     2329              <xsl:if test="$fmt='of'">
     2330                <xsl:text> of </xsl:text>
     2331              </xsl:if>
     2332            </xsl:when>
     2333            <xsl:when test="$fmt='number'">
     2334              <xsl:choose>
     2335                <xsl:when test="$href!=''">
     2336                  <a href="{$href}">
     2337                    <xsl:if test="$title!=''">
     2338                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2339                    </xsl:if>
     2340                    <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2341                      <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2342                    </xsl:if>
     2343                    <xsl:value-of select="$sec"/>
     2344                  </a>
     2345                </xsl:when>
     2346                <xsl:otherwise><xsl:value-of select="$sec"/></xsl:otherwise>
     2347              </xsl:choose>
     2348            </xsl:when>
     2349            <xsl:otherwise />
     2350          </xsl:choose>
     2351        </xsl:if>
     2352 
     2353        <xsl:if test="$sec='' or ($fmt!='sec' and $fmt!='number')">
     2354          <a href="#{$xref/@target}">
     2355            <xsl:if test="$xml2rfc-ext-include-references-in-index='yes'">
     2356              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     2357            </xsl:if>
     2358            <cite title="{normalize-space($node/front/title)}">
     2359              <xsl:variable name="val">
     2360                <xsl:call-template name="referencename">
     2361                  <xsl:with-param name="node" select="$node" />
     2362                </xsl:call-template>
     2363              </xsl:variable>
     2364              <xsl:choose>
     2365                <xsl:when test="$fmt='anchor'">
     2366                  <!-- remove brackets -->
     2367                  <xsl:value-of select="substring($val,2,string-length($val)-2)"/>
     2368                </xsl:when>
     2369                <xsl:otherwise>
     2370                  <xsl:value-of select="$val"/>
     2371                </xsl:otherwise>
     2372              </xsl:choose>
     2373            </cite>
     2374          </a>
     2375        </xsl:if>
     2376       
     2377        <xsl:if test="$sec!=''">
     2378          <xsl:choose>
     2379            <xsl:when test="$fmt='()'">
     2380              <xsl:text> (</xsl:text>
     2381              <xsl:choose>
     2382                <xsl:when test="$href!=''">
     2383                  <a href="{$href}"><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></a>
     2384                </xsl:when>
     2385                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2386              </xsl:choose>
     2387              <xsl:text>)</xsl:text>
     2388            </xsl:when>
     2389            <xsl:when test="$fmt=','">
     2390              <xsl:text>, </xsl:text>
     2391              <xsl:choose>
     2392                <xsl:when test="$href!=''">
     2393                  <a href="{$href}">
     2394                    <xsl:if test="$title!=''">
     2395                      <xsl:attribute name="title"><xsl:value-of select="$title"/></xsl:attribute>
     2396                    </xsl:if>
     2397                    <xsl:value-of select="$secterm"/>
     2398                    <xsl:text> </xsl:text>
     2399                    <xsl:value-of select="$sec"/>
     2400                  </a>
     2401                </xsl:when>
     2402                <xsl:otherwise><xsl:value-of select="$secterm"/><xsl:text> </xsl:text><xsl:value-of select="$sec"/></xsl:otherwise>
     2403              </xsl:choose>
     2404            </xsl:when>
     2405            <xsl:otherwise/>
     2406          </xsl:choose>
     2407        </xsl:if>
     2408      </xsl:when>
     2409     
     2410      <xsl:otherwise>
     2411        <xsl:call-template name="error">
     2412          <xsl:with-param name="msg" select="concat('xref to unknown element: ',name($node))"/>
     2413        </xsl:call-template>
     2414      </xsl:otherwise>
     2415    </xsl:choose>
     2416  </xsl:for-each>
    22922417</xsl:template>
    22932418
     
    23112436  <xsl:param name="mode" />
    23122437  <!-- default case -->
    2313   <xsl:if test="not($xml2rfc-private)">
     2438  <xsl:if test="$xml2rfc-private=''">
    23142439    <xsl:choose>
    23152440      <xsl:when test="/rfc/front/workgroup">
     
    23802505   
    23812506  <!-- private case -->
    2382   <xsl:if test="$xml2rfc-private">
     2507  <xsl:if test="$xml2rfc-private!=''">
    23832508    <myns:item><xsl:value-of select="$xml2rfc-private" /></myns:item>
    23842509  </xsl:if>
     
    24822607      <xsl:call-template name="normalize-date">
    24832608        <xsl:with-param name="year" select="$xml2rfc-ext-pub-year"/>
    2484         <xsl:with-param name="month" select="$xml2rfc-ext-pub-month-numeric"/>
     2609        <xsl:with-param name="month" select="$pub-month-numeric"/>
    24852610        <xsl:with-param name="day" select="$xml2rfc-ext-pub-day + 185"/>
    24862611      </xsl:call-template>
     
    26352760          <t>
    26362761            <xsl:choose>
    2637               <xsl:when test="$ipr-2007-08"/>
    26382762              <xsl:when test="$ipr-rfc4748">
    26392763                Copyright &#169; The IETF Trust (<xsl:value-of select="$xml2rfc-ext-pub-year" />).
     
    28022926
    28032927<xsl:template name="insertCss">
     2928<style type="text/css" title="Xml2Rfc (sans serif)">
    28042929a {
    28052930  text-decoration: none;
     
    29083033  background-color: lightyellow;
    29093034  padding: .25em;
    2910 }
     3035}<xsl:if test="//artwork[@x:isCodeComponent='yes']"><!-- support "<CODE BEGINS>" and "<CODE ENDS>" markers-->
     3036pre.ccmarker {
     3037  background-color: white;
     3038  color: gray;
     3039}
     3040pre.ccmarker > span {
     3041  font-size: small;
     3042}
     3043pre.cct {
     3044  margin-bottom: -1em;
     3045}
     3046pre.ccb {
     3047  margin-top: -1em;
     3048}</xsl:if>
    29113049pre.text2 {
    29123050  border-style: dotted;
     
    32313369  }
    32323370</xsl:if>}
    3233 
     3371<xsl:choose><xsl:when test="$xml2rfc-ext-duplex='yes'">
     3372@page:right {
     3373  @top-left {
     3374       content: "<xsl:call-template name="get-header-left"/>";
     3375  }
     3376  @top-right {
     3377       content: "<xsl:call-template name="get-header-right"/>";
     3378  }
     3379  @top-center {
     3380       content: "<xsl:call-template name="get-header-center"/>";
     3381  }
     3382  @bottom-left {
     3383       content: "<xsl:call-template name="get-author-summary"/>";
     3384  }
     3385  @bottom-center {
     3386       content: "<xsl:call-template name="get-category-long"/>";
     3387  }
     3388  @bottom-right {
     3389       content: "[Page " counter(page) "]";
     3390  }
     3391}
     3392@page:left {
     3393  @top-left {
     3394       content: "<xsl:call-template name="get-header-right"/>";
     3395  }
     3396  @top-right {
     3397       content: "<xsl:call-template name="get-header-left"/>";
     3398  }
     3399  @top-center {
     3400       content: "<xsl:call-template name="get-header-center"/>";
     3401  }
     3402  @bottom-left {
     3403       content: "[Page " counter(page) "]";
     3404  }
     3405  @bottom-center {
     3406       content: "<xsl:call-template name="get-category-long"/>";
     3407  }
     3408  @bottom-right {
     3409       content: "<xsl:call-template name="get-author-summary"/>";
     3410  }
     3411}
     3412</xsl:when><xsl:otherwise>
    32343413@page {
    32353414  @top-left {
     
    32523431  }
    32533432}
    3254 
     3433</xsl:otherwise></xsl:choose>
    32553434@page:first {
    32563435    @top-left {
     
    32643443    }
    32653444}
     3445</style>
    32663446</xsl:template>
    32673447
     
    36193799</xsl:template>
    36203800
    3621 
    3622 
    3623 
    36243801<xsl:template name="insertPreamble" myns:namespaceless-elements="xml2rfc">
     3802
     3803  <xsl:variable name="escapeclause">
     3804    This document may contain material from IETF Documents or IETF Contributions published or
     3805    made publicly available before November 10, 2008. The person(s) controlling the copyright in
     3806    some of this material may not have granted the IETF Trust the right to allow modifications of such
     3807    material outside the IETF Standards Process. Without obtaining an adequate license from the
     3808    person(s) controlling the copyright in such materials, this document may not be modified outside
     3809    the IETF Standards Process, and derivative works of it may not be created outside the IETF
     3810    Standards Process, except to format it for publication as an RFC or to translate it into languages
     3811    other than English.
     3812  </xsl:variable>
    36253813
    36263814  <section myns:unnumbered="unnumbered" myns:notoclink="notoclink" anchor="{$anchor-prefix}.status">
     
    36803868            translate it into languages other than English<xsl:if test="/rfc/@iprExtract">,
    36813869            other than to extract <xref target="{/rfc/@iprExtract}"/> as-is
    3682             for separate use.</xsl:if>.
     3870            for separate use</xsl:if>.
    36833871          </xsl:when>
    36843872          <xsl:when test="/rfc/@ipr = 'noDerivatives3667'">
     
    36913879            document may not be modified, and derivative works of it may
    36923880            not be created<xsl:if test="/rfc/@iprExtract">, other than to extract
    3693             <xref target="{/rfc/@iprExtract}"/> as-is for separate use.</xsl:if>.
     3881            <xref target="{/rfc/@iprExtract}"/> as-is for separate use</xsl:if>.
    36943882          </xsl:when>
    36953883         
     
    37113899            translate it into languages other than English<xsl:if test="/rfc/@iprExtract">,
    37123900            other than to extract <xref target="{/rfc/@iprExtract}"/> as-is
    3713             for separate use.</xsl:if>.
     3901            for separate use</xsl:if>.
    37143902          </xsl:when>
    37153903          <xsl:when test="/rfc/@ipr = 'noDerivatives3978'">
     
    37203908            document may not be modified, and derivative works of it may
    37213909            not be created<xsl:if test="/rfc/@iprExtract">, other than to extract
    3722             <xref target="{/rfc/@iprExtract}"/> as-is for separate use.</xsl:if>.
     3910            <xref target="{/rfc/@iprExtract}"/> as-is for separate use</xsl:if>.
    37233911          </xsl:when>
    37243912 
    3725           <!-- as of Nov 2008 -->
     3913          <!-- as of Nov 2008, Feb 2009 and Sep 2009 -->
    37263914          <xsl:when test="/rfc/@ipr = 'trust200811'
    37273915                          or /rfc/@ipr = 'noModificationTrust200811'
    3728                           or  /rfc/@ipr = 'noDerivativesTrust200811'">
    3729             This Internet-Draft is submitted to IETF pursuant to, and in full
    3730             conformance with, the provisions of BCP 78 and BCP 79.
    3731           </xsl:when>
    3732  
    3733           <!-- as of Feb 2009 -->
    3734           <xsl:when test="/rfc/@ipr = 'trust200902'
     3916                          or /rfc/@ipr = 'noDerivativesTrust200811'
     3917                          or /rfc/@ipr = 'trust200902'
    37353918                          or /rfc/@ipr = 'noModificationTrust200902'
    37363919                          or /rfc/@ipr = 'noDerivativesTrust200902'
    37373920                          or /rfc/@ipr = 'pre5378Trust200902'">
    3738             This Internet-Draft is submitted to IETF pursuant to, and in full
    3739             conformance with, the provisions of BCP 78 and BCP 79.
     3921            This Internet-Draft is submitted to IETF in full conformance with
     3922            the provisions of BCP 78 and BCP 79.
    37403923          </xsl:when>
    3741           <xsl:when test="/rfc/@ipr = 'noModificationTrust200902'">
    3742             This document may not be modified, and derivative works of it may
    3743             not be created, except to format it for publication as an RFC or
    3744             to translate it into languages other than English.
    3745           </xsl:when>
    3746           <xsl:when test="/rfc/@ipr = 'noDerivativesTrust200902'">
    3747             This document may not be modified, and derivative works of it may
    3748             not be created, and it may not be published except as an Internet-Draft.
    3749           </xsl:when>
    3750           <xsl:when test="/rfc/@ipr = 'pre5378Trust200902'">
    3751             This document may contain material from IETF Documents or IETF Contributions published or
    3752             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3753             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3754             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3755             person(s) controlling the copyright in such materials, this document may not be modified outside
    3756             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3757             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3758             other than English.
    3759           </xsl:when>
    3760  
    37613924          <xsl:otherwise>
    37623925            CONFORMANCE UNDEFINED.
     
    37753938            not be created, and it may not be published except as an Internet-Draft.
    37763939          </xsl:when>
    3777 
    37783940          <xsl:when test="/rfc/@ipr = 'noModificationTrust200902'">
    37793941            This document may not be modified, and derivative works of it may
     
    37853947            not be created, and it may not be published except as an Internet-Draft.
    37863948          </xsl:when>
    3787           <xsl:when test="/rfc/@ipr = 'pre5378Trust200902'">
    3788             This document may contain material from IETF Documents or IETF Contributions published or
    3789             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3790             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3791             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3792             person(s) controlling the copyright in such materials, this document may not be modified outside
    3793             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3794             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3795             other than English.
     3949          <!-- escape clause moved to Copyright Notice as of 2009-12 -->
     3950          <xsl:when test="/rfc/@ipr = 'pre5378Trust200902' and $pub-yearmonth &lt; 200912">
     3951            <xsl:value-of select="$escapeclause"/>
    37963952          </xsl:when>
    37973953
     
    38764032        </t>
    38774033        <xsl:choose>
     4034          <xsl:when test="$ipr-2009-09">
     4035            <t>
     4036              This document is subject to BCP 78 and the IETF Trust's Legal
     4037              Provisions Relating to IETF Documents (<eref target="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</eref>)
     4038              in effect on the date of publication of this document. Please
     4039              review these documents carefully, as they describe your rights
     4040              and restrictions with respect to this document. Code Components
     4041              extracted from this document must include Simplified BSD License
     4042              text as described in Section 4.e of the Trust Legal Provisions
     4043              and are provided without warranty as described in the BSD License.
     4044            </t>
     4045          </xsl:when>
    38784046          <xsl:when test="$ipr-2009-02">
    38794047            <t>
     
    38994067       
    39004068        <!-- special case: RFC5378 escape applies to RFCs as well -->
    3901         <!-- currently only applied to RFCs, need to discuss for IDs -->
    3902         <xsl:if test="/rfc/@number and /rfc/@ipr = 'pre5378Trust200902'">
     4069        <!-- for IDs historically in Status Of This Memo, over here starting 2009-12 -->
     4070        <xsl:if test="(/rfc/@number or $pub-yearmonth >= 200912) and /rfc/@ipr = 'pre5378Trust200902'">
    39034071          <t>
    3904             This document may contain material from IETF Documents or IETF Contributions published or
    3905             made publicly available before November 10, 2008. The person(s) controlling the copyright in
    3906             some of this material may not have granted the IETF Trust the right to allow modifications of such
    3907             material outside the IETF Standards Process. Without obtaining an adequate license from the
    3908             person(s) controlling the copyright in such materials, this document may not be modified outside
    3909             the IETF Standards Process, and derivative works of it may not be created outside the IETF
    3910             Standards Process, except to format it for publication as an RFC or to translate it into languages
    3911             other than English.
     4072            <xsl:value-of select="$escapeclause"/>
    39124073          </t>
    39134074        </xsl:if>
     
    40394200
    40404201  <!-- copyright statements -->
    4041   <xsl:if test="not($xml2rfc-private) and not($no-copylong)">
     4202  <xsl:if test="$xml2rfc-private='' and not($no-copylong)">
    40424203    <li>
    40434204      <xsl:call-template name="insert-toc-line">
     
    40884249          <xsl:choose>
    40894250            <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    4090             <xsl:otherwise>References</xsl:otherwise>
     4251            <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    40914252          </xsl:choose>
    40924253        </xsl:variable>
     
    41114272          </xsl:with-param>
    41124273          <xsl:with-param name="target" select="concat($anchor-prefix,'.references')"/>
    4113           <xsl:with-param name="title" select="'References'"/>
     4274          <xsl:with-param name="title" select="$xml2rfc-refparent"/>
    41144275        </xsl:call-template>
    41154276 
     
    41204281              <xsl:choose>
    41214282                <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    4122                 <xsl:otherwise>References</xsl:otherwise>
     4283                <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    41234284              </xsl:choose>
    41244285            </xsl:variable>
     
    45984759
    45994760<xsl:template match="/" mode="cleanup-edits">
    4600         <xsl:copy><xsl:apply-templates select="node()" mode="cleanup-edits" /></xsl:copy>
     4761  <xsl:copy><xsl:apply-templates select="node()" mode="cleanup-edits" /></xsl:copy>
    46014762</xsl:template>
    46024763
     
    48124973  </xsl:variable>
    48134974 
    4814   <table summary="issue {@name}" class="{$class}">
     4975  <table class="{$class}">
    48154976    <tr>
    48164977      <td colspan="3">
     
    49555116
    49565117  <h2 id="{$anchor-prefix}.issues-list" ><a href="#{$anchor-prefix}.issues-list">Issues list</a></h2>
    4957   <table summary="Issues list">
     5118  <table>
    49585119    <thead>
    49595120      <tr>
     
    53465507                  </xsl:when>
    53475508                  <xsl:when test="$col/@align='left' or not($col/@align)">
    5348                     <!-- that's the default, nothing to do here -->
     5509                    <xsl:attribute name="class">left</xsl:attribute>
    53495510                  </xsl:when>
    53505511                  <xsl:otherwise>
    5351                     <xsl:message>Unknown align attribute on ttcol: <xsl:value-of select="$col/@align"/></xsl:message>
     5512                    <xsl:call-template name="warning">
     5513                      <xsl:with-param name="inline" select="'no'"/>
     5514                      <xsl:with-param name="msg">Unknown align attribute on ttcol: <xsl:value-of select="$col/@align"/></xsl:with-param>                     
     5515                    </xsl:call-template>
    53525516                  </xsl:otherwise>
    53535517                </xsl:choose>
     
    54195583          </a>
    54205584          <xsl:text>: </xsl:text>
    5421           <xsl:apply-templates select="text()|eref"/>
     5585          <xsl:apply-templates select="text()|eref|xref"/>
    54225586          <xsl:if test="@source"> --<xsl:value-of select="@source"/></xsl:if>
    54235587          <xsl:text>]</xsl:text>
     
    54265590          <xsl:attribute name="title">
    54275591            <xsl:if test="@source"><xsl:value-of select="@source"/>: </xsl:if>
    5428             <xsl:apply-templates select="text()|eref"/>
     5592            <xsl:apply-templates select="text()|eref|xref"/>
    54295593          </xsl:attribute>
    54305594          <xsl:text>[</xsl:text>
     
    55195683        <xsl:attribute name="title">
    55205684          <xsl:call-template name="get-references-section-number"/>
    5521           <xsl:text> References</xsl:text>
     5685          <xsl:text> </xsl:text>
     5686          <xsl:value-of select="$xml2rfc-refparent"/>
    55225687        </xsl:attribute>
    55235688      </xsl:otherwise>
     
    55445709<xsl:template name="get-category-long">
    55455710  <xsl:choose>
    5546     <xsl:when test="$xml2rfc-footer"><xsl:value-of select="$xml2rfc-footer" /></xsl:when>
    5547     <xsl:when test="$xml2rfc-private"/> <!-- private draft, footer not set -->
     5711    <xsl:when test="$xml2rfc-footer!=''"><xsl:value-of select="$xml2rfc-footer" /></xsl:when>
     5712    <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, footer not set -->
    55485713    <xsl:when test="/rfc/@category='bcp'">Best Current Practice</xsl:when>
    55495714    <xsl:when test="/rfc/@category='historic'">Historic</xsl:when>
     
    55685733<xsl:template name="get-header-left">
    55695734  <xsl:choose>
    5570     <xsl:when test="$xml2rfc-header"><xsl:value-of select="$xml2rfc-header" /></xsl:when>
    5571     <xsl:when test="$xml2rfc-private"/> <!-- private draft, header not set -->
     5735    <xsl:when test="$xml2rfc-header!=''"><xsl:value-of select="$xml2rfc-header" /></xsl:when>
     5736    <xsl:when test="$xml2rfc-private!=''"/> <!-- private draft, header not set -->
    55725737    <xsl:when test="/rfc/@ipr and not(/rfc/@number)">INTERNET DRAFT</xsl:when>
    55735738    <xsl:otherwise>RFC <xsl:value-of select="/rfc/@number"/></xsl:otherwise>
     
    55795744    <xsl:text>http://greenbytes.de/tech/webdav/rfc2629.xslt, </xsl:text>
    55805745    <!-- when RCS keyword substitution in place, add version info -->
    5581     <xsl:if test="contains('$Revision: 1.451 $',':')">
    5582       <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.451 $', 'Revision: '),'$','')),', ')" />
     5746    <xsl:if test="contains('$Revision: 1.475 $',':')">
     5747      <xsl:value-of select="concat('Revision ',normalize-space(translate(substring-after('$Revision: 1.475 $', 'Revision: '),'$','')),', ')" />
    55835748    </xsl:if>
    5584     <xsl:if test="contains('$Date: 2009-08-28 12:08:05 $',':')">
    5585       <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-08-28 12:08:05 $', 'Date: '),'$','')),', ')" />
     5749    <xsl:if test="contains('$Date: 2009-10-02 10:40:00 $',':')">
     5750      <xsl:value-of select="concat(normalize-space(translate(substring-after('$Date: 2009-10-02 10:40:00 $', 'Date: '),'$','')),', ')" />
    55865751    </xsl:if>
    55875752    <xsl:value-of select="concat('XSLT vendor: ',system-property('xsl:vendor'),' ',system-property('xsl:vendor-url'))" />
     
    57235888</xsl:template>
    57245889
     5890<xsl:template name="extract-normalized">
     5891  <xsl:param name="node"/>
     5892  <xsl:param name="name"/>
     5893  <xsl:variable name="text" select="normalize-space($node)"/>
     5894  <xsl:if test="string-length($node) != string-length($text)">
     5895    <xsl:call-template name="warning">
     5896      <xsl:with-param name="inline" select="'no'"/>
     5897      <xsl:with-param name="msg">excessive whitespace in <xsl:value-of select="$name"/>: '<xsl:value-of select="$node"/>'</xsl:with-param>
     5898    </xsl:call-template>
     5899  </xsl:if>
     5900  <xsl:value-of select="$text"/>
     5901</xsl:template>
     5902
    57255903<!-- checking for email element -->
    57265904<xsl:template name="extract-email">
     
    57895967</xsl:template>
    57905968
     5969<!-- parsing of processing instructions -->
     5970<xsl:template name="parse-pis">
     5971  <xsl:param name="nodes"/>
     5972  <xsl:param name="attr"/>
     5973  <xsl:param name="sep"/>
     5974  <xsl:param name="ret"/>
     5975  <xsl:param name="default"/>
     5976 
     5977  <xsl:choose>
     5978    <xsl:when test="count($nodes)=0">
     5979      <xsl:choose>
     5980        <xsl:when test="$ret!=''">
     5981          <xsl:value-of select="$ret"/>
     5982        </xsl:when>
     5983        <xsl:otherwise>
     5984          <xsl:value-of select="$default"/>
     5985        </xsl:otherwise>   
     5986      </xsl:choose>
     5987    </xsl:when>
     5988    <xsl:otherwise>
     5989      <xsl:variable name="ret2">
     5990        <xsl:for-each select="$nodes[1]">
     5991          <xsl:call-template name="parse-one-pi">
     5992            <xsl:with-param name="str" select="."/>
     5993            <xsl:with-param name="attr" select="$attr"/>
     5994            <xsl:with-param name="sep" select="$sep"/>
     5995            <xsl:with-param name="ret" select="$ret"/>
     5996          </xsl:call-template>
     5997        </xsl:for-each>
     5998      </xsl:variable>
     5999     
     6000      <xsl:call-template name="parse-pis">
     6001        <xsl:with-param name="nodes" select="$nodes[position()!=1]"/>
     6002        <xsl:with-param name="attr" select="$attr"/>
     6003        <xsl:with-param name="sep" select="$sep"/>
     6004        <xsl:with-param name="ret" select="$ret2"/>
     6005        <xsl:with-param name="default" select="$default"/>
     6006      </xsl:call-template>
     6007     
     6008    </xsl:otherwise>
     6009  </xsl:choose>
     6010
     6011</xsl:template>
     6012
     6013<xsl:template name="parse-one-pi">
     6014  <xsl:param name="str"/>
     6015  <xsl:param name="attr"/>
     6016  <xsl:param name="sep"/>
     6017  <xsl:param name="ret"/>
     6018
     6019  <xsl:variable name="str2">
     6020    <xsl:call-template name="eat-leading-whitespace">
     6021      <xsl:with-param name="str" select="$str"/>
     6022    </xsl:call-template>
     6023  </xsl:variable>
     6024 
     6025  <xsl:choose>
     6026    <xsl:when test="$str2=''">
     6027      <!-- done -->
     6028      <xsl:value-of select="$ret"/>
     6029    </xsl:when>
     6030    <xsl:otherwise>
     6031      <xsl:variable name="attrname" select="substring-before($str2,'=')"/>
     6032     
     6033      <xsl:choose>
     6034        <xsl:when test="$attrname=''">
     6035          <xsl:call-template name="warning">
     6036            <xsl:with-param name="msg">bad PI syntax: <xsl:value-of select="$str2"/></xsl:with-param>
     6037            <xsl:with-param name="inline" select="'no'"/>
     6038          </xsl:call-template>
     6039          <xsl:value-of select="$ret"/>
     6040        </xsl:when>
     6041        <xsl:otherwise>
     6042          <xsl:variable name="remainder" select="substring($str2,2+string-length($attrname))"/>
     6043          <xsl:choose>
     6044            <xsl:when test="string-length($remainder) &lt; 2">
     6045              <xsl:call-template name="warning">
     6046                <xsl:with-param name="msg">bad PI value syntax: <xsl:value-of select="$remainder"/></xsl:with-param>
     6047                <xsl:with-param name="inline" select="'no'"/>
     6048              </xsl:call-template>
     6049              <xsl:value-of select="$ret"/>
     6050            </xsl:when>
     6051            <xsl:otherwise>
     6052              <xsl:variable name="rem">
     6053                <xsl:call-template name="eat-leading-whitespace">
     6054                  <xsl:with-param name="str" select="$remainder"/>
     6055                </xsl:call-template>
     6056              </xsl:variable>
     6057              <xsl:variable name="qchars">&apos;&quot;</xsl:variable>
     6058              <xsl:variable name="qchar" select="substring($rem,1,1)"/>
     6059              <xsl:variable name="rem2" select="substring($rem,2)"/>
     6060              <xsl:choose>
     6061                <xsl:when test="not(contains($qchars,$qchar))">
     6062                  <xsl:call-template name="warning">
     6063                    <xsl:with-param name="msg">pseudo-attribute value needs to be quoted: <xsl:value-of select="$rem"/></xsl:with-param>
     6064                    <xsl:with-param name="inline" select="'no'"/>
     6065                  </xsl:call-template>
     6066                  <xsl:value-of select="$ret"/>
     6067                </xsl:when>
     6068                <xsl:when test="not(contains($rem2,$qchar))">
     6069                  <xsl:call-template name="warning">
     6070                    <xsl:with-param name="msg">unmatched quote in: <xsl:value-of select="$rem2"/></xsl:with-param>
     6071                    <xsl:with-param name="inline" select="'no'"/>
     6072                  </xsl:call-template>
     6073                  <xsl:value-of select="$ret"/>
     6074                </xsl:when>
     6075                <xsl:otherwise>
     6076                  <xsl:variable name="value" select="substring-before($rem2,$qchar)"/>
     6077
     6078                  <!-- check pseudo-attribute names -->
     6079                  <xsl:if test="name()='rfc-ext' and $attr='SANITYCHECK'">
     6080                    <xsl:choose>
     6081                      <xsl:when test="$attrname='allow-markup-in-artwork'"/>
     6082                      <xsl:when test="$attrname='authors-section'"/>
     6083                      <xsl:when test="$attrname='duplex'"/>
     6084                      <xsl:when test="$attrname='include-references-in-index'"/>
     6085                      <xsl:when test="$attrname='justification'"/>
     6086                      <xsl:when test="$attrname='parse-xml-in-artwork'"/>
     6087                      <xsl:when test="$attrname='sec-no-trailing-dots'"/>
     6088                      <xsl:otherwise>
     6089                        <xsl:call-template name="warning">
     6090                          <xsl:with-param name="msg">unsupported rfc-ext pseudo-attribute '<xsl:value-of select="$attrname"/>'</xsl:with-param>
     6091                          <xsl:with-param name="inline" select="'no'"/>
     6092                        </xsl:call-template>
     6093                      </xsl:otherwise>
     6094                    </xsl:choose>
     6095                  </xsl:if>
     6096                 
     6097                  <xsl:choose>
     6098                    <xsl:when test="$attrname != $attr">
     6099                      <!-- pseudo-attr does not match, continue -->
     6100                      <xsl:call-template name="parse-one-pi">
     6101                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     6102                        <xsl:with-param name="attr" select="$attr"/>
     6103                        <xsl:with-param name="sep" select="$sep"/>
     6104                        <xsl:with-param name="ret" select="$ret"/>
     6105                      </xsl:call-template>
     6106                    </xsl:when>
     6107                    <xsl:when test="$sep='' and $ret!=''">
     6108                      <!-- pseudo-attr does match, but we only want one value -->
     6109                      <xsl:if test="$ret != $value">
     6110                        <xsl:call-template name="warning">
     6111                          <xsl:with-param name="msg">duplicate pseudo-attribute <xsl:value-of select="$attr"/>, overwriting value <xsl:value-of select="$ret"/></xsl:with-param>
     6112                          <xsl:with-param name="inline" select="'no'"/>
     6113                        </xsl:call-template>
     6114                      </xsl:if>
     6115                      <xsl:call-template name="parse-one-pi">
     6116                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     6117                        <xsl:with-param name="attr" select="$attr"/>
     6118                        <xsl:with-param name="sep" select="$sep"/>
     6119                        <xsl:with-param name="ret" select="$value"/>
     6120                      </xsl:call-template>
     6121                    </xsl:when>
     6122                    <xsl:otherwise>
     6123                      <!-- pseudo-attr does match -->
     6124                      <xsl:call-template name="parse-one-pi">
     6125                        <xsl:with-param name="str" select="substring($rem2, 2 + string-length($value))"/>
     6126                        <xsl:with-param name="attr" select="$attr"/>
     6127                        <xsl:with-param name="sep" select="$sep"/>
     6128                        <xsl:with-param name="ret">
     6129                          <xsl:choose> 
     6130                            <xsl:when test="$ret!=''">
     6131                              <xsl:value-of select="concat($ret,$sep,$value)"/>
     6132                            </xsl:when>
     6133                            <xsl:otherwise>
     6134                              <xsl:value-of select="$value"/>
     6135                            </xsl:otherwise>
     6136                          </xsl:choose>
     6137                        </xsl:with-param>
     6138                      </xsl:call-template>
     6139                    </xsl:otherwise>                 
     6140                 
     6141                  </xsl:choose>
     6142                 
     6143                </xsl:otherwise>
     6144              </xsl:choose>
     6145            </xsl:otherwise>
     6146          </xsl:choose>
     6147        </xsl:otherwise>
     6148      </xsl:choose>
     6149    </xsl:otherwise>
     6150  </xsl:choose>
     6151 
     6152</xsl:template>
     6153
     6154<xsl:template name="eat-leading-whitespace">
     6155  <xsl:param name="str"/>
     6156
     6157  <xsl:choose>
     6158    <xsl:when test="$str=''">
     6159    </xsl:when>
     6160    <xsl:when test="translate(substring($str,1,1),' &#10;&#13;&#9;',' ')=' '">
     6161      <xsl:call-template name="eat-leading-whitespace">
     6162        <xsl:with-param name="str" select="substring($str,2)"/>
     6163      </xsl:call-template>
     6164    </xsl:when>
     6165    <xsl:otherwise>
     6166      <xsl:value-of select="$str"/>
     6167    </xsl:otherwise>
     6168  </xsl:choose>
     6169 
     6170</xsl:template>
     6171
    57916172<!-- diag support -->
    57926173<xsl:template name="lineno">
     
    58356216<xsl:variable name="may-default-dates">
    58366217  <xsl:choose>
    5837     <xsl:when test="function-available('date:year') and function-available('date:month-in-year') and date:day-in-month()">
     6218    <xsl:when test="function-available('date:year') and function-available('date:month-in-year') and function-available('date:day-in-month')">
    58386219      <xsl:variable name="year-specified" select="/rfc/front/date/@year and /rfc/front/date/@year!=''"/>
    58396220      <xsl:variable name="month-specified" select="/rfc/front/date/@month and /rfc/front/date/@month!=''"/>
     
    58636244      <xsl:value-of select="/rfc/front/date/@year"/>
    58646245    </xsl:when>
    5865     <xsl:when test="function-available('date:year')">
    5866       <xsl:if test="/rfc/front/date/@month and /rfc/front/date/@month!=''">
    5867         <xsl:call-template name="error">
    5868           <xsl:with-param name="msg" select="'defaulting publication year although month was specified'"/>
    5869         </xsl:call-template>
    5870       </xsl:if>
    5871       <xsl:if test="/rfc/front/date/@day and /rfc/front/date/@day!=''">
    5872         <xsl:call-template name="error">
    5873           <xsl:with-param name="msg" select="'defaulting publication year although day was specified'"/>
    5874         </xsl:call-template>
    5875       </xsl:if>
     6246    <xsl:when test="function-available('date:year') and $may-default-dates='yes'">
    58766247      <xsl:value-of select="date:year()"/>
     6248    </xsl:when>
     6249    <xsl:when test="function-available('date:year') and $may-default-dates!='yes'">
     6250      <xsl:call-template name="warning">
     6251        <xsl:with-param name="inline" select="'no'"/>
     6252        <xsl:with-param name="msg" select="$may-default-dates"/>
     6253      </xsl:call-template>
    58776254    </xsl:when>
    58786255    <xsl:otherwise>
     
    59086285</xsl:param>
    59096286
    5910 <xsl:param name="xml2rfc-ext-pub-month-numeric">
     6287<xsl:param name="pub-month-numeric">
    59116288  <xsl:call-template name="get-month-as-num">
    59126289    <xsl:with-param name="month" select="$xml2rfc-ext-pub-month" />
     
    59266303</xsl:param>
    59276304
     6305<xsl:param name="pub-yearmonth">
     6306  <!-- year or 0000 -->
     6307  <xsl:choose>
     6308    <xsl:when test="$xml2rfc-ext-pub-year!=''">
     6309      <xsl:value-of select="format-number($xml2rfc-ext-pub-year,'0000')"/>
     6310    </xsl:when>
     6311    <xsl:otherwise>0000</xsl:otherwise>
     6312  </xsl:choose>
     6313  <!-- month or 00 -->
     6314  <xsl:choose>
     6315    <xsl:when test="$pub-month-numeric &gt; 0">
     6316      <xsl:value-of select="format-number($pub-month-numeric,'00')"/>
     6317    </xsl:when>
     6318    <xsl:otherwise>00</xsl:otherwise>
     6319  </xsl:choose>
     6320
     6321</xsl:param>
     6322
    59286323</xsl:transform>
Note: See TracChangeset for help on using the changeset viewer.