Ignore:
Timestamp:
Aug 5, 2009, 6:56:13 AM (10 years ago)
Author:
julian.reschke@…
Message:

update to latest version of rfc2629.xslt, bump up document dates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rfc2629xslt/rfc2629toFO.xslt

    r588 r662  
    242242
    243243<xsl:template match="back">
    244 
    245         <!-- add references section first, no matter where it appears in the
    246     source document -->
    247         <!-- <xsl:apply-templates select="references" />  -->
    248            
    249   <xsl:if test="$xml2rfc-ext-authors-section!='end'">
    250     <xsl:call-template name="insertAuthors" />
    251   </xsl:if>
    252  
    253   <!-- add all other top-level sections under <back> -->
    254         <xsl:apply-templates select="*[not(self::references)]" />
    255 
    256   <xsl:if test="$xml2rfc-ext-authors-section='end'">
    257     <xsl:call-template name="insertAuthors" />
    258   </xsl:if>
    259 
    260   <xsl:if test="not($xml2rfc-private)">
    261         <!-- copyright statements -->
    262     <xsl:variable name="copyright"><xsl:call-template name="insertCopyright" /></xsl:variable>
    263  
    264     <!-- emit it -->
    265     <xsl:choose>
    266       <xsl:when test="function-available('exslt:node-set')">
    267         <xsl:apply-templates select="exslt:node-set($copyright)/node()" />
    268       </xsl:when>
    269       <xsl:otherwise> <!--proceed with fingers crossed-->
    270         <xsl:variable name="temp" select="$copyright"/>
    271         <xsl:apply-templates select="$temp/node()" />
    272       </xsl:otherwise>
    273     </xsl:choose>
    274   </xsl:if>
    275  
     244  <!-- done in parent template -->
    276245</xsl:template>
    277246
     
    340309      <fo:block font-size="80%"><xsl:value-of select="/rfc/@docName" /></fo:block>
    341310    </xsl:if>
    342  </fo:block>
     311  </fo:block>
    343312 
    344   <!-- Get status info formatted as per RFC2629-->
    345   <xsl:if test="not($xml2rfc-private)">
    346     <xsl:variable name="preamble"><xsl:call-template name="insertPreamble" /></xsl:variable>
    347    
    348     <!-- emit it -->
    349     <xsl:choose>
    350       <xsl:when test="function-available('exslt:node-set')">
    351         <xsl:apply-templates select="exslt:node-set($preamble)/node()" />
    352       </xsl:when>
    353       <xsl:otherwise>
    354         <xsl:variable name="temp" select="$preamble"/>
    355         <xsl:apply-templates select="$temp/node()" />
    356       </xsl:otherwise>
    357     </xsl:choose>
     313  <xsl:if test="not($xml2rfc-private) and not($abstract-first)">
     314    <xsl:call-template name="emit-ietf-preamble"/>
    358315  </xsl:if>
    359316 
     
    361318        <xsl:apply-templates select="abstract" />
    362319        <xsl:apply-templates select="note" />
     320
     321  <xsl:if test="not($xml2rfc-private) and $abstract-first">
     322    <xsl:call-template name="emit-ietf-preamble"/>
     323  </xsl:if>
    363324
    364325        <xsl:if test="$xml2rfc-toc='yes'">
     
    662623<xsl:template match="middle">
    663624        <xsl:apply-templates />
    664   <xsl:apply-templates select="../back/references" />
    665625</xsl:template>
    666626               
     
    830790    <xsl:when test="count(/*/back/references)=1">
    831791      <fo:block id="{$anchor-prefix}.references" xsl:use-attribute-sets="h1 newpage">
    832         <xsl:call-template name="get-section-number"/>&#160;&#160;
     792        <xsl:variable name="sectionNumber">
     793          <xsl:call-template name="get-section-number"/>
     794        </xsl:variable>
     795        <xsl:call-template name="emit-section-number">
     796          <xsl:with-param name="no" select="$sectionNumber"/>
     797        </xsl:call-template>
     798        <xsl:text>&#160;&#160;</xsl:text>
    833799        <xsl:choose>
    834800          <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
     
    839805    <xsl:otherwise>
    840806      <fo:block id="{$anchor-prefix}.references.{$name}" xsl:use-attribute-sets="h2">
    841         <xsl:call-template name="get-section-number"/>&#160;&#160;
     807        <xsl:variable name="sectionNumber">
     808          <xsl:call-template name="get-section-number"/>
     809        </xsl:variable>
     810        <xsl:call-template name="emit-section-number">
     811          <xsl:with-param name="no" select="$sectionNumber"/>
     812        </xsl:call-template>
     813        <xsl:text>&#160;&#160;</xsl:text>
    842814        <xsl:choose>
    843815          <xsl:when test="@title!=''"><xsl:value-of select="@title"/></xsl:when>
     
    961933    <xsl:variable name="lang"><xsl:call-template name="get-lang"/></xsl:variable>
    962934
    963                 <fo:page-sequence master-reference="sequence" language="{$lang}" force-page-count="even">
     935                <fo:page-sequence master-reference="sequence" language="{$lang}">
    964936      <xsl:if test="$xml2rfc-ext-duplex='yes'">
    965937        <xsl:attribute name="force-page-count">even</xsl:attribute>
     
    970942     
    971943                        <fo:flow flow-name="xsl-region-body">
    972                                 <xsl:apply-templates />   
     944                               
     945        <!-- process front & middle section, but not back -->
     946        <xsl:apply-templates />
     947       
     948        <!-- because it requires multiple page masters -->
     949        <!-- references first -->
     950        <xsl:apply-templates select="back/references" />
     951       
     952        <xsl:if test="$xml2rfc-ext-authors-section!='end'">
     953          <xsl:call-template name="insertAuthors" />
     954        </xsl:if>
     955       
     956        <!-- add all other top-level sections under <back> -->
     957        <xsl:apply-templates select="back/*[not(self::references)]" />
     958     
    973959                        </fo:flow>
    974960    </fo:page-sequence>
     
    986972      </fo:page-sequence>
    987973    </xsl:if>
     974
     975    <xsl:if test="$xml2rfc-ext-authors-section='end' or (not($xml2rfc-private) and not($no-copylong))">
     976                <fo:page-sequence master-reference="sequence" language="{$lang}">
     977        <xsl:if test="$xml2rfc-ext-duplex='yes'">
     978          <xsl:attribute name="force-page-count">even</xsl:attribute>
     979        </xsl:if>
     980 
     981        <xsl:call-template name="insertHeader" />
     982        <xsl:call-template name="insertFooter" />
     983       
     984                        <fo:flow flow-name="xsl-region-body">
     985                               
     986          <xsl:if test="$xml2rfc-ext-authors-section='end'">
     987            <xsl:call-template name="insertAuthors" />
     988          </xsl:if>
     989 
     990          <xsl:if test="not($xml2rfc-private)">
     991                <!-- copyright statements -->
     992            <xsl:variable name="copyright">
     993              <xsl:call-template name="insertCopyright" />
     994            </xsl:variable>
     995         
     996            <!-- emit it -->
     997            <xsl:choose>
     998              <xsl:when test="function-available('exslt:node-set')">
     999                <xsl:apply-templates select="exslt:node-set($copyright)/node()" />
     1000              </xsl:when>
     1001              <xsl:otherwise> <!--proceed with fingers crossed-->
     1002                <xsl:variable name="temp" select="$copyright"/>
     1003                <xsl:apply-templates select="$temp/node()" />
     1004              </xsl:otherwise>
     1005            </xsl:choose>
     1006          </xsl:if>
     1007         
     1008                        </fo:flow>
     1009      </fo:page-sequence>
     1010    </xsl:if>
    9881011   
    9891012        </fo:root>
     
    10061029  <xsl:call-template name="add-anchor" />
    10071030 
    1008   <xsl:if test="$sectionNumber!=''">
     1031  <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
    10091032    <xsl:call-template name="emit-section-number">
    10101033      <xsl:with-param name="no" select="$sectionNumber"/>
     
    11581181      </fo:basic-link>
    11591182    </xsl:when>
     1183   
    11601184    <xsl:when test="$node/self::section or $node/self::appendix">
    1161       <xsl:apply-templates/>
    1162       <xsl:text> (</xsl:text>
    1163       <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link">
    1164         <!-- insert id when a backlink to this xref is needed in the index -->
    1165         <xsl:variable name="ireftargets" select="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]"/>
    1166         <xsl:if test="$ireftargets">
    1167           <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
    1168         </xsl:if>
    1169         <xsl:for-each select="$ireftargets">
    1170           <fo:wrapper index-key="{concat('item=',@item,',subitem=',@subitem)}" />
    1171         </xsl:for-each>
    1172         <xsl:call-template name="render-section-ref">
    1173           <xsl:with-param name="from" select="."/>
    1174           <xsl:with-param name="to" select="$node"/>
    1175         </xsl:call-template>
    1176       </fo:basic-link>
    1177       <xsl:text>)</xsl:text>
     1185      <xsl:choose>
     1186        <xsl:when test="@format='none'">
     1187          <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link">
     1188            <!-- insert id when a backlink to this xref is needed in the index -->
     1189            <xsl:variable name="ireftargets" select="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]"/>
     1190            <xsl:if test="$ireftargets">
     1191              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1192            </xsl:if>
     1193            <xsl:for-each select="$ireftargets">
     1194              <fo:wrapper index-key="{concat('item=',@item,',subitem=',@subitem)}" />
     1195            </xsl:for-each>
     1196            <xsl:apply-templates/>
     1197          </fo:basic-link>
     1198        </xsl:when>
     1199        <xsl:otherwise>
     1200          <xsl:apply-templates/>
     1201          <xsl:text> (</xsl:text>
     1202          <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link">
     1203            <!-- insert id when a backlink to this xref is needed in the index -->
     1204            <xsl:variable name="ireftargets" select="//iref[@x:for-anchor=$target] | //iref[@x:for-anchor='' and ../@anchor=$target]"/>
     1205            <xsl:if test="$ireftargets">
     1206              <xsl:attribute name="id"><xsl:value-of select="$anchor"/></xsl:attribute>
     1207            </xsl:if>
     1208            <xsl:for-each select="$ireftargets">
     1209              <fo:wrapper index-key="{concat('item=',@item,',subitem=',@subitem)}" />
     1210            </xsl:for-each>
     1211            <xsl:call-template name="render-section-ref">
     1212              <xsl:with-param name="from" select="."/>
     1213              <xsl:with-param name="to" select="$node"/>
     1214            </xsl:call-template>
     1215          </fo:basic-link>
     1216          <xsl:text>)</xsl:text>
     1217        </xsl:otherwise>
     1218      </xsl:choose>
    11781219    </xsl:when>
     1220   
    11791221    <xsl:otherwise>
    11801222      <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link">
     
    17111753<xsl:template match="back" mode="toc">
    17121754
    1713   <!-- <xsl:apply-templates select="references" mode="toc" /> -->
     1755  <xsl:apply-templates select="references" mode="toc" />
    17141756
    17151757  <xsl:if test="$xml2rfc-ext-authors-section!='end'">
     
    17181760
    17191761  <xsl:apply-templates select="*[not(self::references)]" mode="toc" />
     1762
     1763  <!-- insert the index if index entries exist -->
     1764  <xsl:if test="$has-index">
     1765    <xsl:call-template name="insert-toc-line">
     1766      <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
     1767      <xsl:with-param name="title" select="'Index'"/>
     1768    </xsl:call-template>
     1769  </xsl:if>
    17201770
    17211771  <xsl:if test="$xml2rfc-ext-authors-section='end'">
     
    17311781  </xsl:if>
    17321782 
    1733   <!-- insert the index if index entries exist -->
    1734   <xsl:if test="$has-index">
    1735     <xsl:call-template name="insert-toc-line">
    1736       <xsl:with-param name="target" select="concat($anchor-prefix,'.index')"/>
    1737       <xsl:with-param name="title" select="'Index'"/>
    1738     </xsl:call-template>
    1739   </xsl:if>
    1740 
    17411783</xsl:template>
    17421784
     
    18661908    <xsl:when test="$depth = 0">
    18671909      <fo:block space-before="1em" font-weight="bold" text-align-last="justify">
    1868         <xsl:if test="$number!=''">
     1910        <xsl:if test="$number!='' and not(contains($number,'unnumbered-'))">
    18691911          <xsl:value-of select="$number" />
    18701912          <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
     
    18781920    <xsl:when test="$depth = 1">
    18791921      <fo:block space-before="0.5em" text-align-last="justify">
    1880         <xsl:if test="$number!=''">
     1922        <xsl:if test="$number!='' and not(contains($number,'unnumbered-'))">
    18811923          <xsl:value-of select="$number" />
    18821924          <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
     
    18911933      <fo:block text-align-last="justify">
    18921934        <xsl:text>&#0160;&#0160;</xsl:text>
    1893         <xsl:if test="$number!=''">
     1935        <xsl:if test="$number!='' and not(contains($number,'unnumbered-'))">
    18941936          <xsl:value-of select="$number" />
    18951937          <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
     
    21042146  <fo:bookmark internal-destination="{$anchor-prefix}.section.{$sectionNumber}">
    21052147    <fo:bookmark-title>
    2106       <xsl:value-of select="$sectionNumber"/>
    2107       <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
    2108       <xsl:value-of select="concat(' ',@title)"/>
     2148      <xsl:if test="$sectionNumber!='' and not(contains($sectionNumber,'unnumbered-'))">
     2149        <xsl:value-of select="$sectionNumber"/>
     2150        <xsl:if test="$xml2rfc-ext-sec-no-trailing-dots='yes'">.</xsl:if>
     2151        <xsl:text> </xsl:text>
     2152      </xsl:if>
     2153      <xsl:value-of select="@title"/>
    21092154    </fo:bookmark-title>
    21102155    <xsl:apply-templates mode="bookmarks"/>
     
    21212166<xsl:template match="back" mode="bookmarks">
    21222167
     2168  <xsl:call-template name="references-bookmarks" />
     2169
    21232170  <xsl:if test="$xml2rfc-ext-authors-section!='end'">
    21242171    <xsl:apply-templates select="/rfc/front" mode="bookmarks" />
     
    21262173 
    21272174  <xsl:apply-templates select="*[not(self::references)]" mode="bookmarks" />
     2175
     2176  <!-- insert the index if index entries exist -->
     2177  <xsl:if test="$has-index">
     2178    <fo:bookmark internal-destination="{concat($anchor-prefix,'.index')}">
     2179      <fo:bookmark-title>Index</fo:bookmark-title>
     2180    </fo:bookmark>
     2181  </xsl:if>
    21282182
    21292183  <xsl:if test="$xml2rfc-ext-authors-section='end'">
     
    21382192  </xsl:if>
    21392193 
    2140   <!-- insert the index if index entries exist -->
    2141   <xsl:if test="$has-index">
    2142     <fo:bookmark internal-destination="{concat($anchor-prefix,'.index')}">
    2143       <fo:bookmark-title>Index</fo:bookmark-title>
    2144     </fo:bookmark>
    2145   </xsl:if>
    21462194</xsl:template>
    21472195
     
    21692217<xsl:template match="middle" mode="bookmarks">
    21702218  <xsl:apply-templates mode="bookmarks" />
    2171   <xsl:call-template name="references-bookmarks" />
    21722219</xsl:template>
    21732220
     
    23612408        </xsl:if>
    23622409        <xsl:variable name="columns" select="count(ttcol)" />
    2363         <xsl:for-each select="c[(position() mod $columns) = 1]">
     2410        <xsl:for-each select="c[$columns=1 or (position() mod $columns) = 1]">
    23642411          <fo:table-row>
    23652412            <xsl:for-each select=". | following-sibling::c[position() &lt; $columns]">
Note: See TracChangeset for help on using the changeset viewer.