Changeset 329 for rfc2629xslt/rfc2629toFO.xslt
- Timestamp:
- 11/10/08 07:06:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rfc2629xslt/rfc2629toFO.xslt
r285 r329 47 47 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> 48 48 49 <!-- page sizes as per <http://tools.ietf.org/html/draft-rfc-editor-rfc2223bis-08#section-3.2> --> 50 <xsl:attribute-set name="page"> 51 <xsl:attribute name="margin-left">1in</xsl:attribute> 52 <xsl:attribute name="margin-right">1in</xsl:attribute> 53 <xsl:attribute name="page-height">11in</xsl:attribute> 54 <xsl:attribute name="page-width">8.5in</xsl:attribute> 55 </xsl:attribute-set> 56 49 57 <xsl:attribute-set name="base"> 50 58 <xsl:attribute name="font-family">serif</xsl:attribute> 51 59 <xsl:attribute name="font-size">10pt</xsl:attribute> 60 <xsl:attribute name="line-height">12pt</xsl:attribute> 52 61 </xsl:attribute-set> 53 62 … … 152 161 </xsl:otherwise> 153 162 </xsl:choose> 163 164 <xsl:if test="@align='center'"> 165 <xsl:attribute name="text-align">center</xsl:attribute> 166 </xsl:if> 154 167 </xsl:template> 155 168 … … 168 181 169 182 <xsl:template match="author"> 170 <fo:block space-before="1em"> 171 <fo:wrapper font-weight="bold"><xsl:value-of select="@fullname" /></fo:wrapper> 172 <xsl:if test="@role"> 173 <fo:wrapper> (<xsl:value-of select="@role" />)</fo:wrapper> 183 <fo:block start-indent="2em" space-before=".5em" space-after=".5em"> 184 <fo:block> 185 <fo:wrapper font-weight="bold"><xsl:value-of select="@fullname" /></fo:wrapper> 186 <xsl:if test="@role"> 187 <fo:wrapper> (<xsl:value-of select="@role" />)</fo:wrapper> 188 </xsl:if> 189 </fo:block> 190 <fo:block><xsl:value-of select="organization" /></fo:block> 191 <xsl:for-each select="address/postal/street"> 192 <fo:block><xsl:value-of select="." /></fo:block> 193 </xsl:for-each> 194 <xsl:if test="address/postal/city"> 195 <fo:block><xsl:value-of select="concat(address/postal/city,', ',address/postal/region,' ',address/postal/code)" /></fo:block> 196 </xsl:if> 197 <xsl:if test="address/postal/country"> 198 <fo:block><xsl:value-of select="address/postal/country" /></fo:block> 174 199 </xsl:if> 200 <xsl:if test="address/phone"> 201 <fo:block>Phone: <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> 202 </xsl:if> 203 <xsl:if test="address/facsimile"> 204 <fo:block>Fax: <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> 205 </xsl:if> 206 <xsl:for-each select="address/email"> 207 <xsl:variable name="email"> 208 <xsl:call-template name="extract-email"/> 209 </xsl:variable> 210 <fo:block>EMail:  211 <xsl:choose> 212 <xsl:when test="$xml2rfc-linkmailto='no'"> 213 <xsl:value-of select="$email" /> 214 </xsl:when> 215 <xsl:otherwise> 216 <fo:basic-link external-destination="url('mailto:{$email}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="$email" /></fo:basic-link> 217 </xsl:otherwise> 218 </xsl:choose> 219 </fo:block> 220 </xsl:for-each> 221 <xsl:for-each select="address/uri"> 222 <xsl:variable name="uri"> 223 <xsl:call-template name="extract-uri"/> 224 </xsl:variable> 225 <fo:block>URI: <fo:basic-link external-destination="url('{$uri}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="$uri" /></fo:basic-link></fo:block> 226 </xsl:for-each> 175 227 </fo:block> 176 <fo:block><xsl:value-of select="organization" /></fo:block>177 <xsl:for-each select="address/postal/street">178 <fo:block><xsl:value-of select="." /></fo:block>179 </xsl:for-each>180 <xsl:if test="address/postal/city">181 <fo:block><xsl:value-of select="concat(address/postal/city,', ',address/postal/region,' ',address/postal/code)" /></fo:block>182 </xsl:if>183 <xsl:if test="address/postal/country">184 <fo:block><xsl:value-of select="address/postal/country" /></fo:block>185 </xsl:if>186 <xsl:if test="address/phone">187 <fo:block>Phone: <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>188 </xsl:if>189 <xsl:if test="address/facsimile">190 <fo:block>Fax: <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>191 </xsl:if>192 <xsl:for-each select="address/email">193 <xsl:variable name="email">194 <xsl:call-template name="extract-email"/>195 </xsl:variable>196 <fo:block>EMail: 197 <xsl:choose>198 <xsl:when test="$xml2rfc-linkmailto='no'">199 <xsl:value-of select="$email" />200 </xsl:when>201 <xsl:otherwise>202 <fo:basic-link external-destination="url('mailto:{$email}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="$email" /></fo:basic-link>203 </xsl:otherwise>204 </xsl:choose>205 </fo:block>206 </xsl:for-each>207 <xsl:for-each select="address/uri">208 <xsl:variable name="uri">209 <xsl:call-template name="extract-uri"/>210 </xsl:variable>211 <fo:block>URI: <fo:basic-link external-destination="url('{$uri}')" xsl:use-attribute-sets="external-link"><xsl:value-of select="$uri" /></fo:basic-link></fo:block>212 </xsl:for-each>213 228 </xsl:template> 214 229 … … 516 531 <xsl:template match="list"> 517 532 <xsl:if test="@style!='' and @style!='empty' and @style"> 518 <xsl:message>WARNING: unknown style '<xsl:value-of select="@style"/>' for list, continueing with default format.</xsl:message> 533 <xsl:call-template name="warning"> 534 <xsl:with-param name="inline" select="'no'"/> 535 <xsl:with-param name="msg">unknown style '<xsl:value-of select="@style"/>' for list, continueing with default format.</xsl:with-param> 536 </xsl:call-template> 519 537 </xsl:if> 520 538 <fo:list-block provisional-distance-between-starts="2em"> … … 850 868 <fo:root xsl:use-attribute-sets="base"> 851 869 852 <!-- insert PDF information (XEP extension) -->853 <meta-info xmlns="http://www.renderx.com/XSL/Extensions">854 <!-- title -->855 <meta-field name="title" value="{/rfc/front/title}"/>856 <!-- keywords -->857 <xsl:if test="/rfc/front/keyword">858 <xsl:variable name="keyw">859 <xsl:call-template name="get-keywords" />860 </xsl:variable>861 <meta-field name="keywords" value="{$keyw}" />862 </xsl:if>863 <xsl:variable name="auth">864 <xsl:call-template name="get-author-summary" />865 </xsl:variable>866 <meta-field name="author" value="{$auth}" />867 </meta-info>868 869 870 <fo:layout-master-set> 870 <!-- page sizes as per <http://tools.ietf.org/html/draft-rfc-editor-rfc2223bis-08> --> 871 <fo:simple-page-master master-name="first-page" margin-left="1in" margin-right="1in" page-height="11in" page-width="8.5in"> 871 <fo:simple-page-master master-name="first-page" xsl:use-attribute-sets="page"> 872 872 <fo:region-body margin-bottom="1in" margin-top="1in"/> 873 873 <fo:region-after extent="1cm" region-name="footer"/> 874 874 </fo:simple-page-master> 875 <fo:simple-page-master master-name="other-pages" margin-left="1in" margin-right="1in" page-height="11in" page-width="8.5in">875 <fo:simple-page-master master-name="other-pages" xsl:use-attribute-sets="page"> 876 876 <fo:region-body margin-bottom="1in" margin-top="1in" /> 877 877 <fo:region-before extent="1cm" region-name="header"/> 878 878 <fo:region-after extent="1cm" region-name="footer"/> 879 879 </fo:simple-page-master> 880 <fo:simple-page-master master-name="other-pages-dc" margin-left="1in" margin-right="1in" page-height="11in" page-width="8.5in">880 <fo:simple-page-master master-name="other-pages-dc" xsl:use-attribute-sets="page"> 881 881 <fo:region-body margin-bottom="1in" margin-top="1in" column-count="2"/> 882 882 <fo:region-before extent="1cm" region-name="header"/> … … 889 889 </fo:layout-master-set> 890 890 891 <fo:declarations> 892 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 893 <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> 894 <dc:title><xsl:value-of select="/rfc/front/title"/></dc:title> 895 <dc:creator><xsl:call-template name="get-author-summary" /></dc:creator> 896 <dc:description><xsl:value-of select="normalize-space(/rfc/front/abstract)"/></dc:description> 897 <xsl:if test="/rfc/front/keyword" xmlns:pdf="http://ns.adobe.com/pdf/1.3/"> 898 <pdf:Keywords> 899 <xsl:for-each select="/rfc/front/keyword"> 900 <xsl:value-of select="."/> 901 <xsl:if test="position()!=last()">, </xsl:if> 902 </xsl:for-each> 903 </pdf:Keywords> 904 </xsl:if> 905 </rdf:Description> 906 </rdf:RDF> 907 </fo:declarations> 908 891 909 <fo:bookmark-tree> 892 910 <xsl:apply-templates select="." mode="bookmarks" /> … … 1014 1032 <xsl:choose> 1015 1033 <xsl:when test="parent::x:blockquote"> 1034 <xsl:attribute name="start-indent">4em</xsl:attribute> 1035 </xsl:when> 1036 <xsl:when test="parent::x:note"> 1016 1037 <xsl:attribute name="start-indent">4em</xsl:attribute> 1017 1038 </xsl:when> … … 1109 1130 <xsl:value-of select="." /> 1110 1131 </fo:basic-link> 1111 <xsl:for-each select="//reference[@anchor=$target]"> 1112  <xsl:call-template name="referencename"><xsl:with-param name="node" select="." /></xsl:call-template> 1113 </xsl:for-each> 1132 <xsl:if test="not(@format='none')"> 1133 <xsl:for-each select="//reference[@anchor=$target]"> 1134  <xsl:call-template name="referencename"><xsl:with-param name="node" select="." /></xsl:call-template> 1135 </xsl:for-each> 1136 </xsl:if> 1114 1137 </xsl:otherwise> 1115 1138 </xsl:choose> … … 1376 1399 </xsl:variable> 1377 1400 1378 <fo:block id="{$anchor-prefix}.authors" xsl:use-attribute-sets="h1 newpage"> 1379 <xsl:if test="$sectionNumber != ''"> 1380 <xsl:call-template name="emit-section-number"> 1381 <xsl:with-param name="no" select="$sectionNumber"/> 1382 </xsl:call-template> 1383 <xsl:text>  </xsl:text> 1384 </xsl:if> 1385 <xsl:call-template name="get-authors-section-title"/> 1386 </fo:block> 1387 1388 <xsl:apply-templates select="/rfc/front/author" /> 1401 <xsl:if test="$sectionNumber!='suppress'"> 1402 <fo:block id="{$anchor-prefix}.authors" xsl:use-attribute-sets="h1 newpage"> 1403 <xsl:if test="$sectionNumber != ''"> 1404 <xsl:call-template name="emit-section-number"> 1405 <xsl:with-param name="no" select="$sectionNumber"/> 1406 </xsl:call-template> 1407 <xsl:text>  </xsl:text> 1408 </xsl:if> 1409 <xsl:call-template name="get-authors-section-title"/> 1410 </fo:block> 1411 1412 <xsl:apply-templates select="/rfc/front/author" /> 1413 </xsl:if> 1389 1414 </xsl:template> 1390 1415 … … 1628 1653 <xsl:call-template name="get-authors-section-number"/> 1629 1654 </xsl:variable> 1630 <xsl:call-template name="insert-toc-line"> 1631 <xsl:with-param name="target" select="concat($anchor-prefix,'.authors')"/> 1632 <xsl:with-param name="title" select="$authors-title"/> 1633 <xsl:with-param name="number" select="$authors-number"/> 1634 </xsl:call-template> 1655 <xsl:if test="$authors-number!='suppress'"> 1656 <xsl:call-template name="insert-toc-line"> 1657 <xsl:with-param name="target" select="concat($anchor-prefix,'.authors')"/> 1658 <xsl:with-param name="title" select="$authors-title"/> 1659 <xsl:with-param name="number" select="$authors-number"/> 1660 </xsl:call-template> 1661 </xsl:if> 1635 1662 1636 1663 </xsl:template> … … 1883 1910 <xsl:apply-templates /> 1884 1911 </xsl:template> 1912 <xsl:template match="ed:issueref"> 1913 <xsl:apply-templates /> 1914 </xsl:template> 1885 1915 1886 1916 <xsl:template match="ed:replace"> … … 1977 2007 </xsl:variable> 1978 2008 1979 <fo:bookmark internal-destination="{concat($anchor-prefix,'.authors')}"> 1980 <fo:bookmark-title><xsl:value-of select="$title"/></fo:bookmark-title> 1981 </fo:bookmark> 2009 <xsl:if test="$authors-number!='suppress'"> 2010 <fo:bookmark internal-destination="{concat($anchor-prefix,'.authors')}"> 2011 <fo:bookmark-title><xsl:value-of select="$title"/></fo:bookmark-title> 2012 </fo:bookmark> 2013 </xsl:if> 1982 2014 </xsl:template> 1983 2015 … … 1994 2026 1995 2027 <xsl:choose> 2028 <xsl:when test="count(/*/back/references) = 0"> 2029 <!-- nothing to do --> 2030 </xsl:when> 1996 2031 <xsl:when test="count(/*/back/references) = 1"> 1997 2032 <xsl:for-each select="/*/back/references"> … … 2070 2105 <xsl:apply-templates select="front/note" mode="bookmarks"/> 2071 2106 2072 <xsl:if test="$xml2rfc-toc ">2107 <xsl:if test="$xml2rfc-toc='yes'"> 2073 2108 <fo:bookmark internal-destination="{concat($anchor-prefix,'.toc')}"> 2074 2109 <fo:bookmark-title>Table of Contents</fo:bookmark-title> … … 2153 2188 </fo:table-column> 2154 2189 </xsl:for-each> 2155 <fo:table-header start-indent="0em" space-after=".5em"> 2156 <fo:table-row> 2157 <xsl:apply-templates select="ttcol" /> 2158 </fo:table-row> 2159 </fo:table-header> 2190 <xsl:if test="ttcol!=''"> 2191 <!-- skip header when all column titles are empty --> 2192 <fo:table-header start-indent="0em" space-after=".5em"> 2193 <fo:table-row> 2194 <xsl:apply-templates select="ttcol" /> 2195 </fo:table-row> 2196 </fo:table-header> 2197 </xsl:if> 2160 2198 <fo:table-body start-indent="0em"> 2161 2199 <xsl:if test="$style='full' or $style='headers'"> … … 2327 2365 </xsl:when> 2328 2366 <xsl:otherwise> 2329 <xsl:message>WARNING: internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:message> 2367 <xsl:call-template name="warning"> 2368 <xsl:with-param name="inline" select="'no'"/> 2369 <xsl:with-param name="msg">internal link target for '<xsl:value-of select="."/>' does not exist.</xsl:with-param> 2370 </xsl:call-template> 2330 2371 <xsl:apply-templates/> 2331 2372 </xsl:otherwise> … … 2336 2377 <xsl:template match="x:bcp14"> 2337 2378 <!-- figure out something that prints well --> 2379 <xsl:apply-templates/> 2380 </xsl:template> 2381 2382 <!-- Notes --> 2383 <xsl:template match="x:note"> 2338 2384 <xsl:apply-templates/> 2339 2385 </xsl:template> … … 2364 2410 <!-- Headings --> 2365 2411 <xsl:template match="x:h"> 2412 <fo:wrapper font-weight="bold"> 2413 <xsl:apply-templates/> 2414 </fo:wrapper> 2415 </xsl:template> 2416 2417 <!-- Highlightinghing --> 2418 <xsl:template match="x:highlight"> 2366 2419 <fo:wrapper font-weight="bold"> 2367 2420 <xsl:apply-templates/> … … 2437 2490 <xsl:template match="x:bt|x:bc|x:bb"> 2438 2491 <xsl:apply-templates /> 2492 </xsl:template> 2493 2494 <!-- author handling extensions --> 2495 <xsl:template match="x:include-author"> 2496 <xsl:for-each select="/*/front/author[@anchor=current()/@target]"> 2497 <xsl:apply-templates select="."/> 2498 </xsl:for-each> 2439 2499 </xsl:template> 2440 2500
Note: See TracChangeset
for help on using the changeset viewer.