Docs: Get rid of all the xslt personname frobbing and use text for person names.
patch 37e420002d3f3fe2472a4d942742adfe0be02271
Author: "Karl O. Pinc" <kop@meme.com>
Date: Wed Oct 28 09:59:35 EDT 2015
* Docs: Get rid of all the xslt personname frobbing and use text for person names.
hunk ./doc/dblatex_pdf_style.xsl 58
-<!-- Get the names to look right. -->
-<xsl:include href="first-last.xsl"/>
-
hunk ./doc/first-last.xsl 1
-<?xml version='1.0'?>
-<xsl:stylesheet version='1.0'
- xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
- xmlns:date="http://exslt.org/dates-and-times"
- xmlns:gombemi="gombemi.namespace">
- <gombemi:comment>
- Copyright (C) 2012 The Meme Factory, Inc. http://www.meme.com/
- Copyright (C) 2005, 2008, 2010, Karl O. Pinc kop@meme.com
-
- This file is part of Gombe-MI.
- [_$_]
- Gombe-MI is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
- [_$_]
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Gombe-MI. If not, see http://www.gnu.org/licenses/.
-
- There, that set it up so we can have comments.
- From: http://www.dpawson.co.uk/xsl/index.html
- http://www.dpawson.co.uk/xsl/sect2/comments.html#d2747e112
-
- If this were not "top level" we'd have to also have
- <!-- <xsl:fallback/> -->
- somewhere in here.
-
- The topmost 2 lines are basic and required Header Information.
- </gombemi:comment>
- <gombemi:comment>
- Order the honorific at the end when rendering names.
-
- Bugs: This relies on an internal dblatex API.
- </gombemi:comment>
-
- <xsl:template name="person.name.first-last">
- <xsl:param name="node" select="."/>
-
- <xsl:if test="$node//firstname">
- <xsl:apply-templates select="$node//firstname[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//othername and $author.othername.in.middle != 0">
- <xsl:if test="$node//honorific or $node//firstname">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$node//othername[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//surname">
- <xsl:if test="$node//firstname
- or ($node//othername and $author.othername.in.middle != 0)">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$node//surname[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//lineage">
- <xsl:text>, </xsl:text>
- <xsl:apply-templates select="$node//lineage[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//honorific">
- <xsl:text>, </xsl:text>
- <xsl:apply-templates select="$node//honorific[1]"/>
- <xsl:value-of select="$punct.honorific"/>
- </xsl:if>
-</xsl:template>
-</xsl:stylesheet>
rmfile ./doc/first-last.xsl
hunk ./doc/gombemi_system.xml 171
- <personname>
- <firstname>Karl</firstname>
- <othername>O.</othername>
- <surname>Pinc</surname>
- </personname>
+ <personname>Karl O. Pinc</personname>
hunk ./doc/gombemi_system.xml 270
- <personname>
- <firstname>Karl</firstname>
- <othername>O.</othername>
- <surname>Pinc</surname>
- </personname>
+ <personname>Karl O. Pinc</personname>
hunk ./doc/gombemi_system.xml 289
- <personname>
- <firstname>Carson</firstname>
- <othername>M.</othername>
- <surname>Murray</surname>
- <honorific>PhD</honorific>
- </personname>
+ <personname>Carson M. Murray, PhD.</personname>
hunk ./doc/gombemi_system.xml 310
- <personname>
- <firstname>Elizabeth</firstname>
- <othername>V.</othername>
- <surname>Lonsdorf</surname>
- <honorific>PhD</honorific>
- </personname>
+ <personname>Elizabeth V. Lonsdorf, PhD.</personname>
hunk ./doc/gombemi_system.xml 332
- <personname>
- <firstname>Karen</firstname>
- <surname>Anderson</surname>
- </personname>
+ <personname>Karen Anderson</personname>
hunk ./doc/gombemi_system.xml 345
- <personname>
- <firstname>A.</firstname>
- <othername>Catherine</othername>
- <surname>Markham</surname>
- <honorific>PhD</honorific>
- </personname>
+ <personname>A. Catherine Markham, PhD.</personname>
hunk ./doc/gombemi_system.xml 367
- <personname>
- <firstname>Margaret</firstname>
- <othername>A.</othername>
- <surname>Stanton</surname>
- <honorific>PhD</honorific>
- </personname>
+ <personname>Margaret A. Stanton, PhD.</personname>
hunk ./doc/gombemi_system.xml 388
- <personname>
- <firstname>Edward</firstname>
- <surname>Wilkerson</surname>
- <lineage>Jr.</lineage>
- </personname>
+ <personname>Edward Wilkerson, Jr.</personname>
hunk ./doc/gombemi_system.xsl 120
-
- <gombemi:comment>
- This adds a dot after an honorific, in this case a PhD.
- </gombemi:comment>
-
- <gombemi:comment>
- Generate a name.
- From common/common.xsl
-
- To really do this right we'd need to:
- Have a person.name (or maybe author) attribute set:
- order last-first, first-last, etc.
- honorific.is.prefix True or false
- Have a punct.honorific attribute set:
- suffix (or null) suffixes the honorific
- separator separates honorific from name (when suffix)
- Have a gentext template to generate the honorific
- separator when the honorific is a suffix.
- Have a gentext template that returns true (is prefix)
- or false and allows honorific role=prefix or suffix.
- It would take a param which says whether the attribute
- set wants a prefix or a suffix. (May as well take the whole
- attribute set as a param.)
- It would test the parameter in the attribute set too.
- Then the person.name template does the logic.
-
- To avoid extending the docbook DTD keep it simple and don't
- require a role attribute. Pretty much move the honorific
- down to the bottom and get rid of the extra tests beforehand.
-
- Here's some sample code that uses a role attribute in the
- honorific element. But it does not work quite right.
- [_$_]
- <xsl:template name="person.name.first-last">
- <xsl:param name="node" select="."/>
-
- <xsl:variable name="trailing-honorific">
- <xsl:choose>
- <xsl:when test="$node//honorific and $node//honorific[@role='suffix']">
- 1
- </xsl:when>
- <xsl:otherwise>
- 0
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:if test="$node//honorific and $trailing-honorific = 0">
- <xsl:apply-templates select="$node//honorific[1]"/>
- <xsl:value-of select="$punct.honorific"/>
- </xsl:if>
-
- <xsl:if test="$node//firstname">
- <xsl:if test="$node//honorific">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$node//firstname[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//othername and $author.othername.in.middle != 0">
- <xsl:if test="$node//honorific or $node//firstname">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$node//othername[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//surname">
- <xsl:if test="$node//honorific or $node//firstname
- or ($node//othername and $author.othername.in.middle != 0)">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="$node//surname[1]"/>
- </xsl:if>
-
- <xsl:if test="$node//lineage">
- <xsl:text>, </xsl:text>
- <xsl:apply-templates select="$node//lineage[1]"/>
- </xsl:if>
-
- <xsl:if test="$trailing-honorific != 0">
- <xsl:text>, </xsl:text>
- <xsl:apply-templates select="$node//honorific[1]"/>
- <xsl:value-of select="$punct.honorific"/>
- </xsl:if>
-</xsl:template>
-</gombemi:comment>
-
-<xsl:include href="first-last.xsl"/>