← Prev in month
← Prev in thread
Generating multiple metadata elements in user.head.content
X-NONE
X-NONE
MicrosoftInternetExplorer4
I have two book author names marked up in <authorgroup>:
<authorgroup role="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:
<meta
name="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:template name="user.head.content">
<xsl:param name="node" select="."/>
<xsl:variable name="info" select="(d:info)[1]"/>
…
<xsl:if test="$info and
$info//d:author[ancestor::d:authorgroup[@role='leadauthor']]">
<meta name="dcterms:creator">
<xsl:attribute name="content">
<!--<xsl:call-template
name="person.name.last-first">
<xsl:with-param name="node" select="."/>
</xsl:call-template>-->
<xsl:choose>
<xsl:when test="descendant::d:surname">
<xsl:value-of select="normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:surname))"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="normalize-space(string($info/d:authorgroup[@role='leadauthor']/d:author/d:personname/d:firstname))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="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
← Prev in month
← Prev in thread