From: <xm...@us...> - 2006-08-15 13:11:26
|
Revision: 6166 Author: xmldoc Date: 2006-08-15 06:11:17 -0700 (Tue, 15 Aug 2006) ViewCVS: http://svn.sourceforge.net/docbook/?rev=6166&view=rev Log Message: ----------- Handle instances of authorblurb or personblurb that lack sibling *name or email content. Also, make sure space gets properly normalized in para and simpara within authorblurb or personblurb. Modified Paths: -------------- trunk/xsl/manpages/block.xsl trunk/xsl/manpages/info.xsl Modified: trunk/xsl/manpages/block.xsl =================================================================== --- trunk/xsl/manpages/block.xsl 2006-08-15 10:52:30 UTC (rev 6165) +++ trunk/xsl/manpages/block.xsl 2006-08-15 13:11:17 UTC (rev 6166) @@ -39,7 +39,9 @@ </xsl:template> <xsl:template match="para"> - <xsl:if test="not(ancestor::footnote[ancestor::table])"> + <xsl:if test="not(ancestor::footnote[ancestor::table]) and + not(ancestor::authorblurb) and + not(ancestor::personblurb)"> <xsl:text>.PP </xsl:text> </xsl:if> <xsl:call-template name="mixed-block"/> @@ -51,7 +53,10 @@ <xsl:apply-templates/> </xsl:variable> <xsl:value-of select="normalize-space($content)"/> - <xsl:text>.sp </xsl:text> + <xsl:if test="not(ancestor::authorblurb) and + not(ancestor::personblurb)"> + <xsl:text>.sp </xsl:text> + </xsl:if> </xsl:template> <!-- ==================================================================== --> Modified: trunk/xsl/manpages/info.xsl =================================================================== --- trunk/xsl/manpages/info.xsl 2006-08-15 10:52:30 UTC (rev 6165) +++ trunk/xsl/manpages/info.xsl 2006-08-15 13:11:17 UTC (rev 6166) @@ -217,15 +217,19 @@ </xsl:template> <xsl:template match="author|editor|othercredit" mode="authorsect"> - <xsl:text>.PP </xsl:text> <xsl:variable name="person-name"> <xsl:call-template name="person.name"/> </xsl:variable> - <!-- * Display person name in bold --> - <xsl:apply-templates mode="bold" select="exsl:node-set($person-name)"/> - <!-- * Display e-mail address(es) on same line as name --> - <xsl:apply-templates select=".//email" mode="authorsect"/> - <xsl:text> </xsl:text> + <!-- * If we have a person-name or email content, then output the name --> + <!-- * and email content on the same line --> + <xsl:if test="not($person-name = '') or .//email"> + <xsl:text>.PP </xsl:text> + <!-- * Display person name in bold --> + <xsl:apply-templates mode="bold" select="exsl:node-set($person-name)"/> + <!-- * Display e-mail address(es) on same line as name --> + <xsl:apply-templates select=".//email" mode="authorsect"/> + <xsl:text> </xsl:text> + </xsl:if> <!-- * Display affiliation(s) on separate lines --> <xsl:apply-templates select="affiliation" mode="authorsect"/> <!-- * Display direct-child addresses on separate lines --> @@ -416,18 +420,31 @@ </xsl:template> <xsl:template match="personblurb|authorblurb" mode="authorsect"> - <xsl:text> .sp -1n </xsl:text> - <xsl:text>.IP ""</xsl:text> - <xsl:if test="not($blurb-indent = '')"> - <xsl:text> </xsl:text> - <xsl:value-of select="$blurb-indent"/> - </xsl:if> + <xsl:choose> + <!-- * If this *blurb has a sibling "name" element of some kind, then --> + <!-- * we are already outputting the name content, and we need to --> + <!-- * indent the *blurb content after that. --> + <xsl:when + test="../personname|../surname|../firstname + |../othername|../lineage|../honorific + |../affiliation|../email|../address"> + <xsl:text> .sp -1n </xsl:text> + <xsl:text>.IP ""</xsl:text> + <xsl:if test="not($blurb-indent = '')"> + <xsl:text> </xsl:text> + <xsl:value-of select="$blurb-indent"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <!-- * otherwise, we have no "name" content, so just output the --> + <!-- * *blurb content flush left --> + <xsl:text>.PP</xsl:text> + </xsl:otherwise> + </xsl:choose> <xsl:text> </xsl:text> <!-- * yeah, it's possible for a *blurb to have a "title" --> <xsl:apply-templates select="title"/> - <xsl:for-each select="*[name() != 'title']"> - <xsl:apply-templates/> - </xsl:for-each> + <xsl:apply-templates select="*[not(self::title)]"/> </xsl:template> <xsl:template match="personblurb/title|authorblurb/title"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |