Changeset 704 for rfc2629xslt


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

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

Location:
rfc2629xslt
Files:
49 added
13 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/clean-for-DTD.xslt

    r681 r704  
    572572</xsl:template>
    573573
     574<xsl:template name="insert-begin-code"/>
     575<xsl:template name="insert-end-code"/>
     576<xsl:template match="@x:isCodeComponent" mode="cleanup"/>
     577
    574578<xsl:template match="artwork" mode="cleanup">
    575579  <xsl:variable name="content2"><xsl:apply-templates select="."/></xsl:variable>
     
    577581  <artwork>
    578582    <xsl:apply-templates select="@*" mode="cleanup" />
     583    <xsl:if test="@x:isCodeComponent='yes'">
     584      <xsl:if test="starts-with(.,'&#10;')">
     585        <xsl:text>&#10;</xsl:text>
     586      </xsl:if>
     587      <xsl:value-of select="@x:indent-with"/>
     588      <xsl:text>&lt;CODE BEGINS&gt;&#10;</xsl:text>
     589    </xsl:if>
    579590    <xsl:if test="starts-with(.,'&#10;')">
    580591      <xsl:text>&#10;</xsl:text>
     
    592603      </xsl:otherwise>
    593604    </xsl:choose>
     605    <xsl:if test="@x:isCodeComponent='yes'">&#10;&lt;CODE ENDS&gt;&#10;</xsl:if>
    594606  </artwork> 
    595607</xsl:template>
     
    618630</xsl:template>
    619631
    620 <!-- email repititions -->
     632<!-- email repetitions -->
    621633<xsl:template match="email" mode="cleanup">
    622634  <!-- combine in a single element -->
     
    640652</xsl:template>
    641653
     654<xsl:template match="cref//xref" mode="cleanup" priority="9">
     655  <xsl:variable name="text">
     656    <xsl:apply-templates select="."/>
     657  </xsl:variable>
     658  <xsl:value-of select="$text"/>
     659</xsl:template>
     660
    642661<!-- artwork extensions -->
    643662<xsl:template match="artwork/@x:extraction-note" mode="cleanup"/>
  • rfc2629xslt/rfc2629-ext.rnc

    r689 r704  
    6363      attlist.cref,
    6464      (TEXT
    65         | eref)*
     65        | eref
     66        | xref)*
    6667    }
    6768
  • 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>
  • rfc2629xslt/rfc2629toFO.xslt

    r689 r704  
    4646<xsl:import href="rfc2629.xslt" />
    4747
    48 <!-- switch for doublesided layout -->
    49 
    50 <xsl:param name="xml2rfc-ext-duplex"
    51   select="substring-after(
    52       translate(/processing-instruction('rfc')[contains(.,'sortrefs=')], concat($quote-chars,' '), ''),
    53         'ext-duplex=')"
    54 />
    55 
    5648<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
    5749
     
    6557
    6658<xsl:attribute-set name="base">
    67         <xsl:attribute name="font-family">serif</xsl:attribute>
    68         <xsl:attribute name="font-size">10pt</xsl:attribute>
     59  <xsl:attribute name="font-family">serif</xsl:attribute>
     60  <xsl:attribute name="font-size">10pt</xsl:attribute>
    6961</xsl:attribute-set>
    7062
    7163<xsl:attribute-set name="h1">
    72         <xsl:attribute name="font-weight">bold</xsl:attribute>
    73         <xsl:attribute name="font-size">14pt</xsl:attribute>
    74         <xsl:attribute name="keep-with-next">always</xsl:attribute>
    75         <xsl:attribute name="space-before">14pt</xsl:attribute>
    76         <xsl:attribute name="space-after">7pt</xsl:attribute>
     64  <xsl:attribute name="font-weight">bold</xsl:attribute>
     65  <xsl:attribute name="font-size">14pt</xsl:attribute>
     66  <xsl:attribute name="keep-with-next">always</xsl:attribute>
     67  <xsl:attribute name="space-before">14pt</xsl:attribute>
     68  <xsl:attribute name="space-after">7pt</xsl:attribute>
    7769</xsl:attribute-set>
    7870
    7971<xsl:attribute-set name="h2">
    80         <xsl:attribute name="font-weight">bold</xsl:attribute>
    81         <xsl:attribute name="font-size">12pt</xsl:attribute>
    82         <xsl:attribute name="keep-with-next">always</xsl:attribute>
    83         <xsl:attribute name="space-before">12pt</xsl:attribute>
    84         <xsl:attribute name="space-after">6pt</xsl:attribute>
     72  <xsl:attribute name="font-weight">bold</xsl:attribute>
     73  <xsl:attribute name="font-size">12pt</xsl:attribute>
     74  <xsl:attribute name="keep-with-next">always</xsl:attribute>
     75  <xsl:attribute name="space-before">12pt</xsl:attribute>
     76  <xsl:attribute name="space-after">6pt</xsl:attribute>
    8577</xsl:attribute-set>
    8678
    8779<xsl:attribute-set name="h3">
    88         <xsl:attribute name="font-weight">bold</xsl:attribute>
    89         <xsl:attribute name="font-size">11pt</xsl:attribute>
    90         <xsl:attribute name="keep-with-next">always</xsl:attribute>
    91         <xsl:attribute name="space-before">11pt</xsl:attribute>
    92         <xsl:attribute name="space-after">3pt</xsl:attribute>
     80  <xsl:attribute name="font-weight">bold</xsl:attribute>
     81  <xsl:attribute name="font-size">11pt</xsl:attribute>
     82  <xsl:attribute name="keep-with-next">always</xsl:attribute>
     83  <xsl:attribute name="space-before">11pt</xsl:attribute>
     84  <xsl:attribute name="space-after">3pt</xsl:attribute>
    9385</xsl:attribute-set>
    9486
    9587<xsl:attribute-set name="comment">
    96         <xsl:attribute name="font-weight">bold</xsl:attribute>
    97         <xsl:attribute name="background-color">yellow</xsl:attribute>
     88  <xsl:attribute name="font-weight">bold</xsl:attribute>
     89  <xsl:attribute name="background-color">yellow</xsl:attribute>
    9890</xsl:attribute-set>
    9991
     
    10496
    10597<xsl:attribute-set name="index">
    106         <xsl:attribute name="font-size">9pt</xsl:attribute>
     98  <xsl:attribute name="font-size">9pt</xsl:attribute>
    10799</xsl:attribute-set>
    108100
     
    130122<xsl:template match="abstract">
    131123  <fo:block xsl:use-attribute-sets="h1" id="{concat($anchor-prefix,'.abstract')}">Abstract</fo:block>
    132         <xsl:apply-templates />
     124  <xsl:apply-templates />
    133125</xsl:template>
    134126
     
    187179
    188180<xsl:template match="artwork">
    189         <fo:block font-family="monospace" padding=".5em"
     181  <xsl:if test="@x:isCodeComponent='yes'">
     182    <fo:block font-family="monospace" color="gray">&lt;CODE BEGINS></fo:block>
     183  </xsl:if>
     184  <fo:block font-family="monospace" padding=".5em"
    190185    white-space-treatment="preserve" linefeed-treatment="preserve"
    191186    white-space-collapse="false" page-break-inside="avoid">
     
    193188    <xsl:apply-templates/>
    194189  </fo:block>
     190  <xsl:if test="@x:isCodeComponent='yes'">
     191    <fo:block font-family="monospace" color="gray">&lt;CODE ENDS></fo:block>
     192  </xsl:if>
    195193</xsl:template>
    196194
    197195<xsl:template match="artwork[@src and starts-with(@type,'image/')]">
    198         <fo:block>
     196  <fo:block>
    199197    <xsl:choose>
    200198      <xsl:when test="@align='center'">
     
    220218    </fo:block>
    221219    <fo:block><xsl:value-of select="organization" /></fo:block>
    222         <xsl:for-each select="address/postal/street">
     220    <xsl:for-each select="address/postal/street">
    223221      <fo:block><xsl:value-of select="." /></fo:block>
    224222    </xsl:for-each>
    225         <xsl:if test="address/postal/city">
     223    <xsl:if test="address/postal/city">
    226224      <fo:block><xsl:value-of select="concat(address/postal/city,', ',address/postal/region,' ',address/postal/code)" /></fo:block>
    227         </xsl:if>
    228         <xsl:if test="address/postal/country">
     225    </xsl:if>
     226    <xsl:if test="address/postal/country">
    229227      <fo:block><xsl:value-of select="address/postal/country" /></fo:block>
    230228    </xsl:if>
    231         <xsl:if test="address/phone">
     229    <xsl:if test="address/phone">
    232230      <fo:block>Phone:&#0160;<fo:basic-link external-destination="url('tel:{translate(address/phone,' ','')}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="address/phone" /></fo:basic-link></fo:block>
    233231    </xsl:if>
    234         <xsl:if test="address/facsimile">
     232    <xsl:if test="address/facsimile">
    235233      <fo:block>Fax:&#0160;<fo:basic-link external-destination="url('tel:{translate(address/facsimile,' ','')}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="address/facsimile" /></fo:basic-link></fo:block>
    236234    </xsl:if>
    237         <xsl:for-each select="address/email">
     235    <xsl:for-each select="address/email">
    238236      <xsl:variable name="email">
    239237        <xsl:call-template name="extract-email"/>
     
    250248      </fo:block>
    251249    </xsl:for-each>
    252         <xsl:for-each select="address/uri">
     250    <xsl:for-each select="address/uri">
    253251      <xsl:variable name="uri">
    254252        <xsl:call-template name="extract-uri"/>
     
    275273    </xsl:if>
    276274    <xsl:call-template name="add-anchor"/>
    277         <xsl:apply-templates />
     275    <xsl:apply-templates />
    278276    <xsl:if test="(@title!='' or @anchor!='') and not(@suppress-title='true')">
    279277      <xsl:variable name="n"><xsl:number level="any" count="figure[(@title!='' or @anchor!='') and not(@suppress-title='true')]" /></xsl:variable>
     
    286284
    287285  <xsl:if test="$xml2rfc-topblock!='no'">
    288         <!-- collect information for left column -->
     286    <!-- collect information for left column -->
    289287     
    290         <xsl:variable name="leftColumn">
     288    <xsl:variable name="leftColumn">
    291289      <xsl:call-template name="collectLeftHeaderColumn" /> 
    292290    </xsl:variable>
     
    300298      <!-- insert the collected information -->
    301299     
    302         <fo:table width="100%" table-layout="fixed">
     300    <fo:table width="100%" table-layout="fixed">
    303301      <fo:table-column column-width="proportional-column-width(1)" />
    304302      <fo:table-column column-width="proportional-column-width(1)" />
     
    306304        <xsl:choose>
    307305          <xsl:when test="function-available('exslt:node-set')">
    308                 <xsl:call-template name="emitheader">
    309                         <xsl:with-param name="lc" select="exslt:node-set($leftColumn)" />   
    310                 <xsl:with-param name="rc" select="exslt:node-set($rightColumn)" />   
     306             <xsl:call-template name="emitheader">
     307               <xsl:with-param name="lc" select="exslt:node-set($leftColumn)" />   
     308               <xsl:with-param name="rc" select="exslt:node-set($rightColumn)" />   
    311309            </xsl:call-template>
    312310          </xsl:when>   
    313311          <xsl:otherwise>   
    314                 <xsl:call-template name="emitheader">
    315                         <xsl:with-param name="lc" select="$leftColumn" />   
    316                 <xsl:with-param name="rc" select="$rightColumn" />   
     312             <xsl:call-template name="emitheader">
     313               <xsl:with-param name="lc" select="$leftColumn" />   
     314               <xsl:with-param name="rc" select="$rightColumn" />   
    317315            </xsl:call-template>
    318316          </xsl:otherwise>   
    319317        </xsl:choose>
    320                 </fo:table-body>
    321         </fo:table>
     318      </fo:table-body>
     319    </fo:table>
    322320  </xsl:if>
    323321     
     
    329327  </fo:block>
    330328 
    331   <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     329  <xsl:if test="$xml2rfc-private='' and not($abstract-first)">
    332330    <xsl:call-template name="emit-ietf-preamble"/>
    333331  </xsl:if>
    334332 
    335333  <xsl:apply-templates select="x:boilerplate"/>
    336         <xsl:apply-templates select="abstract" />
    337         <xsl:apply-templates select="note" />
    338 
    339   <xsl:if test="not($xml2rfc-private) and $abstract-first">
     334  <xsl:apply-templates select="abstract" />
     335  <xsl:apply-templates select="note" />
     336
     337  <xsl:if test="$xml2rfc-private='' and $abstract-first">
    340338    <xsl:call-template name="emit-ietf-preamble"/>
    341339  </xsl:if>
    342340
    343         <xsl:if test="$xml2rfc-toc='yes'">
    344                 <xsl:apply-templates select="/" mode="toc" />
    345                 <!--<xsl:call-template name="insertTocAppendix" />-->
    346         </xsl:if>
     341  <xsl:if test="$xml2rfc-toc='yes'">
     342    <xsl:apply-templates select="/" mode="toc" />
     343    <!--<xsl:call-template name="insertTocAppendix" />-->
     344  </xsl:if>
    347345
    348346</xsl:template>
     
    376374<!-- processed in a later stage -->
    377375<xsl:template match="iref[not(ancestor::t) and not(parent::section)]">
    378         <fo:block>
     376  <fo:block>
    379377    <xsl:attribute name="id"><xsl:value-of select="$anchor-prefix" />.iref.<xsl:number level="any"/></xsl:attribute>
    380378    <xsl:choose>
     
    398396
    399397<xsl:template match="iref[ancestor::t and not(parent::section)]">
    400         <fo:inline>
     398  <fo:inline>
    401399    <xsl:attribute name="id"><xsl:value-of select="$anchor-prefix" />.iref.<xsl:number level="any"/></xsl:attribute>
    402400    <xsl:choose>
     
    640638
    641639<xsl:template match="middle">
    642         <xsl:apply-templates />
     640  <xsl:apply-templates />
    643641</xsl:template>
    644642               
     
    646644  <xsl:variable name="num"><xsl:number count="note"/></xsl:variable>
    647645  <fo:block xsl:use-attribute-sets="h1" id="{concat($anchor-prefix,'.note.',$num)}"><xsl:value-of select="@title" /></fo:block>
    648         <xsl:apply-templates />
     646  <xsl:apply-templates />
    649647</xsl:template>
    650648
    651649<xsl:template match="preamble">
    652         <fo:block space-after=".5em">
     650  <fo:block space-after=".5em">
    653651    <xsl:call-template name="copy-anchor"/>
    654652    <xsl:apply-templates />
     
    657655
    658656<xsl:template match="postamble">
    659         <fo:block space-before=".5em"><xsl:apply-templates /></fo:block>
     657  <fo:block space-before=".5em"><xsl:apply-templates /></fo:block>
    660658</xsl:template>
    661659
     
    665663    <xsl:choose>
    666664      <xsl:when test="@target"><xsl:value-of select="@target" /></xsl:when>
    667                         <xsl:when test="seriesInfo/@name='RFC'"><xsl:value-of select="concat($rfcUrlPrefix,seriesInfo[@name='RFC']/@value,'.txt')" /></xsl:when>
    668                         <xsl:when test="seriesInfo[starts-with(.,'RFC')]">
     665      <xsl:when test="seriesInfo/@name='RFC'"><xsl:value-of select="concat($rfcUrlPrefix,seriesInfo[@name='RFC']/@value,'.txt')" /></xsl:when>
     666      <xsl:when test="seriesInfo[starts-with(.,'RFC')]">
    669667        <xsl:variable name="rfcRef" select="seriesInfo[starts-with(.,'RFC')]" />
    670               <xsl:value-of select="concat($rfcUrlPrefix,substring-after (normalize-space($rfcRef), ' '),'.txt')" />
     668        <xsl:value-of select="concat($rfcUrlPrefix,substring-after (normalize-space($rfcRef), ' '),'.txt')" />
    671669      </xsl:when>
    672670      <xsl:otherwise />
    673671    </xsl:choose>
    674         </xsl:variable>
     672  </xsl:variable>
    675673
    676674  <fo:list-item space-after=".5em">
     
    687685      </fo:block>
    688686    </fo:list-item-label>
    689                
     687   
    690688    <fo:list-item-body start-indent="body-start()"><fo:block>
    691689
     
    696694        <xsl:choose>
    697695          <xsl:when test="@surname and @surname!=''">
    698                                 <xsl:choose>
     696            <xsl:choose>
    699697              <xsl:when test="@surname and position()=last() and position()!=1">
    700698                <xsl:value-of select="concat($initials,' ',@surname)" />
     
    703701                <xsl:value-of select="concat(@surname,', ',$initials)" />
    704702              </xsl:when>
    705                                         <xsl:when test="organization/text()">
     703              <xsl:when test="organization/text()">
    706704                <xsl:value-of select="organization" />
    707705              </xsl:when>
     
    752750        <xsl:choose>
    753751          <xsl:when test="not(@name) and not(@value) and ./text()"><xsl:value-of select="." /></xsl:when>
    754                                         <xsl:otherwise>
     752          <xsl:otherwise>
    755753            <xsl:value-of select="@name" />
    756754            <xsl:if test="@value!=''">&#0160;<xsl:value-of select="@value" /></xsl:if>
     
    801799        <xsl:with-param name="no" select="$sectionNumber"/>
    802800      </xsl:call-template>
    803       <xsl:text>&#160;&#160;References</xsl:text>
     801      <xsl:text>&#160;&#160;</xsl:text>
     802      <xsl:value-of select="$xml2rfc-refparent"/>
    804803    </fo:block>
    805804  </xsl:if>
     
    817816        <xsl:choose>
    818817          <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
    819           <xsl:otherwise>References</xsl:otherwise>
     818          <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    820819        </xsl:choose>
    821820      </fo:block>
     
    832831        <xsl:choose>
    833832          <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
    834           <xsl:otherwise>References</xsl:otherwise>
     833          <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    835834        </xsl:choose>
    836835      </fo:block>
     
    868867
    869868<xsl:template match="rfc">
    870         <fo:root xsl:use-attribute-sets="base">
     869  <fo:root xsl:use-attribute-sets="base">
    871870   
    872                 <fo:layout-master-set>
    873                         <fo:simple-page-master master-name="first-page" xsl:use-attribute-sets="page">
     871    <fo:layout-master-set>
     872      <fo:simple-page-master master-name="first-page" xsl:use-attribute-sets="page">
    874873        <fo:region-body margin-bottom="1in" margin-top="1in"/>
    875             <fo:region-after extent="1cm" region-name="footer"/>
     874         <fo:region-after extent="1cm" region-name="footer"/>
    876875      </fo:simple-page-master>
    877                         <fo:simple-page-master master-name="other-pages-right" xsl:use-attribute-sets="page">
     876      <fo:simple-page-master master-name="other-pages-right" xsl:use-attribute-sets="page">
    878877        <fo:region-body margin-bottom="1in" margin-top="1in" />
    879                                 <fo:region-before extent="1cm" region-name="header-right"/>
    880                                 <fo:region-after extent="1cm" region-name="footer-right"/>
     878        <fo:region-before extent="1cm" region-name="header-right"/>
     879        <fo:region-after extent="1cm" region-name="footer-right"/>
    881880      </fo:simple-page-master>
    882                         <fo:simple-page-master master-name="other-pages-left" xsl:use-attribute-sets="page">
     881      <fo:simple-page-master master-name="other-pages-left" xsl:use-attribute-sets="page">
    883882        <fo:region-body margin-bottom="1in" margin-top="1in" />
    884                                 <fo:region-before extent="1cm" region-name="header-left"/>
    885                                 <fo:region-after extent="1cm" region-name="footer-left"/>
     883        <fo:region-before extent="1cm" region-name="header-left"/>
     884        <fo:region-after extent="1cm" region-name="footer-left"/>
    886885      </fo:simple-page-master>
    887                         <fo:simple-page-master master-name="other-pages-dc-right" xsl:use-attribute-sets="page">
     886      <fo:simple-page-master master-name="other-pages-dc-right" xsl:use-attribute-sets="page">
    888887        <fo:region-body margin-bottom="1in" margin-top="1in" column-count="2"/>
    889                                 <fo:region-before extent="1cm" region-name="header-right"/>
    890                                 <fo:region-after extent="1cm" region-name="footer-right"/>
     888        <fo:region-before extent="1cm" region-name="header-right"/>
     889        <fo:region-after extent="1cm" region-name="footer-right"/>
    891890      </fo:simple-page-master>
    892                         <fo:simple-page-master master-name="other-pages-dc-left" xsl:use-attribute-sets="page">
     891      <fo:simple-page-master master-name="other-pages-dc-left" xsl:use-attribute-sets="page">
    893892        <fo:region-body margin-bottom="1in" margin-top="1in" column-count="2"/>
    894                                 <fo:region-before extent="1cm" region-name="header-left"/>
    895                                 <fo:region-after extent="1cm" region-name="footer-left"/>
     893        <fo:region-before extent="1cm" region-name="header-left"/>
     894        <fo:region-after extent="1cm" region-name="footer-left"/>
    896895      </fo:simple-page-master>
    897                         <fo:page-sequence-master master-name="sequence"> 
    898                                 <fo:single-page-master-reference master-reference="first-page" />
     896      <fo:page-sequence-master master-name="sequence"> 
     897        <fo:single-page-master-reference master-reference="first-page" />
    899898        <xsl:choose>
    900899          <xsl:when test="$xml2rfc-ext-duplex='yes'">
     
    905904          </xsl:when>
    906905          <xsl:otherwise>
    907                                 <fo:repeatable-page-master-reference master-reference="other-pages-right" /> 
     906            <fo:repeatable-page-master-reference master-reference="other-pages-right" /> 
    908907          </xsl:otherwise>
    909908        </xsl:choose>
    910                         </fo:page-sequence-master>
    911                         <fo:page-sequence-master master-name="sequence-dc"> 
     909      </fo:page-sequence-master>
     910      <fo:page-sequence-master master-name="sequence-dc"> 
    912911        <xsl:choose>
    913912          <xsl:when test="$xml2rfc-ext-duplex='yes'">
     
    918917          </xsl:when>
    919918          <xsl:otherwise>
    920                                 <fo:repeatable-page-master-reference master-reference="other-pages-dc-right" /> 
     919            <fo:repeatable-page-master-reference master-reference="other-pages-dc-right" /> 
    921920          </xsl:otherwise>
    922921        </xsl:choose>
    923                         </fo:page-sequence-master>
    924                 </fo:layout-master-set>
     922      </fo:page-sequence-master>
     923    </fo:layout-master-set>
    925924
    926925    <fo:declarations>
     
    951950    <xsl:variable name="lang"><xsl:call-template name="get-lang"/></xsl:variable>
    952951
    953                 <fo:page-sequence master-reference="sequence" language="{$lang}">
     952    <fo:page-sequence master-reference="sequence" language="{$lang}">
    954953      <xsl:if test="$xml2rfc-ext-duplex='yes'">
    955954        <xsl:attribute name="force-page-count">even</xsl:attribute>
     
    959958      <xsl:call-template name="insertFooter" />
    960959     
    961                         <fo:flow flow-name="xsl-region-body">
    962                                
     960      <fo:flow flow-name="xsl-region-body">
     961       
    963962        <!-- process front & middle section, but not back -->
    964963        <xsl:apply-templates />
     
    966965        <!-- because it requires multiple page masters -->
    967966        <!-- references first -->
    968         <xsl:apply-templates select="back/references" />
     967        <xsl:apply-templates select="back/references" />
    969968       
    970969        <xsl:if test="$xml2rfc-ext-authors-section!='end'">
     
    973972       
    974973        <!-- add all other top-level sections under <back> -->
    975         <xsl:apply-templates select="back/*[not(self::references)]" />
     974        <xsl:apply-templates select="back/*[not(self::references)]" />
    976975     
    977                         </fo:flow>
     976      </fo:flow>
    978977    </fo:page-sequence>
    979978   
     
    985984        <xsl:call-template name="insertHeader" />
    986985        <xsl:call-template name="insertFooter" />
    987                         <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="index">
    988                                 <xsl:call-template name="insertIndex" />   
    989                           </fo:flow>
     986        <fo:flow flow-name="xsl-region-body" xsl:use-attribute-sets="index">
     987          <xsl:call-template name="insertIndex" />   
     988        </fo:flow>
    990989      </fo:page-sequence>
    991990    </xsl:if>
    992991
    993     <xsl:if test="$xml2rfc-ext-authors-section='end' or (not($xml2rfc-private) and not($no-copylong))">
    994                 <fo:page-sequence master-reference="sequence" language="{$lang}">
     992    <xsl:if test="$xml2rfc-ext-authors-section='end' or ($xml2rfc-private='' and not($no-copylong))">
     993      <fo:page-sequence master-reference="sequence" language="{$lang}">
    995994        <xsl:if test="$xml2rfc-ext-duplex='yes'">
    996995          <xsl:attribute name="force-page-count">even</xsl:attribute>
     
    1000999        <xsl:call-template name="insertFooter" />
    10011000       
    1002                         <fo:flow flow-name="xsl-region-body">
    1003                                
     1001        <fo:flow flow-name="xsl-region-body">
     1002         
    10041003          <xsl:if test="$xml2rfc-ext-authors-section='end'">
    10051004            <xsl:call-template name="insertAuthors" />
    10061005          </xsl:if>
    10071006 
    1008           <xsl:if test="not($xml2rfc-private)">
    1009                 <!-- copyright statements -->
     1007          <xsl:if test="$xml2rfc-private=''">
     1008            <!-- copyright statements -->
    10101009            <xsl:variable name="copyright">
    10111010              <xsl:call-template name="insertCopyright" />
     
    10241023          </xsl:if>
    10251024         
    1026                         </fo:flow>
     1025        </fo:flow>
    10271026      </fo:page-sequence>
    10281027    </xsl:if>
    10291028   
    1030         </fo:root>
     1029  </fo:root>
    10311030</xsl:template>
    10321031
     
    11211120
    11221121<xsl:template match="t">
    1123         <fo:block space-before=".5em" space-after=".5em">
     1122  <fo:block space-before=".5em" space-after=".5em">
    11241123    <xsl:call-template name="insert-justification"/>
    11251124    <xsl:choose>
     
    11741173
    11751174<xsl:template match="xref[node()]">
    1176         <xsl:variable name="target" select="@target" />
     1175  <xsl:variable name="target" select="@target" />
    11771176  <xsl:variable name="node" select="//*[@anchor=$target]" />
    11781177  <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>
     
    12531252<xsl:template match="xref[not(node())]">
    12541253
    1255         <xsl:variable name="target" select="@target" />
     1254  <xsl:variable name="target" select="@target" />
    12561255  <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>
    12571256  <xsl:variable name="node" select="//*[@anchor=$target]" />
     
    15021501
    15031502<xsl:template match="/">
    1504         <xsl:apply-templates />
     1503  <xsl:apply-templates />
    15051504</xsl:template>
    15061505
     
    15141513
    15151514<xsl:template name="emitheader">
    1516         <xsl:param name="lc" />
    1517         <xsl:param name="rc" />
    1518 
    1519         <xsl:for-each select="$lc/myns:item | $rc/myns:item">
     1515  <xsl:param name="lc" />
     1516  <xsl:param name="rc" />
     1517
     1518  <xsl:for-each select="$lc/myns:item | $rc/myns:item">
    15201519    <xsl:variable name="pos" select="position()" />
    15211520    <xsl:if test="$pos &lt; count($lc/myns:item) + 1 or $pos &lt; count($rc/myns:item) + 1">
     
    15331532      </fo:table-row>
    15341533    </xsl:if>
    1535         </xsl:for-each>
     1534  </xsl:for-each>
    15361535</xsl:template>
    15371536
     
    15751574<xsl:template name="insertIndex">
    15761575
    1577         <fo:block xsl:use-attribute-sets="h1 newpage" id="{$anchor-prefix}.index">
     1576  <fo:block xsl:use-attribute-sets="h1 newpage" id="{$anchor-prefix}.index">
    15781577    <xsl:text>Index</xsl:text>
    15791578  </fo:block>
     
    16061605      <xsl:for-each select="key('index-first-letter',translate(substring(concat(@item,@anchor),1,1),$lcase,$ucase))">
    16071606 
    1608                 <xsl:sort select="translate(concat(@item,@anchor),$lcase,$ucase)" />
     1607      <xsl:sort select="translate(concat(@item,@anchor),$lcase,$ucase)" />
    16091608     
    16101609        <xsl:choose>
     
    16911690          </xsl:when>
    16921691          <xsl:otherwise>
    1693                   <xsl:if test="generate-id(.) = generate-id(key('index-item',@item))">
     1692            <xsl:if test="generate-id(.) = generate-id(key('index-item',@item))">
    16941693           
    16951694              <xsl:variable name="item" select="@item"/>
     
    17181717                   
    17191718              <xsl:for-each select="key('index-item',@item)[@subitem and @subitem!='']">
    1720                           <xsl:sort select="translate(@subitem,$lcase,$ucase)" />
     1719              <xsl:sort select="translate(@subitem,$lcase,$ucase)" />
    17211720           
    1722                   <xsl:if test="generate-id(.) = generate-id(key('index-item-subitem',concat(@item,'..',@subitem)))">
     1721                <xsl:if test="generate-id(.) = generate-id(key('index-item-subitem',concat(@item,'..',@subitem)))">
    17231722               
    17241723                  <xsl:variable name="itemsubitem" select="concat(@item,'..',@subitem)"/>
     
    17621761
    17631762<xsl:template match="/" mode="toc">
    1764         <fo:block xsl:use-attribute-sets="h1 newpage" id="{concat($anchor-prefix,'.toc')}">
     1763  <fo:block xsl:use-attribute-sets="h1 newpage" id="{concat($anchor-prefix,'.toc')}">
    17651764    <xsl:text>Table of Contents</xsl:text>
    17661765  </fo:block>
     
    17921791
    17931792  <!-- copyright statements -->
    1794   <xsl:if test="not($xml2rfc-private) and not($no-copylong)">
     1793  <xsl:if test="$xml2rfc-private='' and not($no-copylong)">
    17951794    <xsl:call-template name="insert-toc-line">
    17961795      <xsl:with-param name="target" select="concat($anchor-prefix,'.ipr')"/>
     
    18341833          <xsl:choose>
    18351834            <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    1836             <xsl:otherwise>References</xsl:otherwise>
     1835            <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    18371836          </xsl:choose>
    18381837        </xsl:variable>
     
    18541853        </xsl:with-param>
    18551854        <xsl:with-param name="target" select="concat($anchor-prefix,'.references')"/>
    1856         <xsl:with-param name="title" select="'References'"/>
     1855        <xsl:with-param name="title" select="$xml2rfc-refparent"/>
    18571856      </xsl:call-template>
    18581857 
     
    18621861          <xsl:choose>
    18631862            <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    1864             <xsl:otherwise>References</xsl:otherwise>
     1863            <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    18651864          </xsl:choose>
    18661865        </xsl:variable>
     
    19681967<!--
    19691968<xsl:template name="rfclist">
    1970         <xsl:param name="list" />
    1971         <xsl:choose>
    1972         <xsl:when test="contains($list,',')">
    1973                 <xsl:variable name="rfcNo" select="substring-before($list,',')" />
    1974                 <a href="{concat($rfcUrlPrefix,$rfcNo,'.txt')}"><xsl:value-of select="$rfcNo" /></a>,
    1975                 <xsl:call-template name="rfclist">
    1976                 <xsl:with-param name="list" select="normalize-space(substring-after($list,','))" />
     1969  <xsl:param name="list" />
     1970  <xsl:choose>
     1971      <xsl:when test="contains($list,',')">
     1972          <xsl:variable name="rfcNo" select="substring-before($list,',')" />
     1973          <a href="{concat($rfcUrlPrefix,$rfcNo,'.txt')}"><xsl:value-of select="$rfcNo" /></a>,
     1974          <xsl:call-template name="rfclist">
     1975              <xsl:with-param name="list" select="normalize-space(substring-after($list,','))" />
    19771976            </xsl:call-template>
    19781977        </xsl:when>
    19791978        <xsl:otherwise>
    1980                 <xsl:variable name="rfcNo" select="$list" />
    1981                 <a href="{concat($rfcUrlPrefix,$rfcNo,'.txt')}"><xsl:value-of select="$rfcNo" /></a>
    1982         </xsl:otherwise>
     1979          <xsl:variable name="rfcNo" select="$list" />
     1980          <a href="{concat($rfcUrlPrefix,$rfcNo,'.txt')}"><xsl:value-of select="$rfcNo" /></a>
     1981         </xsl:otherwise>
    19831982    </xsl:choose>
    19841983</xsl:template>
     
    20072006            <fo:block text-align="start">
    20082007              <xsl:value-of select="$left" />
    2009                 </fo:block>
     2008             </fo:block>
    20102009          </fo:table-cell>
    20112010          <fo:table-cell text-align="center">
    20122011            <fo:block>
    20132012              <xsl:value-of select="$center" />
    2014                 </fo:block>
     2013             </fo:block>
    20152014          </fo:table-cell>
    20162015          <fo:table-cell text-align="end">
    20172016            <fo:block>
    20182017              <xsl:value-of select="$right" />
    2019                 </fo:block>
     2018             </fo:block>
    20202019          </fo:table-cell>
    20212020        </fo:table-row>
     
    20352034            <fo:block>
    20362035              <xsl:value-of select="$right" />
    2037                 </fo:block>
     2036             </fo:block>
    20382037          </fo:table-cell>
    20392038          <fo:table-cell text-align="center">
    20402039            <fo:block>
    20412040              <xsl:value-of select="$center" />
    2042                 </fo:block>
     2041             </fo:block>
    20432042          </fo:table-cell>
    20442043          <fo:table-cell>
    20452044            <fo:block text-align="end">
    20462045              <xsl:value-of select="$left" />
    2047                 </fo:block>
     2046             </fo:block>
    20482047          </fo:table-cell>
    20492048        </fo:table-row>
     
    20732072            <fo:block text-align="start">
    20742073              <xsl:value-of select="$left" />
    2075                   </fo:block>
     2074             </fo:block>
    20762075          </fo:table-cell>
    20772076          <fo:table-cell>
    20782077            <fo:block text-align="center">
    20792078              <xsl:value-of select="$center" />
    2080                   </fo:block>
     2079             </fo:block>
    20812080          </fo:table-cell>
    20822081          <fo:table-cell>
     
    21012100            <fo:block text-align="center">
    21022101              <xsl:value-of select="$center" />
    2103                   </fo:block>
     2102             </fo:block>
    21042103          </fo:table-cell>
    21052104          <fo:table-cell>
    21062105            <fo:block text-align="end">
    21072106              <xsl:value-of select="$left" />
    2108                   </fo:block>
     2107             </fo:block>
    21092108          </fo:table-cell>
    21102109        </fo:table-row>
     
    22032202  </xsl:if>
    22042203
    2205   <xsl:if test="not($xml2rfc-private) and not($no-copylong)">
     2204  <xsl:if test="$xml2rfc-private='' and not($no-copylong)">
    22062205    <!-- copyright statements -->
    22072206    <fo:bookmark internal-destination="{concat($anchor-prefix,'.ipr')}">
     
    22522251          <xsl:choose>
    22532252            <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    2254             <xsl:otherwise>References</xsl:otherwise>
     2253            <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    22552254          </xsl:choose>
    22562255        </xsl:variable>
     
    22722271          <xsl:call-template name="get-references-section-number"/>
    22732272          <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
    2274           <xsl:text> References</xsl:text>
     2273          <xsl:text> </xsl:text>
     2274          <xsl:value-of select="$xml2rfc-refparent"/>
    22752275        </fo:bookmark-title>
    22762276
     
    22802280            <xsl:choose>
    22812281              <xsl:when test="@title!=''"><xsl:value-of select="@title" /></xsl:when>
    2282               <xsl:otherwise>References</xsl:otherwise>
     2282              <xsl:otherwise><xsl:value-of select="$xml2rfc-refparent"/></xsl:otherwise>
    22832283            </xsl:choose>
    22842284          </xsl:variable>
     
    23042304
    23052305<xsl:template match="rfc" mode="bookmarks">
    2306   <xsl:if test="not($xml2rfc-private)">
     2306  <xsl:if test="$xml2rfc-private=''">
    23072307    <!-- Get status info formatted as per RFC2629-->
    23082308    <xsl:variable name="preamble"><xsl:call-template name="insertPreamble" /></xsl:variable>
  • rfc2629xslt/rfc2629toHhk.xslt

    r689 r704  
    2424<html>
    2525  <head>
    26     <meta name="generator" content="rfc2629toHhk.xslt $Id: rfc2629toHhk.xslt,v 1.6 2003/11/16 14:52:40 jre Exp $" />
     26    <meta name="generator" content="rfc2629toHhk.xslt $Id: rfc2629toHhk.xslt,v 1.6 2003-11-16 14:52:40 jre Exp $" />
    2727  </head>
    2828  <body>
  • rfc2629xslt/rfc2629toXHTML.xslt

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

    r689 r704  
    336336  }
    337337  @top-right {
    338        content: "August 2009";
     338       content: "September 2009";
    339339  }
    340340  @top-center {
     
    363363    }
    364364}
    365 </style><link rel="Contents" href="#rfc.toc"><link rel="Author" href="#rfc.authors"><link rel="Index" href="#rfc.index"><link rel="Chapter" title="1 Introduction" href="#rfc.section.1"><link rel="Chapter" title="2 Supported RFC2629 elements" href="#rfc.section.2"><link rel="Chapter" title="3 Processing Instructions" href="#rfc.section.3"><link rel="Chapter" title="4 Anchors" href="#rfc.section.4"><link rel="Chapter" title="5 Supported XSLT engines" href="#rfc.section.5"><link rel="Chapter" title="6 Transforming to HTML" href="#rfc.section.6"><link rel="Chapter" title="7 Transforming to XHTML" href="#rfc.section.7"><link rel="Chapter" title="8 Transforming to CHM (Microsoft Compiled Help)" href="#rfc.section.8"><link rel="Chapter" title="9 Transforming to PDF" href="#rfc.section.9"><link rel="Chapter" title="10 Generic Extensions" href="#rfc.section.10"><link rel="Chapter" title="11 Utilities" href="#rfc.section.11"><link rel="Chapter" href="#rfc.section.12" title="12 Informative References"><link rel="Appendix" title="A RELAX NG Compact Schema" href="#rfc.section.A"><link rel="Appendix" title="B Implementation Notes" href="#rfc.section.B"><link rel="Appendix" title="C Examples" href="#rfc.section.C"><link rel="Appendix" title="D License" href="#rfc.section.D"><link rel="Appendix" title="E Change Logs" href="#rfc.section.E"><meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.451, 2009-08-28 12:08:05, XSLT vendor: SAXON 6.5.5 from Michael Kay http://saxon.sf.net/"><meta name="keywords" content="RFC2629, xml2rfc, XSLT, hCard, XSL-FO, PDF, GRDDL, Dublin Core"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.Creator" content="Reschke, J. F."></head><body><table summary="header information" class="header" border="0" cellpadding="1" cellspacing="1"><tr><td class="header left">RFC2629 through XSLT</td><td class="header right">J. F. Reschke</td></tr><tr><td class="header left"></td><td class="header right">greenbytes</td></tr><tr><td class="header left"></td><td class="header right">August 2009</td></tr></table><p class="title">Transforming RFC2629-formatted XML through XSLT</p><hr class="noprint"><h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1><ul class="toc"><li class="tocline0">1.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.1">Introduction</a></li><li class="tocline0">2.&nbsp;&nbsp;&nbsp;<a href="#supported.elements">Supported RFC2629 elements</a><ul class="toc"><li class="tocline1">2.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.1">Extension elements</a></li></ul></li><li class="tocline0">3.&nbsp;&nbsp;&nbsp;<a href="#processing.instructions">Processing Instructions</a><ul class="toc"><li class="tocline1">3.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.1">Supported xml2rfc-compatible PIs</a></li><li class="tocline1">3.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.2">Unsupported xml2rfc-compatible PIs</a></li><li class="tocline1">3.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.3">Extension PIs</a></li></ul></li><li class="tocline0">4.&nbsp;&nbsp;&nbsp;<a href="#anchors">Anchors</a></li><li class="tocline0">5.&nbsp;&nbsp;&nbsp;<a href="#xslt.engines">Supported XSLT engines</a><ul class="toc"><li class="tocline1">5.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.5.1">Standalone Engines</a></li><li class="tocline1">5.2&nbsp;&nbsp;&nbsp;<a href="#xslt.engines.browser">In-Browser Engines</a></li></ul></li><li class="tocline0">6.&nbsp;&nbsp;&nbsp;<a href="#output.html">Transforming to HTML</a><ul class="toc"><li class="tocline1">6.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.6.1">HTML compliance</a></li><li class="tocline1">6.2&nbsp;&nbsp;&nbsp;<a href="#html.link">Standard HTML LINK elements</a></li><li class="tocline1">6.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.6.3">Standard HTML metadata</a></li><li class="tocline1">6.4&nbsp;&nbsp;&nbsp;<a href="#rfc2731.properties">Dublin Core (RFC2731) metadata</a></li><li class="tocline1">6.5&nbsp;&nbsp;&nbsp;<a href="#hcard">Experimental hCard support</a></li></ul></li><li class="tocline0">7.&nbsp;&nbsp;&nbsp;<a href="#output.xhtml">Transforming to XHTML</a></li><li class="tocline0">8.&nbsp;&nbsp;&nbsp;<a href="#output.chm">Transforming to CHM (Microsoft Compiled Help)</a></li><li class="tocline0">9.&nbsp;&nbsp;&nbsp;<a href="#output.pdf">Transforming to PDF</a><ul class="toc"><li class="tocline1">9.1&nbsp;&nbsp;&nbsp;<a href="#output.pdf.fop">Via XSL-FO</a><ul class="toc"><li class="tocline1">9.1.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9.1.1">Extension feature matrix</a></li><li class="tocline1">9.1.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9.1.2">Example: producing output for Apache FOP</a></li></ul></li><li class="tocline1">9.2&nbsp;&nbsp;&nbsp;<a href="#output.pdf.html">Via X(HTML)</a></li></ul></li><li class="tocline0">10.&nbsp;&nbsp;&nbsp;<a href="#extensions">Generic Extensions</a><ul class="toc"><li class="tocline1">10.1&nbsp;&nbsp;&nbsp;<a href="#ext.element.abnf-char-sequence">&lt;abnf-char-sequence&gt; element</a></li><li class="tocline1">10.2&nbsp;&nbsp;&nbsp;<a href="#ext.element.anchor-alias">&lt;anchor-alias&gt; element</a></li><li class="tocline1">10.3&nbsp;&nbsp;&nbsp;<a href="#ext.element.bcp14">&lt;bcp14&gt; element</a></li><li class="tocline1">10.4&nbsp;&nbsp;&nbsp;<a href="#ext.element.bb">&lt;bb&gt; element</a></li><li class="tocline1">10.5&nbsp;&nbsp;&nbsp;<a href="#ext.element.bc">&lt;bc&gt; element</a></li><li class="tocline1">10.6&nbsp;&nbsp;&nbsp;<a href="#ext.element.blockquote">&lt;blockquote&gt; element</a></li><li class="tocline1">10.7&nbsp;&nbsp;&nbsp;<a href="#ext.element.boilerplate">&lt;boilerplate&gt; element</a></li><li class="tocline1">10.8&nbsp;&nbsp;&nbsp;<a href="#ext.element.bt">&lt;bt&gt; element</a></li><li class="tocline1">10.9&nbsp;&nbsp;&nbsp;<a href="#ext.element.dfn">&lt;dfn&gt; element</a></li><li class="tocline1">10.10&nbsp;&nbsp;&nbsp;<a href="#ext.element.h">&lt;h&gt; element</a></li><li class="tocline1">10.11&nbsp;&nbsp;&nbsp;<a href="#ext.element.highlight">&lt;highlight&gt; element</a></li><li class="tocline1">10.12&nbsp;&nbsp;&nbsp;<a href="#ext.element.length-of">&lt;length-of&gt; element</a></li><li class="tocline1">10.13&nbsp;&nbsp;&nbsp;<a href="#ext.element.link">&lt;link&gt; element</a></li><li class="tocline1">10.14&nbsp;&nbsp;&nbsp;<a href="#ext.element.lt">&lt;lt&gt; element</a></li><li class="tocline1">10.15&nbsp;&nbsp;&nbsp;<a href="#ext.element.note">&lt;note&gt; element</a></li><li class="tocline1">10.16&nbsp;&nbsp;&nbsp;<a href="#ext.element.parse-xml">&lt;parse-xml&gt; element</a></li><li class="tocline1">10.17&nbsp;&nbsp;&nbsp;<a href="#ext.element.q">&lt;q&gt; element</a></li><li class="tocline1">10.18&nbsp;&nbsp;&nbsp;<a href="#ext.element.ref">&lt;ref&gt; element</a></li><li class="tocline1">10.19&nbsp;&nbsp;&nbsp;<a href="#ext.element.source">&lt;source&gt; element</a></li><li class="tocline1">10.20&nbsp;&nbsp;&nbsp;<a href="#ext.element.sup">&lt;sup&gt; element</a></li><li class="tocline1">10.21&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.artwork">Extensions to Xml2rfc &lt;artwork&gt; element</a></li><li class="tocline1">10.22&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.iref">Extensions to Xml2rfc &lt;iref&gt; element</a></li><li class="tocline1">10.23&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.list">Extensions to Xml2rfc &lt;list&gt; element</a></li><li class="tocline1">10.24&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.rfc">Extensions to Xml2rfc &lt;rfc&gt; element</a></li><li class="tocline1">10.25&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.section">Extensions to Xml2rfc &lt;section&gt; element</a></li><li class="tocline1">10.26&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.xref">Extensions to Xml2rfc &lt;xref&gt; element</a></li></ul></li><li class="tocline0">11.&nbsp;&nbsp;&nbsp;<a href="#utilities">Utilities</a><ul class="toc"><li class="tocline1">11.1&nbsp;&nbsp;&nbsp;<a href="#checking-references">Checking References</a></li><li class="tocline1">11.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.11.2">Generating Graphs from References</a></li><li class="tocline1">11.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.11.3">Producing reference entries for books</a></li><li class="tocline1">11.4&nbsp;&nbsp;&nbsp;<a href="#clean-for-dtd">Down-converting to RFC2629bis DTD</a></li><li class="tocline1">11.5&nbsp;&nbsp;&nbsp;<a href="#extract-artwork">Extracting artwork</a></li><li class="tocline1">11.6&nbsp;&nbsp;&nbsp;<a href="#grddl">GRRDL</a></li></ul></li><li class="tocline0">12.&nbsp;&nbsp;&nbsp;<a href="#rfc.references">Informative References</a></li><li class="tocline0"><a href="#rfc.authors">Author's Address</a></li><li class="tocline0">A.&nbsp;&nbsp;&nbsp;<a href="#grammar">RELAX NG Compact Schema</a></li><li class="tocline0">B.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.B">Implementation Notes</a><ul class="toc"><li class="tocline1">B.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.B.1">Recognized type attributes for &lt;artwork&gt; element</a></li></ul></li><li class="tocline0">C.&nbsp;&nbsp;&nbsp;<a href="#examples">Examples</a><ul class="toc"><li class="tocline1">C.1&nbsp;&nbsp;&nbsp;<a href="#examples.internalsubset">Using the 'Internal Subset'</a></li><li class="tocline1">C.2&nbsp;&nbsp;&nbsp;<a href="#examples.customizing">Customization</a></li></ul></li><li class="tocline0">D.&nbsp;&nbsp;&nbsp;<a href="#license">License</a></li><li class="tocline0">E.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E">Change Logs</a><ul class="toc"><li class="tocline1">E.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.1">Package</a></li><li class="tocline1">E.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.2">amazon-asin.xslt</a></li><li class="tocline1">E.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.3">check-references.xslt</a></li><li class="tocline1">E.4&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.4">gen-reference-graph.xslt</a></li><li class="tocline1">E.5&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.5">rfc2629.xslt</a></li><li class="tocline1">E.6&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.6">rfc2629toFO.xslt</a></li><li class="tocline1">E.7&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.7">xsl11toAn.xslt</a></li><li class="tocline1">E.8&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.8">xsl11toFop.xslt</a></li><li class="tocline1">E.9&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.9">xsl11toFop-0.93.xslt</a></li><li class="tocline1">E.10&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.10">xsl11toXep.xslt</a></li></ul></li><li class="tocline0"><a href="#rfc.index">Index</a></li></ul><hr class="noprint"><h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;Introduction</h1><p id="rfc.section.1.p.1">This document describes a set of XSLT transformations that can be used to transform RFC2629-compliant XML (see <a href="#RFC2629" id="rfc.xref.RFC2629.1"><cite title="Writing I-Ds and RFCs using XML">[RFC2629]</cite></a>) to various output formats, such as HTML and PDF. The main topics are </p><ul><li>compliance to the xml2rfc XML element set (<a href="#supported.elements" title="Supported RFC2629 elements">Section&nbsp;2</a>),</li><li>support for xml2rfc processing instructions (<a href="#processing.instructions" title="Processing Instructions">Section&nbsp;3</a>),</li><li>the names of anchor elements generated in HTML and PDF output (<a href="#anchors" title="Anchors">Section&nbsp;4</a>),</li><li>various XSLT engines that can be used (<a href="#xslt.engines" title="Supported XSLT engines">Section&nbsp;5</a>),</li><li>outputting HTML (<a href="#output.html" title="Transforming to HTML">Section&nbsp;6</a>) and XHTML (<a href="#output.xhtml" title="Transforming to XHTML">Section&nbsp;7</a>),</li><li>outputting CHM (Compiled Microsoft Help, <a href="#output.chm" title="Transforming to CHM (Microsoft Compiled Help)">Section&nbsp;8</a>),</li><li>outputting PDF (<a href="#output.pdf" title="Transforming to PDF">Section&nbsp;9</a>),</li><li>extensions to the xml2rfc vocabulary (<a href="#extensions" title="Generic Extensions">Section&nbsp;10</a>).</li><li>various utilities (<a href="#utilities" title="Utilities">Section&nbsp;11</a>).</li></ul><p id="rfc.section.1.p.2">The full distribution is available at &lt;<a href="http://greenbytes.de/tech/webdav/rfc2629xslt.zip">http://greenbytes.de/tech/webdav/rfc2629xslt.zip</a>&gt;.</p><hr class="noprint"><h1 id="rfc.section.2" class="np"><a href="#rfc.section.2">2.</a>&nbsp;<a id="supported.elements" href="#supported.elements">Supported RFC2629 elements</a></h1><p id="rfc.section.2.p.1"> <samp>rfc2629.xslt</samp> supports both all RFC2629 grammar elements and the extensions implemented in xml2rfc 1.33.</p><h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;Extension elements</h2><p id="rfc.section.2.1.p.1"> <samp>rfc2629.xslt</samp> supports two kind of extension elements, using different XML namespaces.</p><p id="rfc.section.2.1.p.2">The first set contains (hopefully) generally useful extensions, see <a href="#extensions" title="Generic Extensions">Section&nbsp;10</a>.</p><p id="rfc.section.2.1.p.3">The second set is used for change and issue tracking and currently is not documented here. Please email the author in case you're interested in using these extensions.</p><hr class="noprint"><h1 id="rfc.section.3" class="np"><a href="#rfc.section.3">3.</a>&nbsp;<a id="processing.instructions" href="#processing.instructions">Processing Instructions</a></h1><p id="rfc.section.3.p.1">All PIs can be set as XSLT parameter as well, overriding any value that is found in the source file to be transformed.</p><div id="rfc.figure.u.1"></div> <p>Using processing instructions:</p>  <pre class="text">&lt;?rfc toc="yes"?&gt;
     365</style><link rel="Contents" href="#rfc.toc"><link rel="Author" href="#rfc.authors"><link rel="Index" href="#rfc.index"><link rel="Chapter" title="1 Introduction" href="#rfc.section.1"><link rel="Chapter" title="2 Supported RFC2629 elements" href="#rfc.section.2"><link rel="Chapter" title="3 Processing Instructions" href="#rfc.section.3"><link rel="Chapter" title="4 Anchors" href="#rfc.section.4"><link rel="Chapter" title="5 Supported XSLT engines" href="#rfc.section.5"><link rel="Chapter" title="6 Transforming to HTML" href="#rfc.section.6"><link rel="Chapter" title="7 Transforming to XHTML" href="#rfc.section.7"><link rel="Chapter" title="8 Transforming to CHM (Microsoft Compiled Help)" href="#rfc.section.8"><link rel="Chapter" title="9 Transforming to PDF" href="#rfc.section.9"><link rel="Chapter" title="10 Generic Extensions" href="#rfc.section.10"><link rel="Chapter" title="11 Utilities" href="#rfc.section.11"><link rel="Chapter" href="#rfc.section.12" title="12 Informative References"><link rel="Appendix" title="A RELAX NG Compact Schema" href="#rfc.section.A"><link rel="Appendix" title="B Implementation Notes" href="#rfc.section.B"><link rel="Appendix" title="C Examples" href="#rfc.section.C"><link rel="Appendix" title="D License" href="#rfc.section.D"><link rel="Appendix" title="E Change Logs" href="#rfc.section.E"><meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.475, 2009-10-02 10:40:00, XSLT vendor: SAXON 6.5.5 from Michael Kay http://saxon.sf.net/"><meta name="keywords" content="RFC2629, xml2rfc, XSLT, hCard, XSL-FO, PDF, GRDDL, Dublin Core"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.Creator" content="Reschke, J. F."></head><body><table class="header" border="0" cellpadding="1" cellspacing="1"><tr><td class="header left">RFC2629 through XSLT</td><td class="header right">J. F. Reschke</td></tr><tr><td class="header left"></td><td class="header right">greenbytes</td></tr><tr><td class="header left"></td><td class="header right">September 2009</td></tr></table><p class="title">Transforming RFC2629-formatted XML through XSLT</p><hr class="noprint"><h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1><ul class="toc"><li class="tocline0">1.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.1">Introduction</a></li><li class="tocline0">2.&nbsp;&nbsp;&nbsp;<a href="#supported.elements">Supported RFC2629 elements</a><ul class="toc"><li class="tocline1">2.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.2.1">Extension elements</a></li></ul></li><li class="tocline0">3.&nbsp;&nbsp;&nbsp;<a href="#processing.instructions">Processing Instructions</a><ul class="toc"><li class="tocline1">3.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.1">Supported xml2rfc-compatible PIs</a></li><li class="tocline1">3.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.2">Unsupported xml2rfc-compatible PIs</a></li><li class="tocline1">3.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.3.3">Extension PIs</a></li></ul></li><li class="tocline0">4.&nbsp;&nbsp;&nbsp;<a href="#anchors">Anchors</a></li><li class="tocline0">5.&nbsp;&nbsp;&nbsp;<a href="#xslt.engines">Supported XSLT engines</a><ul class="toc"><li class="tocline1">5.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.5.1">Standalone Engines</a></li><li class="tocline1">5.2&nbsp;&nbsp;&nbsp;<a href="#xslt.engines.browser">In-Browser Engines</a></li></ul></li><li class="tocline0">6.&nbsp;&nbsp;&nbsp;<a href="#output.html">Transforming to HTML</a><ul class="toc"><li class="tocline1">6.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.6.1">HTML compliance</a></li><li class="tocline1">6.2&nbsp;&nbsp;&nbsp;<a href="#html.link">Standard HTML LINK elements</a></li><li class="tocline1">6.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.6.3">Standard HTML metadata</a></li><li class="tocline1">6.4&nbsp;&nbsp;&nbsp;<a href="#rfc2731.properties">Dublin Core (RFC2731) metadata</a></li><li class="tocline1">6.5&nbsp;&nbsp;&nbsp;<a href="#hcard">Experimental hCard support</a></li></ul></li><li class="tocline0">7.&nbsp;&nbsp;&nbsp;<a href="#output.xhtml">Transforming to XHTML</a></li><li class="tocline0">8.&nbsp;&nbsp;&nbsp;<a href="#output.chm">Transforming to CHM (Microsoft Compiled Help)</a></li><li class="tocline0">9.&nbsp;&nbsp;&nbsp;<a href="#output.pdf">Transforming to PDF</a><ul class="toc"><li class="tocline1">9.1&nbsp;&nbsp;&nbsp;<a href="#output.pdf.fop">Via XSL-FO</a><ul class="toc"><li class="tocline1">9.1.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9.1.1">Extension feature matrix</a></li><li class="tocline1">9.1.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.9.1.2">Example: producing output for Apache FOP</a></li></ul></li><li class="tocline1">9.2&nbsp;&nbsp;&nbsp;<a href="#output.pdf.html">Via X(HTML)</a></li></ul></li><li class="tocline0">10.&nbsp;&nbsp;&nbsp;<a href="#extensions">Generic Extensions</a><ul class="toc"><li class="tocline1">10.1&nbsp;&nbsp;&nbsp;<a href="#ext.element.abnf-char-sequence">&lt;abnf-char-sequence&gt; element</a></li><li class="tocline1">10.2&nbsp;&nbsp;&nbsp;<a href="#ext.element.anchor-alias">&lt;anchor-alias&gt; element</a></li><li class="tocline1">10.3&nbsp;&nbsp;&nbsp;<a href="#ext.element.bcp14">&lt;bcp14&gt; element</a></li><li class="tocline1">10.4&nbsp;&nbsp;&nbsp;<a href="#ext.element.bb">&lt;bb&gt; element</a></li><li class="tocline1">10.5&nbsp;&nbsp;&nbsp;<a href="#ext.element.bc">&lt;bc&gt; element</a></li><li class="tocline1">10.6&nbsp;&nbsp;&nbsp;<a href="#ext.element.blockquote">&lt;blockquote&gt; element</a></li><li class="tocline1">10.7&nbsp;&nbsp;&nbsp;<a href="#ext.element.boilerplate">&lt;boilerplate&gt; element</a></li><li class="tocline1">10.8&nbsp;&nbsp;&nbsp;<a href="#ext.element.bt">&lt;bt&gt; element</a></li><li class="tocline1">10.9&nbsp;&nbsp;&nbsp;<a href="#ext.element.dfn">&lt;dfn&gt; element</a></li><li class="tocline1">10.10&nbsp;&nbsp;&nbsp;<a href="#ext.element.h">&lt;h&gt; element</a></li><li class="tocline1">10.11&nbsp;&nbsp;&nbsp;<a href="#ext.element.highlight">&lt;highlight&gt; element</a></li><li class="tocline1">10.12&nbsp;&nbsp;&nbsp;<a href="#ext.element.length-of">&lt;length-of&gt; element</a></li><li class="tocline1">10.13&nbsp;&nbsp;&nbsp;<a href="#ext.element.link">&lt;link&gt; element</a></li><li class="tocline1">10.14&nbsp;&nbsp;&nbsp;<a href="#ext.element.lt">&lt;lt&gt; element</a></li><li class="tocline1">10.15&nbsp;&nbsp;&nbsp;<a href="#ext.element.note">&lt;note&gt; element</a></li><li class="tocline1">10.16&nbsp;&nbsp;&nbsp;<a href="#ext.element.parse-xml">&lt;parse-xml&gt; element</a></li><li class="tocline1">10.17&nbsp;&nbsp;&nbsp;<a href="#ext.element.q">&lt;q&gt; element</a></li><li class="tocline1">10.18&nbsp;&nbsp;&nbsp;<a href="#ext.element.ref">&lt;ref&gt; element</a></li><li class="tocline1">10.19&nbsp;&nbsp;&nbsp;<a href="#ext.element.source">&lt;source&gt; element</a></li><li class="tocline1">10.20&nbsp;&nbsp;&nbsp;<a href="#ext.element.sup">&lt;sup&gt; element</a></li><li class="tocline1">10.21&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.artwork">Extensions to Xml2rfc &lt;artwork&gt; element</a></li><li class="tocline1">10.22&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.iref">Extensions to Xml2rfc &lt;iref&gt; element</a></li><li class="tocline1">10.23&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.list">Extensions to Xml2rfc &lt;list&gt; element</a></li><li class="tocline1">10.24&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.rfc">Extensions to Xml2rfc &lt;rfc&gt; element</a></li><li class="tocline1">10.25&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.section">Extensions to Xml2rfc &lt;section&gt; element</a></li><li class="tocline1">10.26&nbsp;&nbsp;&nbsp;<a href="#ext-rfc2629.xref">Extensions to Xml2rfc &lt;xref&gt; element</a></li></ul></li><li class="tocline0">11.&nbsp;&nbsp;&nbsp;<a href="#utilities">Utilities</a><ul class="toc"><li class="tocline1">11.1&nbsp;&nbsp;&nbsp;<a href="#checking-references">Checking References</a></li><li class="tocline1">11.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.11.2">Generating Graphs from References</a></li><li class="tocline1">11.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.11.3">Producing reference entries for books</a></li><li class="tocline1">11.4&nbsp;&nbsp;&nbsp;<a href="#clean-for-dtd">Down-converting to RFC2629bis DTD</a></li><li class="tocline1">11.5&nbsp;&nbsp;&nbsp;<a href="#extract-artwork">Extracting artwork</a></li><li class="tocline1">11.6&nbsp;&nbsp;&nbsp;<a href="#grddl">GRRDL</a></li></ul></li><li class="tocline0">12.&nbsp;&nbsp;&nbsp;<a href="#rfc.references">Informative References</a></li><li class="tocline0"><a href="#rfc.authors">Author's Address</a></li><li class="tocline0">A.&nbsp;&nbsp;&nbsp;<a href="#grammar">RELAX NG Compact Schema</a></li><li class="tocline0">B.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.B">Implementation Notes</a><ul class="toc"><li class="tocline1">B.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.B.1">Recognized type attributes for &lt;artwork&gt; element</a></li></ul></li><li class="tocline0">C.&nbsp;&nbsp;&nbsp;<a href="#examples">Examples</a><ul class="toc"><li class="tocline1">C.1&nbsp;&nbsp;&nbsp;<a href="#examples.internalsubset">Using the 'Internal Subset'</a></li><li class="tocline1">C.2&nbsp;&nbsp;&nbsp;<a href="#examples.customizing">Customization</a></li></ul></li><li class="tocline0">D.&nbsp;&nbsp;&nbsp;<a href="#license">License</a></li><li class="tocline0">E.&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E">Change Logs</a><ul class="toc"><li class="tocline1">E.1&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.1">Package</a></li><li class="tocline1">E.2&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.2">amazon-asin.xslt</a></li><li class="tocline1">E.3&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.3">check-references.xslt</a></li><li class="tocline1">E.4&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.4">gen-reference-graph.xslt</a></li><li class="tocline1">E.5&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.5">rfc2629.xslt</a></li><li class="tocline1">E.6&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.6">rfc2629toFO.xslt</a></li><li class="tocline1">E.7&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.7">xsl11toAn.xslt</a></li><li class="tocline1">E.8&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.8">xsl11toFop.xslt</a></li><li class="tocline1">E.9&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.9">xsl11toFop-0.95.xslt</a></li><li class="tocline1">E.10&nbsp;&nbsp;&nbsp;<a href="#rfc.section.E.10">xsl11toXep.xslt</a></li></ul></li><li class="tocline0"><a href="#rfc.index">Index</a></li></ul><hr class="noprint"><h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;Introduction</h1><p id="rfc.section.1.p.1">This document describes a set of XSLT transformations that can be used to transform RFC2629-compliant XML (see <a href="#RFC2629" id="rfc.xref.RFC2629.1"><cite title="Writing I-Ds and RFCs using XML">[RFC2629]</cite></a>) to various output formats, such as HTML and PDF. The main topics are </p><ul><li>compliance to the xml2rfc XML element set (<a href="#supported.elements" title="Supported RFC2629 elements">Section&nbsp;2</a>),</li><li>support for xml2rfc processing instructions (<a href="#processing.instructions" title="Processing Instructions">Section&nbsp;3</a>),</li><li>the names of anchor elements generated in HTML and PDF output (<a href="#anchors" title="Anchors">Section&nbsp;4</a>),</li><li>various XSLT engines that can be used (<a href="#xslt.engines" title="Supported XSLT engines">Section&nbsp;5</a>),</li><li>outputting HTML (<a href="#output.html" title="Transforming to HTML">Section&nbsp;6</a>) and XHTML (<a href="#output.xhtml" title="Transforming to XHTML">Section&nbsp;7</a>),</li><li>outputting CHM (Compiled Microsoft Help, <a href="#output.chm" title="Transforming to CHM (Microsoft Compiled Help)">Section&nbsp;8</a>),</li><li>outputting PDF (<a href="#output.pdf" title="Transforming to PDF">Section&nbsp;9</a>),</li><li>extensions to the xml2rfc vocabulary (<a href="#extensions" title="Generic Extensions">Section&nbsp;10</a>).</li><li>various utilities (<a href="#utilities" title="Utilities">Section&nbsp;11</a>).</li></ul><p id="rfc.section.1.p.2">The full distribution is available at &lt;<a href="http://greenbytes.de/tech/webdav/rfc2629xslt.zip">http://greenbytes.de/tech/webdav/rfc2629xslt.zip</a>&gt;.</p><hr class="noprint"><h1 id="rfc.section.2" class="np"><a href="#rfc.section.2">2.</a>&nbsp;<a id="supported.elements" href="#supported.elements">Supported RFC2629 elements</a></h1><p id="rfc.section.2.p.1"> <samp>rfc2629.xslt</samp> supports both all RFC2629 grammar elements and the extensions implemented in xml2rfc 1.33.</p><h2 id="rfc.section.2.1"><a href="#rfc.section.2.1">2.1</a>&nbsp;Extension elements</h2><p id="rfc.section.2.1.p.1"> <samp>rfc2629.xslt</samp> supports two kind of extension elements, using different XML namespaces.</p><p id="rfc.section.2.1.p.2">The first set contains (hopefully) generally useful extensions, see <a href="#extensions" title="Generic Extensions">Section&nbsp;10</a>.</p><p id="rfc.section.2.1.p.3">The second set is used for change and issue tracking and currently is not documented here. Please email the author in case you're interested in using these extensions.</p><hr class="noprint"><h1 id="rfc.section.3" class="np"><a href="#rfc.section.3">3.</a>&nbsp;<a id="processing.instructions" href="#processing.instructions">Processing Instructions</a></h1><p id="rfc.section.3.p.1">All PIs can be set as XSLT parameter as well, overriding any value that is found in the source file to be transformed.</p><div id="rfc.figure.u.1"></div> <p>Using processing instructions:</p>  <pre class="text">&lt;?rfc toc="yes"?&gt;
    366366&lt;?rfc-ext support-rfc2731="no"?&gt;
    367367</pre> <div id="rfc.figure.u.2"></div> <p>Using XSLT parameters (Saxon):</p>  <pre class="text">java -cp saxon.jar com.icl.saxon.StyleSheet source.xml rfc2629.xslt \
     
    370370   --param xml2rfc-ext-support-rfc2731 '"no"' \
    371371   rfc2629.xslt source.xml &gt; result.html
    372 </pre>  <p>(note the required quoting of string parameters)<span id="rfc.iref.x.1"></span></p> <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a>&nbsp;Supported xml2rfc-compatible PIs</h2><div id="rfc.table.u.1"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>XSLT parameter name</th><th>default</th><th>comment</th></tr></thead><tbody><tr><td>rfc</td><td>background<div id="rfc.iref.b.1"></div><div id="rfc.iref.p.1"></div></td><td>xml2rfc-background<div id="rfc.iref.x.2"></div>  <div id="rfc.iref.p.2"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>compact<div id="rfc.iref.c.1"></div><div id="rfc.iref.p.3"></div></td><td>xml2rfc-compact<div id="rfc.iref.x.3"></div>  <div id="rfc.iref.p.4"></div></td><td>"no"</td><td>only applies to HTML output method when printing</td></tr><tr><td>rfc</td><td>comments<div id="rfc.iref.c.2"></div><div id="rfc.iref.p.5"></div></td><td>xml2rfc-comments<div id="rfc.iref.x.4"></div>  <div id="rfc.iref.p.6"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>editing<div id="rfc.iref.e.1"></div><div id="rfc.iref.p.7"></div></td><td>xml2rfc-editing<div id="rfc.iref.x.5"></div>  <div id="rfc.iref.p.8"></div></td><td>"no"</td><td></td></tr><tr><td>rfc</td><td>footer<div id="rfc.iref.f.1"></div><div id="rfc.iref.p.9"></div></td><td>xml2rfc-footer<div id="rfc.iref.x.6"></div>  <div id="rfc.iref.p.10"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>header<div id="rfc.iref.h.1"></div><div id="rfc.iref.p.11"></div></td><td>xml2rfc-header<div id="rfc.iref.x.7"></div>  <div id="rfc.iref.p.12"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>inline<div id="rfc.iref.i.1"></div><div id="rfc.iref.p.13"></div></td><td>xml2rfc-inline<div id="rfc.iref.x.8"></div>  <div id="rfc.iref.p.14"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>iprnotified<div id="rfc.iref.i.2"></div><div id="rfc.iref.p.15"></div></td><td>xml2rfc-iprnotified<div id="rfc.iref.x.9"></div>  <div id="rfc.iref.p.16"></div></td><td>"no"</td><td></td></tr><tr><td>rfc</td><td>linkmailto<div id="rfc.iref.l.1"></div><div id="rfc.iref.p.17"></div></td><td>xml2rfc-linkmailto<div id="rfc.iref.x.10"></div>  <div id="rfc.iref.p.18"></div></td><td>"yes"</td><td></td></tr><tr><td>rfc</td><td>private<div id="rfc.iref.p.19"></div><div id="rfc.iref.p.20"></div></td><td>xml2rfc-private<div id="rfc.iref.x.11"></div>  <div id="rfc.iref.p.21"></div></td><td>(not set)</td><td></td></tr><tr><td>rfc</td><td>rfcedstyle<div id="rfc.iref.r.1"></div><div id="rfc.iref.p.22"></div></td><td>xml2rfc-rfcedstyle<div id="rfc.iref.x.12"></div>  <div id="rfc.iref.p.23"></div></td><td>(not set)</td><td>(limited support)</td></tr><tr><td>rfc</td><td>sortrefs<div id="rfc.iref.s.1"></div><div id="rfc.iref.p.24"></div></td><td>xml2rfc-sortrefs<div id="rfc.iref.x.13"></div>  <div id="rfc.iref.p.25"></div></td><td>"no"</td><td></td></tr><tr><td>rfc</td><td>symrefs<div id="rfc.iref.s.2"></div><div id="rfc.iref.p.26"></div></td><td>xml2rfc-symrefs<div id="rfc.iref.x.14"></div>  <div id="rfc.iref.p.27"></div></td><td>"yes"</td><td>The default has changed from "no" to "yes" as of June 6, 2007 and xml2rfc 1.33pre4.</td></tr><tr><td>rfc</td><td>toc<div id="rfc.iref.t.1"></div><div id="rfc.iref.p.28"></div></td><td>xml2rfc-toc<div id="rfc.iref.x.15"></div>  <div id="rfc.iref.p.29"></div></td><td>"no"</td><td></td></tr><tr><td>rfc</td><td>tocdepth<div id="rfc.iref.t.2"></div><div id="rfc.iref.p.30"></div></td><td>xml2rfc-tocdepth<div id="rfc.iref.x.16"></div>  <div id="rfc.iref.p.31"></div></td><td>99</td><td></td></tr><tr><td>rfc</td><td>topblock<div id="rfc.iref.t.3"></div><div id="rfc.iref.p.32"></div></td><td>xml2rfc-topblock<div id="rfc.iref.x.17"></div>  <div id="rfc.iref.p.33"></div></td><td>"yes"</td><td></td></tr></tbody></table></div><h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;Unsupported xml2rfc-compatible PIs</h2><div id="rfc.table.u.2"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>comment</th></tr></thead><tbody><tr><td>rfc</td><td>include<div id="rfc.iref.i.3"></div><div id="rfc.iref.p.34"></div></td><td>incompatible with XML/XSLT processing model, please use external entities instead</td></tr><tr><td>rfc</td><td>needLines<div id="rfc.iref.n.1"></div><div id="rfc.iref.p.35"></div></td><td></td></tr><tr><td>rfc</td><td>slides<div id="rfc.iref.s.3"></div><div id="rfc.iref.p.36"></div></td><td></td></tr><tr><td>rfc</td><td>strict<div id="rfc.iref.s.4"></div><div id="rfc.iref.p.37"></div></td><td></td></tr><tr><td>rfc</td><td>subcompact<div id="rfc.iref.s.5"></div><div id="rfc.iref.p.38"></div></td><td></td></tr><tr><td>rfc</td><td>tocindent<div id="rfc.iref.t.4"></div><div id="rfc.iref.p.39"></div></td><td>(defaults to "yes")</td></tr><tr><td>rfc</td><td>tocompact<div id="rfc.iref.t.5"></div><div id="rfc.iref.p.40"></div></td><td></td></tr></tbody></table></div><h2 id="rfc.section.3.3"><a href="#rfc.section.3.3">3.3</a>&nbsp;Extension PIs</h2><div id="rfc.table.u.3"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>XSLT parameter name</th><th>default</th><th>description</th></tr></thead><tbody><tr><td>rfc-ext</td><td>allow-markup-in-artwork<div id="rfc.iref.a.1"></div><div id="rfc.iref.p.41"></div></td><td>xml2rfc-allow-markup-in-artwork<div id="rfc.iref.x.18"></div>  <div id="rfc.iref.p.42"></div></td><td>"no"</td><td>Enables support for specific elements inside abstract elements (using this extension makes the document incompatible to the RFC2629bis DTD; see description of conversion XSLT in <a href="#clean-for-dtd" title="Down-converting to RFC2629bis DTD">Section&nbsp;11.4</a>).</td></tr><tr><td>rfc-ext</td><td>authors-section<div id="rfc.iref.a.2"></div><div id="rfc.iref.p.43"></div></td><td>xml2rfc-ext-authors-section<div id="rfc.iref.x.19"></div>  <div id="rfc.iref.p.44"></div></td><td></td><td>When "end", place the authors section at the end (just before the copyright statements). This seems to be the preferred order in the newest RFCs.</td></tr><tr><td>rfc-ext</td><td>duplex<div id="rfc.iref.d.1"></div><div id="rfc.iref.p.45"></div></td><td>xml2rfc-ext-duplex<div id="rfc.iref.x.20"></div>  <div id="rfc.iref.p.46"></div></td><td>no</td><td>When set to "yes", format the PDF output for doublesided printing.</td></tr><tr><td>rfc-ext</td><td>include-references-in-index<div id="rfc.iref.i.4"></div><div id="rfc.iref.p.47"></div></td><td>xml2rfc-ext-include-references-in-index<div id="rfc.iref.x.21"></div>  <div id="rfc.iref.p.48"></div></td><td></td><td>When set to "yes", index entries are generated for all references.</td></tr><tr><td>rfc-ext</td><td>justification<div id="rfc.iref.j.1"></div><div id="rfc.iref.p.49"></div></td><td>xml2rfc-ext-justification<div id="rfc.iref.x.22"></div>  <div id="rfc.iref.p.50"></div></td><td>"never"</td><td>"never": never emit justified text, "always": always emit justified text, "print": only emit justified text for print media.</td></tr><tr><td>rfc-ext</td><td>parse-xml-in-artwork<div id="rfc.iref.p.51"></div><div id="rfc.iref.p.52"></div></td><td>xml2rfc-parse-xml-in-artwork<div id="rfc.iref.x.23"></div>  <div id="rfc.iref.p.53"></div></td><td>"no"</td><td>May be used to enable parsing of XML content in figures (MSXML only).</td></tr><tr><td>rfc-ext</td><td>support-rfc2731<div id="rfc.iref.s.6"></div><div id="rfc.iref.p.54"></div></td><td>xml2rfc-ext-support-rfc2731<div id="rfc.iref.x.24"></div>  <div id="rfc.iref.p.55"></div></td><td>"yes"</td><td>Decides whether the HTML transformation should generate META tags according <a href="#rfc2731.properties" title="Dublin Core (RFC2731) metadata">Section&nbsp;6.4</a>.</td></tr><tr><td>rfc-ext</td><td>sec-no-trailing-dots<div id="rfc.iref.s.7"></div><div id="rfc.iref.p.56"></div></td><td>xml2rfc-ext-sec-no-trailing-dots<div id="rfc.iref.x.25"></div>  <div id="rfc.iref.p.57"></div></td><td></td><td>When set to "yes", add trailing dots to section numbers. This seems to be the preferred format in the newest RFCs.</td></tr></tbody></table></div><hr class="noprint"><h1 id="rfc.section.4" class="np"><a href="#rfc.section.4">4.</a>&nbsp;<a id="anchors" href="#anchors">Anchors</a></h1><p id="rfc.section.4.p.1">The transformation automatically generates anchors that are supposed to be stable and predictable and that can be used to identify specific parts of the document. Anchors are generated both in HTML and XSL-FO content (but the latter will only be used for PDF output when the XSL-FO engine supports producing PDF anchors).</p><div id="rfc.table.u.4"><p>The following anchors get auto-generated:</p><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>Anchor name</th><th>Description</th></tr></thead><tbody><tr><td>rfc.abstract <div id="rfc.iref.r.2"></div><div id="rfc.iref.a.3"></div></td><td>Abstract</td></tr><tr><td>rfc.authors <div id="rfc.iref.r.3"></div><div id="rfc.iref.a.4"></div></td><td>Authors section</td></tr><tr><td>rfc.copyright <div id="rfc.iref.r.4"></div><div id="rfc.iref.a.5"></div></td><td>Copyright section</td></tr><tr><td>rfc.copyrightnotice <div id="rfc.iref.r.5"></div><div id="rfc.iref.a.6"></div></td><td>Copyright notice</td></tr><tr><td>rfc.figure.<em>n</em>  <div id="rfc.iref.r.6"></div><div id="rfc.iref.a.7"></div></td><td>Figures (titled)</td></tr><tr><td>rfc.figure.u.<em>n</em>  <div id="rfc.iref.r.7"></div><div id="rfc.iref.a.8"></div></td><td>Figures (untitled)</td></tr><tr><td>rfc.index <div id="rfc.iref.r.8"></div><div id="rfc.iref.a.9"></div></td><td>Index</td></tr><tr><td>rfc.ipr <div id="rfc.iref.r.9"></div><div id="rfc.iref.a.10"></div></td><td>Intellectual Property</td></tr><tr><td>rfc.iref.<em>n</em>  <div id="rfc.iref.r.10"></div><div id="rfc.iref.a.11"></div></td><td>Internal references</td></tr><tr><td>rfc.note.<em>n</em>  <div id="rfc.iref.r.11"></div><div id="rfc.iref.a.12"></div></td><td>Notes (from front section)</td></tr><tr><td>rfc.references <div id="rfc.iref.r.12"></div><div id="rfc.iref.a.13"></div></td><td>References</td></tr><tr><td>rfc.references.<em>n</em>  <div id="rfc.iref.r.13"></div><div id="rfc.iref.a.14"></div></td><td>Additional references</td></tr><tr><td>rfc.section.<em>n</em>  <div id="rfc.iref.r.14"></div><div id="rfc.iref.a.15"></div></td><td>Section <em>n</em></td></tr><tr><td>rfc.section.<em>n</em>.p.<em>m</em>  <div id="rfc.iref.r.15"></div><div id="rfc.iref.a.16"></div></td><td>Section <em>n</em>, paragraph <em>m</em></td></tr><tr><td>rfc.status <div id="rfc.iref.r.16"></div><div id="rfc.iref.a.17"></div></td><td>Status of memo</td></tr><tr><td>rfc.table.<em>n</em>  <div id="rfc.iref.r.17"></div><div id="rfc.iref.a.18"></div></td><td>Tables (titled)</td></tr><tr><td>rfc.table.u.<em>n</em>  <div id="rfc.iref.r.18"></div><div id="rfc.iref.a.19"></div></td><td>Tables (untitled)</td></tr><tr><td>rfc.toc <div id="rfc.iref.r.19"></div><div id="rfc.iref.a.20"></div></td><td>Table of contents</td></tr><tr><td>rfc.xref.<em>name</em>.<em>n</em>  <div id="rfc.iref.r.20"></div><div id="rfc.iref.a.21"></div></td><td>References to reference <em>n</em> to <em>name</em></td></tr></tbody></table></div><hr class="noprint"><h1 id="rfc.section.5" class="np"><a href="#rfc.section.5">5.</a>&nbsp;<a id="xslt.engines" href="#xslt.engines">Supported XSLT engines</a></h1><p id="rfc.section.5.p.1">The transformation requires a non-standard extension function (see <a href="http://www.exslt.org/exsl/functions/node-set/exsl.node-set.html">exsl:node-set</a>) which is however widely available. XSLT processors that do not support this extension (or a functional equivalent) currently are not supported.</p><h2 id="rfc.section.5.1"><a href="#rfc.section.5.1">5.1</a>&nbsp;Standalone Engines</h2><p id="rfc.section.5.1.p.1">The following XSLT engines are believed to work well: </p><ul><li>Windows: <span id="rfc.iref.m.1"></span><span id="rfc.iref.m.2"></span>MSXML3 and MSXML4 (&lt;<a href="http://msdn.microsoft.com/xml">http://msdn.microsoft.com/xml</a>&gt;; command line processor "msxsl" is available from <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2FB55371-C94E-4373-B0E9-DB4816552E41">Microsoft Download Center</a>)</li><li>Java: <span id="rfc.iref.s.8"></span>Saxon (&lt;<a href="http://saxon.sourceforge.net/">http://saxon.sourceforge.net/</a>&gt;)</li><li>Java: <span id="rfc.iref.x.26"></span>Xalan (&lt;<a href="http://xml.apache.org/xalan-j/">http://xml.apache.org/xalan-j/</a>&gt;)</li><li>C/C++: <span id="rfc.iref.x.27"></span>xsltproc (libxslt) (&lt;<a href="http://xmlsoft.org/XSLT/">http://xmlsoft.org/XSLT/</a>&gt;, make sure that you have a current version)</li></ul><h2 id="rfc.section.5.2"><a href="#rfc.section.5.2">5.2</a>&nbsp;<a id="xslt.engines.browser" href="#xslt.engines.browser">In-Browser Engines</a></h2><p id="rfc.section.5.2.p.1">The following browsers seem to work fine: </p><ul><li><p><span id="rfc.iref.i.5"></span>Internet Explorer 5.5 (Windows version, if MSXML3 is installed)</p></li><li><p><span id="rfc.iref.i.6"></span><span id="rfc.iref.i.7"></span><span id="rfc.iref.i.8"></span>Internet Explorer 6 and newer</p></li><li><div id="firefox3"><p><span id="rfc.iref.m.3"></span><span id="rfc.iref.f.2"></span>Firefox 3.0 and newer</p></div><p> </p><ul><li>Be aware that XSLT execution can be suppressed using <span id="rfc.iref.n.2"></span><a href="https://addons.mozilla.org/de/firefox/addon/722">NoScript</a></li><li>Firefox does not load external DTDs nor external entities, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=22942">Mozilla Bug 22942</a>, thus entities like &amp;nbsp; need to be declared in the internal subset (<a href="#examples.internalsubset" title="Using the 'Internal Subset'">Appendix&nbsp;C.1</a>)</li></ul></li><li><p><span id="rfc.iref.s.9"></span><span id="rfc.iref.s.10"></span>Safari 3 (starting with version 3.0.4)</p></li><li><p><span id="rfc.iref.g.1"></span>Google Chrome (beta available)</p></li><li><p><span id="rfc.iref.o.1"></span>Opera 10 (beta version available)</p></li></ul><p id="rfc.section.5.2.p.2">The following browsers are known not to work properly: </p><ul><li><div id="firefox12"><p><span id="rfc.iref.m.4"></span><span id="rfc.iref.f.3"></span>Firefox 1.*/2.*: (missing extension function - see change request at Mozilla BugZilla <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=193678">193678</a>)</p></div></li><li><div id="opera"><p><span id="rfc.iref.o.2"></span>Opera 9.21: execution fails, potentially to a somewhat complex XPath expression (reported to Opera as bug 245725).</p></div></li><li><p>Opera 9.5 and 9.6: transformation appears to work, but CSS isn't getting applied (reported to Opera as bug 337388 on 2008-06-12).</p></li><li><div id="safari"><p><span id="rfc.iref.s.11"></span>Safari 2.* supports client-side XSLT as of MacOS X 10.4, but misses required extension functions. A problem with stylesheets producing non-ASCII output (such as NBSP characters) has been fixed as of OSX 10.4.4. Both problems have been reported through Apple's bug tracking system, see &lt;<a href="http://drakken.dbc.mtview.ca.us/pipermail/xml2rfc/2005-May/002073.html">http://drakken.dbc.mtview.ca.us/pipermail/xml2rfc/2005-May/002073.html</a>&gt; and &lt;<a href="http://bugs.webkit.org/show_bug.cgi?id=4079">http://bugs.webkit.org/show_bug.cgi?id=4079</a>&gt;.</p></div></li></ul><hr class="noprint"><h1 id="rfc.section.6" class="np"><a href="#rfc.section.6">6.</a>&nbsp;<a id="output.html" href="#output.html">Transforming to HTML</a></h1><p id="rfc.section.6.p.1">Transformation to HTML can be done inside the browser if it supports XSLT. To enable this, add the following processing instruction to the start of the source file:</p><div id="rfc.iref.x.28"></div><div id="rfc.figure.u.4"></div><pre class="text">  &lt;?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?&gt;
    373 </pre><p id="rfc.section.6.p.3">(and ensure that <samp>rfc2629.xslt</samp> is present).</p><h2 id="rfc.section.6.1"><a href="#rfc.section.6.1">6.1</a>&nbsp;HTML compliance</h2><p id="rfc.section.6.1.p.1">The transformation result is supposed to conform to the HTML 4.01 strict DTD <a href="#HTML" id="rfc.xref.HTML.1"><cite title="HTML 4.01 Specification">[HTML]</cite></a>. This can be checked using the W3C's online validator at &lt;<a href="http://validator.w3.org">http://validator.w3.org</a>&gt;<span id="rfc.iref.h.2"></span>.</p><h2 id="rfc.section.6.2"><a href="#rfc.section.6.2">6.2</a>&nbsp;<a id="html.link" href="#html.link">Standard HTML LINK elements</a></h2><p id="rfc.section.6.2.p.1">LINK elements exist since HTML 2.0. They can be used to embed content-independant links inside the document. Unfortunately, only few user agents support this element. Firefox users may want to check the <a href="https://addons.mozilla.org/firefox/2933/">Link Widgets</a> extension.</p><div id="rfc.table.u.5"><p>The following LINK elements are produced:</p><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>LINK type</th><th>description</th></tr></thead><tbody><tr><td>alternate<div id="rfc.iref.a.22"></div><div id="rfc.iref.h.3"></div></td><td>for RFCs, a link to the authorative ASCII version on the IETF web site</td></tr><tr><td>appendic<div id="rfc.iref.a.23"></div><div id="rfc.iref.h.4"></div></td><td>pointer to all top-level appendics</td></tr><tr><td>author<div id="rfc.iref.a.24"></div><div id="rfc.iref.h.5"></div></td><td>pointer to "authors" section</td></tr><tr><td>chapter<div id="rfc.iref.c.3"></div><div id="rfc.iref.h.6"></div></td><td>pointer to all top-level sections</td></tr><tr><td>contents<div id="rfc.iref.c.4"></div><div id="rfc.iref.h.7"></div></td><td>pointer to table of contents</td></tr><tr><td>copyright<div id="rfc.iref.c.5"></div><div id="rfc.iref.h.8"></div></td><td>pointer to copyright statement</td></tr><tr><td>index<div id="rfc.iref.i.9"></div><div id="rfc.iref.h.9"></div></td><td>pointer to index</td></tr></tbody></table></div><div id="rfc.figure.u.5"></div> <p>The figure below shows how Mozilla Firefox 1.0 displays the Site Navigation Bar for rfc2396.xml.</p>  <p><img src="rfc2629xslt-fig1.png" alt="&#xA;(LINK elements displayed in Mozilla Firefox for RFC2396.xml)&#xA;" width="509" height="235"></p> <h2 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3</a>&nbsp;Standard HTML metadata</h2><div id="rfc.table.u.6"><p>The following standard HTML META elements are produced:</p><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>META name</th><th>description</th></tr></thead><tbody><tr><td>generator<div id="rfc.iref.g.2"></div><div id="rfc.iref.h.10"></div></td><td>from XSLT engine version and stylesheet version</td></tr><tr><td>keywords<div id="rfc.iref.k.1"></div><div id="rfc.iref.h.11"></div></td><td>from keyword elements in front section</td></tr></tbody></table></div><h2 id="rfc.section.6.4"><a href="#rfc.section.6.4">6.4</a>&nbsp;<a id="rfc2731.properties" href="#rfc2731.properties">Dublin Core (RFC2731) metadata</a></h2><p id="rfc.section.6.4.p.1">Unless turned off using the "rfc-ext support-rfc2731" processing instruction, the transformation will generate metadata according to <a href="#RFC2731" id="rfc.xref.RFC2731.1"><cite title="Encoding Dublin Core Metadata in HTML">[RFC2731]</cite></a> and <a href="#DC-HTML" id="rfc.xref.DC-HTML.1"><cite title="Expressing Dublin Core metadata using HTML/XHTML meta and link elements">[DC-HTML]</cite></a>.</p><div id="rfc.table.u.7"><p>The following DCMI properties are produced:</p><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>META name</th><th>description</th></tr></thead><tbody><tr><td>DC.Creator<div id="rfc.iref.c.6"></div><div id="rfc.iref.d.2"></div></td><td>from author information in front section</td></tr><tr><td>DC.Date.Issued<div id="rfc.iref.d.3"></div><div id="rfc.iref.d.4"></div></td><td>from date information in front section</td></tr><tr><td>DC.Description.Abstract<div id="rfc.iref.d.5"></div><div id="rfc.iref.d.6"></div></td><td>from abstract</td></tr><tr><td>DC.Identifier<div id="rfc.iref.i.10"></div><div id="rfc.iref.d.7"></div></td><td>document URN <a href="#RFC2648" id="rfc.xref.RFC2648.1"><cite title="A URN Namespace for IETF Documents">[RFC2648]</cite></a> from "docName" attribute</td></tr><tr><td>DC.isPartOf<div id="rfc.iref.i.11"></div><div id="rfc.iref.d.8"></div></td><td>RFC ISSN (for RFCs)</td></tr><tr><td>DC.Relation.Replaces<div id="rfc.iref.r.21"></div><div id="rfc.iref.d.9"></div></td><td>from "obsoletes" attribute</td></tr></tbody></table></div><h2 id="rfc.section.6.5"><a href="#rfc.section.6.5">6.5</a>&nbsp;<a id="hcard" href="#hcard">Experimental hCard support</a></h2><p id="rfc.section.6.5.p.1">The generated author information is formatted in <a href="http://microformats.org/wiki/hcard">hCard</a> format.</p><hr class="noprint"><h1 id="rfc.section.7" class="np"><a href="#rfc.section.7">7.</a>&nbsp;<a id="output.xhtml" href="#output.xhtml">Transforming to XHTML</a></h1><p id="rfc.section.7.p.1">Transforming to XHTML requires slightly different XSLT output options and is implemented by the derived transformation script <samp>rfc2629toXHTML.xslt</samp>.</p><dl class="empty"><dd> <b>Note:</b> Microsoft Internet Explorer does <em>not</em> support XHTML. Therefore it usually makes more sense to generate plain old HTML.</dd></dl><hr class="noprint"><h1 id="rfc.section.8" class="np"><a href="#rfc.section.8">8.</a>&nbsp;<a id="output.chm" href="#output.chm">Transforming to CHM (Microsoft Compiled Help)</a></h1><p id="rfc.section.8.p.1"> <span id="rfc.iref.c.7"></span>  <span id="rfc.iref.m.5"></span> To generate a CHM file using Microsoft's HTML Help Compiler (hhc), three files are required in addition to the HTML file. </p><ol><li>hhc - table of contents file (HTML)</li><li>hhk - index file (HTML)</li><li>hhp - project file (plain text)</li></ol><p id="rfc.section.8.p.2">The three files are generated with three specific transformations, each requiring the additional XSLT parameter "basename" to specify the filename prefix.</p><div id="rfc.figure.u.6"></div> <p>Example:</p>  <pre class="text">saxon rfc2616.xml rfc2629toHhp.xslt basename=rfc2616  &gt; rfc2616.hhp
     372</pre>  <p>(note the required quoting of string parameters)<span id="rfc.iref.x.1"></span></p> <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a>&nbsp;Supported xml2rfc-compatible PIs</h2><div id="rfc.table.u.1"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>XSLT parameter name</th><th>default</th><th>comment</th></tr></thead><tbody><tr><td class="left">rfc</td><td class="left">background<div id="rfc.iref.b.1"></div><div id="rfc.iref.p.1"></div></td><td class="left">xml2rfc-background<div id="rfc.iref.x.2"></div>  <div id="rfc.iref.p.2"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">compact<div id="rfc.iref.c.1"></div><div id="rfc.iref.p.3"></div></td><td class="left">xml2rfc-compact<div id="rfc.iref.x.3"></div>  <div id="rfc.iref.p.4"></div></td><td class="left">"no"</td><td class="left">only applies to HTML output method when printing</td></tr><tr><td class="left">rfc</td><td class="left">comments<div id="rfc.iref.c.2"></div><div id="rfc.iref.p.5"></div></td><td class="left">xml2rfc-comments<div id="rfc.iref.x.4"></div>  <div id="rfc.iref.p.6"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">editing<div id="rfc.iref.e.1"></div><div id="rfc.iref.p.7"></div></td><td class="left">xml2rfc-editing<div id="rfc.iref.x.5"></div>  <div id="rfc.iref.p.8"></div></td><td class="left">"no"</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">footer<div id="rfc.iref.f.1"></div><div id="rfc.iref.p.9"></div></td><td class="left">xml2rfc-footer<div id="rfc.iref.x.6"></div>  <div id="rfc.iref.p.10"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">header<div id="rfc.iref.h.1"></div><div id="rfc.iref.p.11"></div></td><td class="left">xml2rfc-header<div id="rfc.iref.x.7"></div>  <div id="rfc.iref.p.12"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">inline<div id="rfc.iref.i.1"></div><div id="rfc.iref.p.13"></div></td><td class="left">xml2rfc-inline<div id="rfc.iref.x.8"></div>  <div id="rfc.iref.p.14"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">iprnotified<div id="rfc.iref.i.2"></div><div id="rfc.iref.p.15"></div></td><td class="left">xml2rfc-iprnotified<div id="rfc.iref.x.9"></div>  <div id="rfc.iref.p.16"></div></td><td class="left">"no"</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">linkmailto<div id="rfc.iref.l.1"></div><div id="rfc.iref.p.17"></div></td><td class="left">xml2rfc-linkmailto<div id="rfc.iref.x.10"></div>  <div id="rfc.iref.p.18"></div></td><td class="left">"yes"</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">private<div id="rfc.iref.p.19"></div><div id="rfc.iref.p.20"></div></td><td class="left">xml2rfc-private<div id="rfc.iref.x.11"></div>  <div id="rfc.iref.p.21"></div></td><td class="left">(not set)</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">refparent<div id="rfc.iref.r.1"></div><div id="rfc.iref.p.22"></div></td><td class="left">xml2rfc-private<div id="rfc.iref.x.12"></div>  <div id="rfc.iref.p.23"></div></td><td class="left">"References"</td><td class="left">Title for References sections when automatically inserted</td></tr><tr><td class="left">rfc</td><td class="left">rfcedstyle<div id="rfc.iref.r.2"></div><div id="rfc.iref.p.24"></div></td><td class="left">xml2rfc-rfcedstyle<div id="rfc.iref.x.13"></div>  <div id="rfc.iref.p.25"></div></td><td class="left">(not set)</td><td class="left">(limited support)</td></tr><tr><td class="left">rfc</td><td class="left">sortrefs<div id="rfc.iref.s.1"></div><div id="rfc.iref.p.26"></div></td><td class="left">xml2rfc-sortrefs<div id="rfc.iref.x.14"></div>  <div id="rfc.iref.p.27"></div></td><td class="left">"no"</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">symrefs<div id="rfc.iref.s.2"></div><div id="rfc.iref.p.28"></div></td><td class="left">xml2rfc-symrefs<div id="rfc.iref.x.15"></div>  <div id="rfc.iref.p.29"></div></td><td class="left">"yes"</td><td class="left">The default has changed from "no" to "yes" as of June 6, 2007 and xml2rfc 1.33pre4.</td></tr><tr><td class="left">rfc</td><td class="left">toc<div id="rfc.iref.t.1"></div><div id="rfc.iref.p.30"></div></td><td class="left">xml2rfc-toc<div id="rfc.iref.x.16"></div>  <div id="rfc.iref.p.31"></div></td><td class="left">"no"</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">tocdepth<div id="rfc.iref.t.2"></div><div id="rfc.iref.p.32"></div></td><td class="left">xml2rfc-tocdepth<div id="rfc.iref.x.17"></div>  <div id="rfc.iref.p.33"></div></td><td class="left">99</td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">topblock<div id="rfc.iref.t.3"></div><div id="rfc.iref.p.34"></div></td><td class="left">xml2rfc-topblock<div id="rfc.iref.x.18"></div>  <div id="rfc.iref.p.35"></div></td><td class="left">"yes"</td><td class="left"></td></tr></tbody></table></div><h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a>&nbsp;Unsupported xml2rfc-compatible PIs</h2><div id="rfc.table.u.2"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>comment</th></tr></thead><tbody><tr><td class="left">rfc</td><td class="left">include<div id="rfc.iref.i.3"></div><div id="rfc.iref.p.36"></div></td><td class="left">incompatible with XML/XSLT processing model, please use external entities instead</td></tr><tr><td class="left">rfc</td><td class="left">needLines<div id="rfc.iref.n.1"></div><div id="rfc.iref.p.37"></div></td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">slides<div id="rfc.iref.s.3"></div><div id="rfc.iref.p.38"></div></td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">strict<div id="rfc.iref.s.4"></div><div id="rfc.iref.p.39"></div></td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">subcompact<div id="rfc.iref.s.5"></div><div id="rfc.iref.p.40"></div></td><td class="left"></td></tr><tr><td class="left">rfc</td><td class="left">tocindent<div id="rfc.iref.t.4"></div><div id="rfc.iref.p.41"></div></td><td class="left">(defaults to "yes")</td></tr><tr><td class="left">rfc</td><td class="left">tocompact<div id="rfc.iref.t.5"></div><div id="rfc.iref.p.42"></div></td><td class="left"></td></tr></tbody></table></div><h2 id="rfc.section.3.3"><a href="#rfc.section.3.3">3.3</a>&nbsp;Extension PIs</h2><div id="rfc.table.u.3"><table class="tt full center" cellpadding="3" cellspacing="0"><thead><tr><th>PI target</th><th>PI pseudo-attribute</th><th>XSLT parameter name</th><th>default</th><th>description</th></tr></thead><tbody><tr><td class="left">rfc-ext</td><td class="left">allow-markup-in-artwork<div id="rfc.iref.a.1"></div><div id="rfc.iref.p.43"></div></td><td class="left">xml2rfc-allow-markup-in-artwork<div id="rfc.iref.x.19"></div>  <div id="rfc.iref.p.44"></div></td><td class="left">"no"</td><td class="l