*
*I have two book author names marked up in <authorgroup>:
<authorgrouprole="leadauthor">
<author>
<personname><honorific>Mr</honorific><firstname>John</firstname><surname>Smith</surname></personname>
<contrib>Lead author contribution</contrib>
<affiliation>
<shortaffil>Short affil.</shortaffil>
<jobtitle>Job title</jobtitle>
<orgname>Organisational affiliation</orgname>
<orgdiv>Org div</orgdiv>
<address>Org address</address>
</affiliation>
</author>
<author>
<personname>Name of second lead author</personname>
</author>
</authorgroup>
My first issue is trying to generate both <author> names in separate
meta elements in HTML5 using 1.78.1-ns. This is all I get:
<metaname="dcterms:creator"content="Smith, John"/>
I have a customization that generates only the first author's names
(firstname and surname) -- I don't get the second author, nor do I get
any content inside only <personname> (so far I need both <firstname> and
<surname> to generate content):
<xsl:templatename="user.head.content">
<xsl:paramname="node"select="."/>
<xsl:variablename="info"select="(d:info)[1]"/>
...
<xsl:iftest="$info and
$info//d:author[ancestor::d:authorgroup[@role='leadauthor']]">
<metaname="dcterms:creator">
<xsl:attributename="content">
<!--<xsl:call-template name="person.name.last-first">
<xsl:with-param name="node" select="."/>
</xsl:call-template>-->
<xsl:choose>
<xsl:whentest="descendant::d:surname">
<xsl:value-ofselect="normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:surname))"/>
<xsl:text>, </xsl:text>
<xsl:value-ofselect="normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:firstname))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-ofselect="normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</meta>
</xsl:if>
...
</xsl:template>
I tried using xsl:for-each around the <meta> coding, and then again
inside <meta>, but that generates the first author's name multiple times
in one <meta> element. I can't see any clues from the EPUB metadata
stylesheets either.
So: (1) How do I generate one meta element *for each author*, and (2)
What coding works to generate content marked up in <personname> only
(i.e. no child elements)?
--
*Dave Gardiner*