Changeset 588 for rfc2629xslt/rfc2629toFO.xslt
- Timestamp:
- 01/06/09 13:21:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629toFO.xslt
r571 r588 1 1 <!-- 2 2 XSLT transformation from RFC2629 XML format to XSL-FO 3 3 4 4 Copyright (c) 2006-2009, Julian Reschke (julian.reschke@greenbytes.de) … … 489 489 <xsl:template match="list[@style='hanging']/x:lt" priority="1"> 490 490 <fo:list-item space-before=".25em" space-after=".25em"> 491 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>491 <xsl:call-template name="copy-anchor"/> 492 492 <fo:list-item-label end-indent="label-end()"><fo:block><xsl:value-of select="@hangText" /></fo:block></fo:list-item-label> 493 493 <fo:list-item-body start-indent="body-start()"> … … 506 506 <xsl:template match="list[@style='hanging']/t | list[@style='hanging']/ed:replace/ed:ins/t" priority="1"> 507 507 <fo:list-item space-before=".25em" space-after=".25em"> 508 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>508 <xsl:call-template name="copy-anchor"/> 509 509 <fo:list-item-label end-indent="label-end()"><fo:block><xsl:value-of select="@hangText" /></fo:block></fo:list-item-label> 510 510 <fo:list-item-body start-indent="body-start()"><fo:block><xsl:apply-templates /></fo:block></fo:list-item-body> … … 520 520 <xsl:template match="list[@style='symbols']/t" priority="1"> 521 521 <fo:list-item space-before=".25em" space-after=".25em"> 522 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>522 <xsl:call-template name="copy-anchor"/> 523 523 <fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> 524 524 <fo:list-item-body start-indent="body-start()"><fo:block><xsl:apply-templates /></fo:block></fo:list-item-body> … … 528 528 <xsl:template match="list[@style='symbols']/x:lt" priority="1"> 529 529 <fo:list-item space-before=".25em" space-after=".25em"> 530 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>530 <xsl:call-template name="copy-anchor"/> 531 531 <fo:list-item-label end-indent="label-end()"><fo:block>•</fo:block></fo:list-item-label> 532 532 <fo:list-item-body start-indent="body-start()"> … … 557 557 <xsl:template match="list/t"> 558 558 <fo:list-item space-before=".25em" space-after=".25em"> 559 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>559 <xsl:call-template name="copy-anchor"/> 560 560 <fo:list-item-label end-indent="label-end()"><fo:block></fo:block></fo:list-item-label> 561 561 <fo:list-item-body start-indent="body-start()"><fo:block><xsl:apply-templates /></fo:block></fo:list-item-body> … … 571 571 <xsl:template match="list[@style='numbers' or @style='letters']/t" priority="1"> 572 572 <fo:list-item space-before=".25em" space-after=".25em"> 573 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>573 <xsl:call-template name="copy-anchor"/> 574 574 <fo:list-item-label end-indent="label-end()"> 575 575 <fo:block> … … 587 587 <xsl:template match="list[@style='numbers' or @style='letters']/x:lt" priority="1"> 588 588 <fo:list-item space-before=".25em" space-after=".25em"> 589 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>589 <xsl:call-template name="copy-anchor"/> 590 590 <fo:list-item-label end-indent="label-end()"> 591 591 <fo:block> … … 613 613 <xsl:template match="list//t//list[@style='letters']/t" priority="9"> 614 614 <fo:list-item space-before=".25em" space-after=".25em"> 615 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>615 <xsl:call-template name="copy-anchor"/> 616 616 <fo:list-item-label end-indent="label-end()"><fo:block><xsl:number format="A"/>.</fo:block></fo:list-item-label> 617 617 <fo:list-item-body start-indent="body-start()"><fo:block><xsl:apply-templates /></fo:block></fo:list-item-body> … … 639 639 </xsl:variable> 640 640 <fo:list-item space-before=".25em" space-after=".25em"> 641 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>641 <xsl:call-template name="copy-anchor"/> 642 642 <fo:list-item-label end-indent="label-end()"> 643 643 <fo:block> … … 673 673 <xsl:template match="preamble"> 674 674 <fo:block space-after=".5em"> 675 <xsl:if test="@anchor"> 676 <xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute> 677 </xsl:if> 675 <xsl:call-template name="copy-anchor"/> 678 676 <xsl:apply-templates /> 679 677 </fo:block> … … 942 940 <dc:creator><xsl:call-template name="get-author-summary" /></dc:creator> 943 941 <dc:description><xsl:value-of select="normalize-space(/rfc/front/abstract)"/></dc:description> 942 <xsl:if test="/rfc/@number"> 943 <dc:isPartOf>urn:ISSN:2070-1721</dc:isPartOf> 944 </xsl:if> 944 945 <xsl:if test="/rfc/front/keyword" xmlns:pdf="http://ns.adobe.com/pdf/1.3/"> 945 946 <pdf:Keywords> … … 1059 1060 <xsl:template match="spanx[@style='emph' or not(@style)]"> 1060 1061 <fo:wrapper font-style="italic"> 1061 <xsl:if test="@anchor"> 1062 <xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute> 1063 </xsl:if> 1062 <xsl:call-template name="copy-anchor"/> 1064 1063 <xsl:apply-templates /> 1065 1064 </fo:wrapper> … … 1068 1067 <xsl:template match="spanx[@style='strong']"> 1069 1068 <fo:wrapper font-weight="bold"> 1070 <xsl:if test="@anchor"> 1071 <xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute> 1072 </xsl:if> 1069 <xsl:call-template name="copy-anchor"/> 1073 1070 <xsl:apply-templates /> 1074 1071 </fo:wrapper> … … 1077 1074 <xsl:template match="spanx[@style='verb']"> 1078 1075 <fo:wrapper font-family="monospace"> 1079 <xsl:if test="@anchor"> 1080 <xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute> 1081 </xsl:if> 1076 <xsl:call-template name="copy-anchor"/> 1082 1077 <xsl:apply-templates/> 1083 1078 </fo:wrapper> … … 1098 1093 </xsl:otherwise> 1099 1094 </xsl:choose> 1100 <xsl: if test="@anchor"><xsl:attribute name="id"><xsl:value-of select="@anchor"/></xsl:attribute></xsl:if>1095 <xsl:call-template name="copy-anchor"/> 1101 1096 <xsl:apply-templates /> 1102 1097 </fo:block> … … 1265 1260 <xsl:otherwise> 1266 1261 <xsl:value-of select="normalize-space(concat('Table ',$tabcnt))"/> 1262 </xsl:otherwise> 1263 </xsl:choose> 1264 </fo:basic-link> 1265 </xsl:when> 1266 1267 <!-- Paragraph links --> 1268 <xsl:when test="$node/self::t"> 1269 <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link"> 1270 <xsl:variable name="tcnt"> 1271 <xsl:for-each select="$node"> 1272 <xsl:call-template name="get-paragraph-number" /> 1273 </xsl:for-each> 1274 </xsl:variable> 1275 <xsl:choose> 1276 <xsl:when test="@format='counter'"> 1277 <xsl:value-of select="$tcnt" /> 1278 </xsl:when> 1279 <xsl:when test="@format='title'"> 1280 <xsl:value-of select="$node/@title" /> 1281 </xsl:when> 1282 <xsl:otherwise> 1283 <xsl:value-of select="normalize-space(concat('Paragraph ',substring-after($tcnt,'p.')))"/> 1284 </xsl:otherwise> 1285 </xsl:choose> 1286 </fo:basic-link> 1287 </xsl:when> 1288 1289 <!-- Comment links --> 1290 <xsl:when test="$node/self::cref"> 1291 <fo:basic-link internal-destination="{$target}" xsl:use-attribute-sets="internal-link"> 1292 <xsl:variable name="name"> 1293 <xsl:for-each select="$node"> 1294 <xsl:call-template name="get-comment-name" /> 1295 </xsl:for-each> 1296 </xsl:variable> 1297 <xsl:choose> 1298 <xsl:when test="@format='counter'"> 1299 <xsl:value-of select="$name" /> 1300 </xsl:when> 1301 <xsl:when test="@format='title'"> 1302 <xsl:value-of select="$node/@title" /> 1303 </xsl:when> 1304 <xsl:otherwise> 1305 <xsl:value-of select="normalize-space(concat('Comment ',$name))"/> 1267 1306 </xsl:otherwise> 1268 1307 </xsl:choose> … … 1395 1434 1396 1435 <xsl:otherwise> 1397 <xsl:message>xref to unknown element: <xsl:value-of select="name($node)"/></xsl:message> 1436 <xsl:call-template name="error"> 1437 <xsl:with-param name="msg" select="concat('xref to unknown element: ',name($node))"/> 1438 </xsl:call-template> 1398 1439 </xsl:otherwise> 1399 1440 </xsl:choose> … … 1527 1568 <xsl:for-each select="$rs2"> 1528 1569 <xsl:sort select="substring-before(concat(@x:sec,'.'),'.')" data-type="number"/> 1529 <xsl:sort select="substring(@x:sec, 1+string-length(substring-before(@x:sec,'.')))" data-type="number"/>1570 <xsl:sort select="substring(@x:sec,2+string-length(substring-before(@x:sec,'.')))" data-type="number"/> 1530 1571 <xsl:if test="generate-id(.) = generate-id(key('index-xref-by-sec',concat(@target,'..',@x:sec)))"> 1531 1572 <fo:block start-indent="2em" hyphenate="true"> … … 2407 2448 <xsl:if test="$xml2rfc-comments!='no'"> 2408 2449 <xsl:variable name="cid"> 2409 <xsl:choose> 2410 <xsl:when test="@anchor"> 2411 <xsl:value-of select="@anchor"/> 2412 </xsl:when> 2413 <xsl:otherwise> 2414 <xsl:value-of select="$anchor-prefix"/> 2415 <xsl:text>.comment.</xsl:text> 2416 <xsl:number count="cref[not(@anchor)]" level="any"/> 2417 </xsl:otherwise> 2418 </xsl:choose> 2450 <xsl:call-template name="get-comment-name"/> 2419 2451 </xsl:variable> 2420 2452 … … 2473 2505 <xsl:when test="$target"> 2474 2506 <fo:basic-link internal-destination="{$target/@anchor}" xsl:use-attribute-sets="internal-link"> 2507 <xsl:call-template name="copy-anchor"/> 2475 2508 <xsl:apply-templates/> 2476 2509 </fo:basic-link>
Note: See TracChangeset
for help on using the changeset viewer.