From: Bob Stayton <bobs@sagehill.net> Date: Sun, 20 Nov 2005 19:31:14 +0000 (+0000) Subject: Added normalize-space() to text values in document properties. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2cdb3bddcd1c876f3e32b4bd78f3d7903246c481;p=docbook-dsssl Added normalize-space() to text values in document properties. Handle author better, the same as xep.xsl. --- diff --git a/xsl/fo/axf.xsl b/xsl/fo/axf.xsl index 1e9db5c0f..32a93fd7a 100644 --- a/xsl/fo/axf.xsl +++ b/xsl/fo/axf.xsl @@ -10,13 +10,33 @@ <xsl:template name="axf-document-information"> - <xsl:if test="//author[1]"> + <xsl:variable name="authors" select="(//author|//editor| + //corpauthor|//authorgroup)[1]"/> + <xsl:if test="$authors"> + <xsl:variable name="author"> + <xsl:choose> + <xsl:when test="$authors[self::authorgroup]"> + <xsl:call-template name="person.name.list"> + <xsl:with-param name="person.list" + select="$authors/*[self::author|self::corpauthor| + self::othercredit|self::editor]"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$authors[self::corpauthor]"> + <xsl:value-of select="$authors"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="person.name"> + <xsl:with-param name="node" select="$authors"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:element name="axf:document-info"> <xsl:attribute name="name">author</xsl:attribute> <xsl:attribute name="value"> - <xsl:call-template name="person.name"> - <xsl:with-param name="node" select="//author[1]"/> - </xsl:call-template> + <xsl:value-of select="normalize-space($author)"/> </xsl:attribute> </xsl:element> </xsl:if> @@ -26,14 +46,18 @@ <xsl:apply-templates select="/*[1]" mode="title.markup"/> </xsl:variable> - <axf:document-info name="title" value="{$title}"/> + <axf:document-info> + <xsl:attribute name="title"> + <xsl:value-of select="normalize-space($title)"/> + </xsl:attribute> + </axf:document-info> <xsl:if test="//keyword"> <xsl:element name="axf:document-info"> <xsl:attribute name="name">keywords</xsl:attribute> <xsl:attribute name="value"> <xsl:for-each select="//keyword"> - <xsl:value-of select="."/> + <xsl:value-of select="normalize-space(.)"/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if> @@ -47,7 +71,7 @@ <xsl:attribute name="name">subject</xsl:attribute> <xsl:attribute name="value"> <xsl:for-each select="//subjectterm"> - <xsl:value-of select="."/> + <xsl:value-of select="normalize-space(.)"/> <xsl:if test="position() != last()"> <xsl:text>, </xsl:text> </xsl:if>