2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
   3                 xmlns:date="http://exslt.org/dates-and-times"
 
   4                 xmlns:exsl="http://exslt.org/common"
 
   5                 exclude-result-prefixes="date exsl"
 
   8 <!-- ********************************************************************
 
   9      $Id: info.xsl 7883 2008-03-08 17:59:39Z xmldoc $
 
  10      ********************************************************************
 
  12      This file is part of the XSL DocBook Stylesheet distribution.
 
  13      See ../README or http://docbook.sf.net/release/xsl/current/ for
 
  14      copyright and other information.
 
  16      ******************************************************************** -->
 
  18   <xsl:variable name="blurb-indent">
 
  20       <xsl:when test="not($man.indent.blurbs = 0)">
 
  21         <xsl:value-of select="$man.indent.width"/>
 
  23       <xsl:when test="not($man.indent.refsect = 0)">
 
  24         <!-- * "zq" is the name of a register we set for -->
 
  25         <!-- * preserving the original default indent value -->
 
  26         <!-- * when $man.indent.refsect is non-zero; -->
 
  27         <!-- * "u" is a roff unit specifier -->
 
  28         <xsl:text>\n(zqu</xsl:text>
 
  30       <xsl:otherwise/> <!-- * otherwise, just leave it empty -->
 
  34   <!-- ================================================================== -->
 
  35   <!-- * About the $info param used in this stylesheet -->
 
  37   <!-- * The $info param is a "master info" node set that contains -->
 
  38   <!-- * the entire contents of the *info child of the current -->
 
  39   <!-- * Refentry, plus the entire contents of the *info children of -->
 
  40   <!-- * all ancestors of the current Refentry, in document order. -->
 
  42   <!-- * We try to find a "best match" for selecting content from -->
 
  43   <!-- * $infor; we look through it in reverse document order until we -->
 
  44   <!-- * can find something usable. -->
 
  46   <!-- * Specifically what the basic metadata-gathering XPath expression -->
 
  47   <!-- * in this stylesheet does is: -->
 
  49   <!-- *   1. Look through the entire "master info" node set.-->
 
  50   <!-- *   2. Get the last node in the set that contains, for -->
 
  51   <!-- *      example, an Author element. That amounts to being the -->
 
  52   <!-- *      closest *info node to the Refentry - either its *info -->
 
  53   <!-- *      child, or the *info node of its closest ancestor that -->
 
  54   <!-- *      contains an Author. -->
 
  56   <!-- ================================================================== -->
 
  57   <!-- * Get user "refentry metadata" preferences -->
 
  58   <!-- ================================================================== -->
 
  59   <!-- * The DocBook XSL stylesheets include several user-configurable -->
 
  60   <!-- * global stylesheet parameters for controlling refentry metadata -->
 
  61   <!-- * gathering. Those parameters are not read directly by the other -->
 
  62   <!-- * refentry metadata-gathering templates. Instead, they are read -->
 
  63   <!-- * only by the get.refentry.metadata.prefs template, which -->
 
  64   <!-- * assembles them into a structure that is then passed to the -->
 
  65   <!-- * other refentry metadata-gathering template. -->
 
  67   <xsl:variable name="get.refentry.metadata.prefs">
 
  68     <!-- * get.refentry.metadata.prefs is in common/refentry.xsl -->
 
  69     <xsl:call-template name="get.refentry.metadata.prefs"/>
 
  72   <xsl:variable name="refentry.metadata.prefs"
 
  73                 select="exsl:node-set($get.refentry.metadata.prefs)"/>
 
  75   <!-- * ============================================================== -->
 
  76   <!-- *    Get content for Author metadata field. -->
 
  77   <!-- * ============================================================== -->
 
  79   <!-- * The make.roff.metatada.author template and metadata.author -->
 
  80   <!-- * mode are used only for populating the Author field in the -->
 
  81   <!-- * metadata "top comment" we embed in roff source of each page. -->
 
  82   <xsl:template name="make.roff.metadata.author">
 
  83     <xsl:param name="info"/>
 
  84     <xsl:param name="refname"/>
 
  86       <xsl:when test="$info//author">
 
  88             select="(($info[//author])[last()]//author)[1]"
 
  89             mode="metadata.author"/>
 
  91       <xsl:when test="$info//corpauthor">
 
  93             select="(($info[//corpauthor])[last()]//corpauthor)[1]"
 
  94             mode="metadata.author"/>
 
  96       <xsl:when test="$info//editor">
 
  98             select="(($info[//editor])[last()]//editor)[1]"
 
  99             mode="metadata.author"/>
 
 101       <xsl:when test="$info//corpcredit">
 
 103             select="(($info[//corpcredit])[last()]//corpcredit)[1]"
 
 104             mode="metadata.author"/>
 
 106       <xsl:when test="$info//othercredit">
 
 108             select="(($info[//othercredit])[last()]//othercredit)[1]"
 
 109             mode="metadata.author"/>
 
 111       <xsl:when test="$info//collab">
 
 113             select="(($info[//collab])[last()]//collab)[1]"
 
 114             mode="metadata.author"/>
 
 116       <xsl:when test="$info//orgname">
 
 118             select="(($info[//orgname])[last()]//orgname)[1]"
 
 119             mode="metadata.author"/>
 
 121       <xsl:when test="$info//publishername">
 
 123             select="(($info[//publishername])[last()]//publishername)[1]"
 
 124             mode="metadata.author"/>
 
 127         <!-- * otherwise, we need to check to see if we have an "Author" -->
 
 128         <!-- * or "Authors" section in the refentry -->
 
 129         <xsl:variable name="gentext.author">
 
 130           <xsl:text>"</xsl:text>
 
 131           <xsl:call-template name="gentext">
 
 132             <xsl:with-param name="key" select="'Author'"/>
 
 134           <xsl:text>"</xsl:text>
 
 136         <xsl:variable name="gentext.AUTHOR">
 
 137           <xsl:if test="not($gentext.author = '')">
 
 138             <xsl:call-template name="string.upper">
 
 139               <xsl:with-param name="string" select="$gentext.author"/>
 
 143         <xsl:variable name="gentext.authors">
 
 144           <xsl:text>"</xsl:text>
 
 145           <xsl:call-template name="gentext">
 
 146             <xsl:with-param name="key" select="'Authors'"/>
 
 148           <xsl:text>"</xsl:text>
 
 150         <xsl:variable name="gentext.AUTHORS">
 
 151           <xsl:if test="not($gentext.authors = '')">
 
 152             <xsl:call-template name="string.upper">
 
 153               <xsl:with-param name="string" select="$gentext.authors"/>
 
 157         <!-- * get all refentry/refsect1/title & refentry/refsection/title -->
 
 158         <!-- * instances, delimit each with double quotes, and put them -->
 
 159         <!-- * into a single refsect1.titles string -->
 
 160         <xsl:variable name="refsect1.titles">
 
 161           <xsl:for-each select="refsect1/title">
 
 162             <xsl:text>"</xsl:text>
 
 163             <xsl:value-of select="normalize-space(.)"/>
 
 164             <xsl:text>"</xsl:text>
 
 165             <xsl:text> </xsl:text>
 
 167           <xsl:for-each select="refsection/title">
 
 168             <xsl:text>"</xsl:text>
 
 169             <xsl:value-of select="normalize-space(.)"/>
 
 170             <xsl:text>"</xsl:text>
 
 171             <xsl:text> </xsl:text>
 
 174         <xsl:variable name="author.section.title">
 
 176             <xsl:when test="not($gentext.authors = '') and
 
 177               contains($refsect1.titles,$gentext.authors)">
 
 178               <xsl:value-of select="$gentext.authors"/>
 
 180             <xsl:when test="not($gentext.AUTHORS = '') and
 
 181               contains($refsect1.titles,$gentext.AUTHORS)">
 
 182               <xsl:value-of select="$gentext.AUTHORS"/>
 
 184             <xsl:when test="not($gentext.author = '') and
 
 185               contains($refsect1.titles,$gentext.author)">
 
 186               <xsl:value-of select="$gentext.author"/>
 
 188             <xsl:when test="not($gentext.AUTHOR = '') and
 
 189               contains($refsect1.titles,$gentext.AUTHOR)">
 
 190               <xsl:value-of select="$gentext.AUTHOR"/>
 
 192             <!-- * git docs (for one) use "DOCUMENTATION" for their authors section -->
 
 193             <xsl:when test="contains($refsect1.titles,'Documentation')">
 
 194               <xsl:text>Documentation</xsl:text>
 
 196             <xsl:when test="contains($refsect1.titles,'DOCUMENTATION')">
 
 197               <xsl:text>DOCUMENTATION</xsl:text>
 
 199             <xsl:otherwise/> <!-- * otherwise, leave empty -->
 
 203           <xsl:when test="not($author.section.title = '')">
 
 204             <!-- * if we have a non-empty $author.section.title value, -->
 
 205             <!-- * then reference that title (instead of putting a -->
 
 206             <!-- * specific author name) -->
 
 207             <xsl:text>[see the </xsl:text>
 
 208             <xsl:value-of select="$author.section.title"/>
 
 209             <xsl:text> section]</xsl:text>
 
 212             <!-- * otherwise we have no info/author content and no Author -->
 
 213             <!-- * or Authors section, so we insert a fixme and report -->
 
 214             <!-- * the problem to the user -->
 
 215             <xsl:text>[FIXME: author] [see http://docbook.sf.net/el/author]</xsl:text>
 
 216             <xsl:if test="$refentry.meta.get.quietly = 0">
 
 217               <xsl:call-template name="log.message">
 
 218                 <xsl:with-param name="level">Warn</xsl:with-param>
 
 219                 <xsl:with-param name="source" select="$refname"/>
 
 220                 <xsl:with-param name="context-desc">meta author</xsl:with-param>
 
 221                 <xsl:with-param name="message">
 
 222                   <xsl:text>no refentry/info/author</xsl:text>
 
 225               <xsl:call-template name="log.message">
 
 226                 <xsl:with-param name="level">Note</xsl:with-param>
 
 227                 <xsl:with-param name="source" select="$refname"/>
 
 228                 <xsl:with-param name="context-desc">meta author</xsl:with-param>
 
 229                 <xsl:with-param name="message">
 
 230                   <xsl:text>see http://docbook.sf.net/el/author</xsl:text>
 
 233               <xsl:call-template name="log.message">
 
 234                 <xsl:with-param name="level">Warn</xsl:with-param>
 
 235                 <xsl:with-param name="source" select="$refname"/>
 
 236                 <xsl:with-param name="context-desc">meta author</xsl:with-param>
 
 237                 <xsl:with-param name="message">
 
 238                   <xsl:text>no author data, so inserted a fixme</xsl:text>
 
 248   <xsl:template match="author|editor|othercredit|collab" mode="metadata.author">
 
 250       <xsl:when test="collabname">
 
 251         <!-- * If this node is a Collab, then it should have a -->
 
 252         <!-- * Collabname child, so get that. -->
 
 253         <xsl:variable name="contents">
 
 254           <xsl:apply-templates select="collabname"/>
 
 256         <xsl:value-of select="normalize-space($contents)"/>
 
 259         <!-- * Otherwise, this node is not a Collab, but instead -->
 
 260         <!-- * an author|editor|othercredit, which must have a name -->
 
 261         <!-- * of some kind; so get that name -->
 
 262         <xsl:call-template name="person.name.normalized"/>
 
 265     <xsl:if test=".//email|address/otheraddr/ulink">
 
 266       <xsl:text> </xsl:text>
 
 267       <!-- * For each attribution found, use only the first e-mail -->
 
 268       <!-- * address or ulink value found -->
 
 269       <xsl:apply-templates select="(.//email|address/otheraddr/ulink)[1]"
 
 270                            mode="metadata.author"/>
 
 274   <xsl:template match="email|address/otheraddr/ulink" mode="metadata.author">
 
 275     <xsl:text><</xsl:text>
 
 277       <xsl:when test="self::email">
 
 278         <xsl:variable name="contents">
 
 279           <xsl:apply-templates/>
 
 281         <xsl:value-of select="normalize-space($contents)"/>
 
 283       <xsl:when test="self::ulink">
 
 284         <xsl:variable name="contents">
 
 285           <xsl:apply-templates select="."/>
 
 287         <xsl:value-of select="normalize-space($contents)"/>
 
 290     <xsl:text>></xsl:text>
 
 293   <xsl:template match="corpauthor|corpcredit|orgname|publishername" mode="metadata.author">
 
 294     <xsl:variable name="contents">
 
 295       <xsl:apply-templates/>
 
 297     <xsl:value-of select="normalize-space($contents)"/>
 
 300   <!-- * ============================================================== -->
 
 301   <!-- *     Assemble the AUTHOR/AUTHORS section -->
 
 302   <!-- * ============================================================== -->
 
 304   <xsl:template name="author.section">
 
 305     <xsl:param name="info"/>
 
 306     <!-- * The $info param is a "master info" node set that contains -->
 
 307     <!-- * the entires contents of the *info child of the current -->
 
 308     <!-- * Refentry, plus the entire contents of the *info children of -->
 
 309     <!-- * all ancestors of the current Refentry, in document order. -->
 
 311       <xsl:when test="$info//author|$info//editor|$info//collab|
 
 312                       $info//corpauthor|$info//corpcredit|
 
 313                       $info//othercredit|$info/orgname|
 
 314                       $info/publishername|$info/publisher">
 
 315         <xsl:variable name="authorcount">
 
 318                       $info//author|$info//editor|$info//collab|
 
 319                       $info//corpauthor|$info//corpcredit|
 
 320                       $info//othercredit)">
 
 323         <xsl:call-template name="make.subheading">
 
 324           <xsl:with-param name="title">
 
 325             <xsl:call-template name="make.authorsecttitle">
 
 326               <xsl:with-param name="authorcount" select="$authorcount"/>
 
 330         <!-- * Now output all the actual author, editor, etc. content -->
 
 332           select="$info//author|$info//editor|$info//collab|
 
 333           $info//corpauthor|$info//corpcredit|
 
 334           $info//othercredit|$info/orgname|
 
 335           $info/publishername|$info/publisher">
 
 336           <xsl:apply-templates select="." mode="authorsect"/>
 
 339       <xsl:otherwise/> <!-- * do nothing, no author info found -->
 
 343   <xsl:template name="make.authorsecttitle">
 
 344     <!-- * If we have exactly one attributable person/entity, then output -->
 
 345     <!-- * localized gentext for 'Author'; otherwise, output 'Authors'. -->
 
 346     <xsl:param name="authorcount"/>
 
 347     <xsl:param name="authorsecttitle">
 
 349         <xsl:when test="$authorcount = 1">
 
 350           <xsl:text>Author</xsl:text>
 
 353           <xsl:text>Authors</xsl:text>
 
 357     <xsl:call-template name="gentext">
 
 358       <xsl:with-param name="key" select="$authorsecttitle"/>
 
 362   <xsl:template match="author|editor|othercredit" mode="authorsect">
 
 363     <xsl:variable name="person-name">
 
 364       <xsl:call-template name="person.name.normalized"/>
 
 366     <!-- * If we have a person-name or email or ulink content, then -->
 
 367     <!-- * output name and email or ulink content on the same line -->
 
 369       <xsl:when test="not($person-name = '') or .//email or address/otheraddr/ulink">
 
 370         <xsl:text>.PP
</xsl:text>
 
 371         <!-- * Display person name in bold -->
 
 372         <xsl:call-template name="bold">
 
 373           <xsl:with-param name="node" select="exsl:node-set($person-name)"/>
 
 374           <xsl:with-param name="context" select="."/>
 
 376         <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
 
 377         <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
 
 378         <xsl:text>
</xsl:text>
 
 381         <xsl:text>.br
</xsl:text>
 
 384     <!-- * Display affiliation(s) on separate lines -->
 
 385     <xsl:apply-templates select="affiliation" mode="authorsect"/>
 
 386     <!-- * Display direct-child addresses on separate lines -->
 
 387     <xsl:apply-templates select="address" mode="authorsect"/>
 
 388     <!-- * Call template for handling various attribution possibilities -->
 
 389     <xsl:call-template name="attribution">
 
 390       <xsl:with-param name="person-name" select="$person-name"/>
 
 394   <xsl:template match="collab" mode="authorsect">
 
 395     <xsl:text>.PP
</xsl:text>
 
 396     <xsl:call-template name="bold">
 
 397       <xsl:with-param name="node" select="collabname"/>
 
 398       <xsl:with-param name="context" select="."/>
 
 400     <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
 
 401     <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
 
 402     <xsl:text>
</xsl:text>
 
 403     <!-- * Display affilition(s) on separate lines -->
 
 404     <xsl:apply-templates select="affiliation" mode="authorsect"/>
 
 407   <xsl:template match="corpauthor|corpcredit|orgname|publishername" mode="authorsect">
 
 408     <xsl:text>.PP
</xsl:text>
 
 409     <xsl:call-template name="bold">
 
 410       <xsl:with-param name="node" select="."/>
 
 411       <xsl:with-param name="context" select="."/>
 
 413     <xsl:text>
</xsl:text>
 
 414     <xsl:if test="self::publishername">
 
 415       <!-- * Display localized "Publisher" gentext -->
 
 416       <xsl:call-template name="publisher.attribution"/>
 
 420   <xsl:template match="publisher" mode="authorsect">
 
 421     <xsl:text>.PP
</xsl:text>
 
 422     <xsl:call-template name="bold">
 
 423       <xsl:with-param name="node" select="publishername"/>
 
 424       <xsl:with-param name="context" select="."/>
 
 426     <!-- * Display e-mail address(es) and ulink(s) on same line as name -->
 
 427     <xsl:apply-templates select=".//email|address/otheraddr/ulink" mode="authorsect"/>
 
 428     <!-- * Display addresses on separate lines -->
 
 429     <xsl:apply-templates select="address" mode="authorsect"/>
 
 430     <!-- * Display localized "Publisher" literal -->
 
 431     <xsl:call-template name="publisher.attribution"/>
 
 434   <xsl:template name="publisher.attribution">
 
 435     <xsl:text>
</xsl:text>
 
 436     <xsl:text>.RS</xsl:text> 
 
 437     <xsl:if test="not($blurb-indent = '')">
 
 438       <xsl:text> </xsl:text>
 
 439       <xsl:value-of select="$blurb-indent"/>
 
 441     <xsl:text>
</xsl:text>
 
 442     <xsl:call-template name="gentext">
 
 443       <xsl:with-param name="key" select="'Publisher'"/>
 
 445     <xsl:text>.
</xsl:text>
 
 446     <xsl:text>.RE
</xsl:text> 
 
 449   <xsl:template match="email|address/otheraddr/ulink" mode="authorsect">
 
 451       <xsl:when test="preceding-sibling::*[descendant-or-self::email]
 
 452                       or preceding-sibling::address/otheraddr/ulink
 
 453                       or ancestor::address[preceding-sibling::*[descendant-or-self::email]]
 
 454                       or ancestor::address[preceding-sibling::address/otheraddr/ulink]">
 
 455         <!-- * This is not the first instance, so do nothing. -->
 
 458         <!-- * This is first instances of an e-mail address or ulink, -->
 
 459         <!-- * so put a space before it. -->
 
 460         <xsl:text> </xsl:text>
 
 463     <!-- * Note that the reason for the \& character after the opening -->
 
 464     <!-- * angle bracket and before the closing angle bracket is to -->
 
 465     <!-- * prevent groff from inserting a linebreak at those points and -->
 
 466     <!-- * outputting a hyphen character where the break occurs -->
 
 467     <xsl:text><\&</xsl:text>
 
 469       <xsl:when test="self::email">
 
 470         <xsl:variable name="contents">
 
 471           <xsl:apply-templates/>
 
 473         <xsl:value-of select="normalize-space($contents)"/>
 
 475       <xsl:when test="self::ulink">
 
 476         <xsl:variable name="contents">
 
 477           <xsl:apply-templates select="."/>
 
 479         <xsl:value-of select="normalize-space($contents)"/>
 
 482     <xsl:text>\&></xsl:text>
 
 484       <xsl:when test="not(following-sibling::*[descendant-or-self::email]
 
 485                       or following-sibling::address/otheraddr/ulink
 
 486                       or ancestor::address[following-sibling::*[descendant-or-self::email]]
 
 487                       or ancestor::address[following-sibling::address/otheraddr/ulink])">
 
 488         <!-- * This is the final instance, so do nothing. -->
 
 491         <!-- * Separate multiple e-mail addresses or ulinks with a comma -->
 
 492         <xsl:text>, </xsl:text>
 
 497   <xsl:template match="affiliation" mode="authorsect">
 
 498     <!-- * Get the string value of the contents of this Affiliation. If the -->
 
 499     <!-- * affiliation only contains an Address child whose only content is -->
 
 500     <!-- * an email address or ulink, then these contents will end up empty. -->
 
 501     <xsl:variable name="contents">
 
 502       <xsl:apply-templates mode="authorsect"/>
 
 504     <!-- * If contents are actually empty except for an email address -->
 
 505     <!-- * or ulink, then output nothing. -->
 
 506     <xsl:if test="$contents != ''">
 
 507       <xsl:text>.br
</xsl:text>
 
 508       <xsl:for-each select="shortaffil|jobtitle|orgname|orgdiv|address">
 
 509         <!-- * only display output of nodes other than email or ulink -->
 
 510         <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
 
 512           <xsl:when test="position() = last()"/> <!-- do nothing -->
 
 514             <!-- * only add comma if the node has a child node other than -->
 
 515             <!-- * an email address or ulink -->
 
 516             <xsl:if test="child::node()[not(self::email) and not(self::otheraddr/ulink)]">
 
 517               <xsl:text>, </xsl:text>
 
 522       <xsl:text>
</xsl:text>
 
 524         <xsl:when test="position() = last()"/> <!-- do nothing -->
 
 526           <!-- * put a line break after every Affiliation instance except -->
 
 527           <!-- * the last one in the set -->
 
 528           <xsl:text>.br
</xsl:text>
 
 534   <xsl:template match="address" mode="authorsect">
 
 535     <xsl:variable name="contents"
 
 536                   select="normalize-space(node()[not(self::email)
 
 537                           and not(self::otheraddr/ulink)])"/>
 
 538     <!-- * If this contents of this Address do not contain anything except -->
 
 539     <!-- * an email address or ulink, then output nothing. -->
 
 540     <xsl:if test="$contents != ''">
 
 541       <xsl:text>
</xsl:text>
 
 542       <xsl:text>.br
</xsl:text>
 
 543       <!--* Skip email and ulink descendants of Address (rendered elsewhere) -->
 
 544       <xsl:apply-templates select="node()[not(self::email) and not(self::otheraddr/ulink)]"/>
 
 548   <xsl:template name="attribution">
 
 549     <xsl:param name="person-name"/>
 
 550     <xsl:param name="refname" select="ancestor::refentry/refnamediv[1]/refname[1]"/>
 
 551     <!-- * Determine appropriate attribution for a particular person's role. -->
 
 553       <!-- * if we have a *blurb or contrib, just use that -->
 
 554       <xsl:when test="contrib|personblurb|authorblurb">
 
 555         <xsl:apply-templates select="contrib|personblurb|authorblurb" mode="authorsect"/>
 
 556         <xsl:text>
</xsl:text>
 
 559         <!-- * otherwise we have no attribution information to use... -->
 
 560         <xsl:if test="not($person-name = '')">
 
 561           <!-- * if we have a person name or organization name -->
 
 562           <!-- * ($person-name can actually be an orgname, not just a -->
 
 563           <!-- * person name), then report to the user that we are -->
 
 564           <!-- * lacking attribution information for that person -->
 
 565           <xsl:if test="$refentry.meta.get.quietly = 0">
 
 566             <xsl:call-template name="log.message">
 
 567               <xsl:with-param name="level">Warn</xsl:with-param>
 
 568               <xsl:with-param name="source" select="$refname"/>
 
 569               <xsl:with-param name="context-desc">AUTHOR sect.</xsl:with-param>
 
 570               <xsl:with-param name="message">
 
 571                 <xsl:text>no personblurb|contrib for </xsl:text>
 
 572                 <xsl:value-of select="$person-name"/>
 
 575             <xsl:call-template name="log.message">
 
 576               <xsl:with-param name="level">Note</xsl:with-param>
 
 577               <xsl:with-param name="source" select="$refname"/>
 
 578               <xsl:with-param name="context-desc">AUTHOR sect.</xsl:with-param>
 
 579               <xsl:with-param name="message">
 
 580                 <xsl:text>see see http://docbook.sf.net/el/contrib</xsl:text>
 
 583             <xsl:call-template name="log.message">
 
 584               <xsl:with-param name="level">Note</xsl:with-param>
 
 585               <xsl:with-param name="source" select="$refname"/>
 
 586               <xsl:with-param name="context-desc">AUTHOR sect.</xsl:with-param>
 
 587               <xsl:with-param name="message">
 
 588                 <xsl:text>see see http://docbook.sf.net/el/personblurb</xsl:text>
 
 594           <!-- * If we have no *blurb or contrib, but this is an Author or -->
 
 595           <!-- * Editor, then render the corresponding localized gentext -->
 
 596           <xsl:when test="self::author">
 
 597             <xsl:text>
</xsl:text>
 
 598             <xsl:text>.RS</xsl:text> 
 
 599             <xsl:if test="not($blurb-indent = '')">
 
 600               <xsl:text> </xsl:text>
 
 601               <xsl:value-of select="$blurb-indent"/>
 
 603             <xsl:text>
</xsl:text>
 
 604             <xsl:call-template name="gentext">
 
 605               <xsl:with-param name="key" select="'Author'"/>
 
 607             <xsl:text>.
</xsl:text>
 
 608             <xsl:text>.RE
</xsl:text> 
 
 610           <xsl:when test="self::editor">
 
 611             <xsl:text>
</xsl:text>
 
 612             <xsl:text>.RS</xsl:text> 
 
 613             <xsl:if test="not($blurb-indent = '')">
 
 614               <xsl:text> </xsl:text>
 
 615               <xsl:value-of select="$blurb-indent"/>
 
 617             <xsl:text>
</xsl:text>
 
 618             <xsl:call-template name="gentext">
 
 619               <xsl:with-param name="key" select="'Editor'"/>
 
 621             <xsl:text>.
</xsl:text>
 
 622             <xsl:text>.RE
</xsl:text> 
 
 624           <!-- * If we have no *blurb or contrib, but this is an Othercredit, -->
 
 625           <!-- * check value of Class attribute and use corresponding gentext. -->
 
 626           <xsl:when test="self::othercredit">
 
 628               <xsl:when test="@class and @class != 'other'">
 
 629                 <xsl:text>
</xsl:text>
 
 630                 <xsl:text>.RS</xsl:text> 
 
 631                 <xsl:if test="not($blurb-indent = '')">
 
 632                   <xsl:text> </xsl:text>
 
 633                   <xsl:value-of select="$blurb-indent"/>
 
 635                 <xsl:text>
</xsl:text>
 
 636                 <xsl:call-template name="gentext">
 
 637                   <xsl:with-param name="key" select="@class"/>
 
 639                 <xsl:text>.
</xsl:text>
 
 640                 <xsl:text>.RE
</xsl:text> 
 
 643                 <!-- * We have an Othercredit, but no usable value for the Class -->
 
 644                 <!-- * attribute, so nothing to show, do nothing -->
 
 649             <!-- * We have no *blurb or contrib or anything else we can use to -->
 
 650             <!-- * display appropriate attribution for this person, so do nothing -->
 
 657   <xsl:template match="personblurb|authorblurb" mode="authorsect">
 
 658     <xsl:call-template name="mark.up.blurb.or.contrib"/>
 
 659     <!-- * yeah, it's possible for a *blurb to have a "title" -->
 
 660     <xsl:apply-templates select="title"/>
 
 661     <xsl:apply-templates select="*[not(self::title)]"/>
 
 662     <!-- * If this *blurb has a sibling "name" element of some kind, then -->
 
 663     <!-- * the mark.up.blurb.or.contrib template will generated an "RS" -->
 
 664     <!-- * call that will cause it to be indented; so we need to call -->
 
 665     <!-- * "RE" to restore the previous indent level -->
 
 666     <xsl:if test="../personname|../surname|../firstname
 
 667       |../othername|../lineage|../honorific
 
 668       |../affiliation|../email|../address">
 
 669       <xsl:text>.RE
</xsl:text> 
 
 673   <xsl:template match="personblurb/title|authorblurb/title">
 
 674     <!-- * always render period after title -->
 
 675     <xsl:variable name="contents">
 
 676       <xsl:apply-templates/>
 
 678     <xsl:value-of select="normalize-space($contents)"/>
 
 679     <xsl:text>.</xsl:text>
 
 680     <!-- * render space after Title+period if the title is followed -->
 
 681     <!-- * by something element content -->
 
 682     <xsl:if test="following-sibling::*[name() != '']">
 
 683       <xsl:text> </xsl:text>
 
 687   <xsl:template match="contrib" mode="authorsect">
 
 688     <xsl:call-template name="mark.up.blurb.or.contrib"/>
 
 689     <xsl:variable name="contents">
 
 690       <xsl:apply-templates/>
 
 692     <xsl:value-of select="normalize-space($contents)"/>
 
 693     <xsl:text>
</xsl:text>
 
 694     <xsl:if test="../personname|../surname|../firstname
 
 695       |../othername|../lineage|../honorific
 
 696       |../affiliation|../email|../address">
 
 697       <xsl:text>.RE
</xsl:text> 
 
 701   <xsl:template name="mark.up.blurb.or.contrib">
 
 703       <!-- * If this *blurb has a sibling "name" element of some kind, then -->
 
 704       <!-- * we are already outputting the name content, and we need to -->
 
 705       <!-- * indent the *blurb content after that. -->
 
 707           test="../personname|../surname|../firstname
 
 708                 |../othername|../lineage|../honorific
 
 709                 |../affiliation|../email|../address">
 
 710         <xsl:text>
</xsl:text>
 
 711         <xsl:text>.RS</xsl:text> 
 
 712         <xsl:if test="not($blurb-indent = '')">
 
 713           <xsl:text> </xsl:text>
 
 714           <xsl:value-of select="$blurb-indent"/>
 
 718         <!-- * otherwise, we have no "name" content, so don't indent; -->
 
 719         <!-- * instead, decide if we need a .PP or just a .br -->
 
 721           <xsl:when test="not(preceding-sibling::*)">
 
 722             <!-- * if this *blurb or contrib has no preceding -->
 
 723             <!-- * siblings, then we need to start a new paragraph -->
 
 724             <xsl:text>.PP</xsl:text>
 
 727             <!-- * otherwise, this has no preceding siblings, so -->
 
 728             <!-- * just put a linebreak -->
 
 729             <xsl:text>.br</xsl:text>
 
 734     <xsl:text>
</xsl:text>
 
 737   <!-- * ============================================================== -->
 
 738   <!-- *     Assemble the COPYRIGHT section -->
 
 739   <!-- * ============================================================== -->
 
 740   <!-- * The COPYRIGHT section is output only if a copyright or -->
 
 741   <!-- * legalnotice is found. It contains the copyright contents -->
 
 742   <!-- * followed by the legalnotice contents. -->
 
 743   <xsl:template name="copyright.section">
 
 744     <xsl:param name="info"/>
 
 746       <xsl:when test="$info//copyright|$info//legalnotice">
 
 747         <xsl:call-template name="make.subheading">
 
 748           <xsl:with-param name="title">
 
 749             <xsl:call-template name="gentext">
 
 750               <xsl:with-param name="key">Copyright</xsl:with-param>
 
 754         <xsl:text>.br
</xsl:text>
 
 755         <!-- * the copyright mode="titlepage.mode" template is -->
 
 756         <!-- * imported from the HTML stylesheets -->
 
 757         <xsl:for-each select="
 
 758           (($info[//copyright])[last()]//copyright)
 
 759           | (($info[//legalnotice])[last()]//legalnotice)">
 
 761             <xsl:when test="local-name(.) = 'copyright'">
 
 762               <xsl:variable name="contents">
 
 763                 <xsl:apply-templates select="." mode="titlepage.mode"/>
 
 765               <xsl:value-of select="normalize-space($contents)"/>
 
 766               <xsl:text>
</xsl:text>
 
 767               <xsl:text>.br
</xsl:text>
 
 770               <xsl:apply-templates select="." mode="titlepage.mode"/>
 
 771               <xsl:text>
</xsl:text>
 
 772               <xsl:text>.sp
</xsl:text>
 
 777       <xsl:otherwise/> <!-- * do nothing, no copyright or legalnotice found -->
 
 781   <xsl:template match="legalnotice">
 
 782     <xsl:apply-templates/>
 
 785   <!-- * ============================================================== -->
 
 787   <!-- * suppress refmeta and all *info (we grab what we need from them -->
 
 788   <!-- * elsewhere) -->
 
 790   <xsl:template match="refmeta"/>
 
 792   <xsl:template match="info|refentryinfo|referenceinfo|refsynopsisdivinfo
 
 793                        |refsectioninfo|refsect1info|refsect2info|refsect3info
 
 794                        |setinfo|bookinfo|articleinfo|chapterinfo|sectioninfo
 
 795                        |sect1info|sect2info|sect3info|sect4info|sect5info
 
 796                        |partinfo|prefaceinfo|appendixinfo|docinfo"/>
 
 798   <!-- ============================================================== -->