<!---->
<
xsl:
stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:tps="
http://www.typefi.com/ContentXML"
xmlns:xd="
http://www.pnp-software.com/XSLTdoc"
version="
2.0"
exclude-result-prefixes="
#all">
<
xd:
doc type="
stylesheet">
<
xd:
short>
Processes elements located in <
code>
/article/front</
code>
.
</
xd:
short>
<
xd:
cvsId>
$Revision$</
xd:
cvsId>
</
xd:
doc>
<
xsl:
template match="
front">
<
xsl:
apply-templates select="
element()" />
</
xsl:
template>
<
xsl:
template match="
title-group/article-title">
<
tps:
p type="
{$article-title.para.type}">
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
title-group/subtitle">
<
tps:
p type="
{$subtitle.para.type}">
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
contrib-group">
<
tps:
p type="
{$contrib-group.para.type}">
<
xsl:
apply-templates select="
contrib" />
</
tps:
p>
<
xsl:
apply-templates select="
element() except contrib" />
</
xsl:
template>
<
xsl:
template match="
contrib">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$contrib-group.contrib.separator" />
</
xsl:
template>
<
xsl:
template match="
contrib[last() - 1]"
priority="
10">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$contrib-group.contrib.last.separator" />
</
xsl:
template>
<
xsl:
template match="
contrib[last()]"
priority="
10">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$contrib-group.contrib.last.postfix" />
</
xsl:
template>
<!---->
<
xsl:
template match="
contrib/name">
<
xsl:
apply-templates select="
prefix, given-names, surname, suffix" />
</
xsl:
template>
<
xsl:
template match="
contrib/name/surname">
<
xsl:
text>
</
xsl:
text>
<
xsl:
apply-templates />
</
xsl:
template>
<
xsl:
template match="
contrib/name/prefix">
<
xsl:
apply-templates />
<
xsl:
text>
</
xsl:
text>
</
xsl:
template>
<
xsl:
template match="
contrib/name/suffix">
<
xsl:
text>
</
xsl:
text>
<
xsl:
apply-templates />
</
xsl:
template>
<
xsl:
template match="
contrib/xref | contrib/role | contrib/author-comment" />
<
xsl:
template match="
aff">
<
tps:
p type="
{$aff.para.type}">
<
xsl:
apply-templates select="
attribute(), label, node() except label" />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
aff/@id">
<
xsl:
copy-of select="
." />
</
xsl:
template>
<
xsl:
template match="
aff/label">
<
xsl:
apply-templates />
<
xsl:
text>
. </
xsl:
text>
</
xsl:
template>
<
xsl:
template match="
corresp">
<
tps:
p type="
{$corresp.para.type}">
<
xsl:
apply-templates select="
attribute()" />
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
corresp/@id">
<
xsl:
copy-of select="
." />
</
xsl:
template>
<
xsl:
template match="
history/date[@date-type eq 'accepted']">
<
tps:
p type="
{$history.date.accepted.para.type}">
<
xsl:
text>
Accepted </
xsl:
text>
<
xsl:
call-template name="
put-date-formatted" />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
history/date[@date-type eq 'pub']">
<
tps:
p type="
{$history.date.pub.para.type}">
<
xsl:
text>
Published </
xsl:
text>
<
xsl:
call-template name="
put-date-formatted" />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
history/date[@date-type eq 'received']">
<
tps:
p type="
{$history.date.received.para.type}">
<
xsl:
text>
Received </
xsl:
text>
<
xsl:
call-template name="
put-date-formatted" />
</
tps:
p>
</
xsl:
template>
<
xsl:
template name="
put-date-formatted">
<
xsl:
value-of select="
tps:format-month(month)" />
<
xsl:
text>
</
xsl:
text>
<
xsl:
value-of select="
day" />
<
xsl:
text>
, </
xsl:
text>
<
xsl:
value-of select="
year" />
<
xsl:
text>
.</
xsl:
text>
</
xsl:
template>
<
xsl:
template match="
abstract">
<
xsl:
apply-templates select="
element() except label" />
</
xsl:
template>
<
xsl:
template match="
abstract/sec">
<
xsl:
apply-templates select="
element() except label" />
</
xsl:
template>
<
xsl:
template match="
abstract/label | abstract/sec/label">
<
xsl:
apply-templates />
<
xsl:
text>
. </
xsl:
text>
</
xsl:
template>
<
xsl:
template match="
abstract/title | abstract/sec/title">
<
tps:
p type="
{$abstract.title.para.type}">
<
xsl:
apply-templates select="
../label" />
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
abstract/p | abstract/sec/p">
<
tps:
p type="
{$abstract.p.para.type}">
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
kwd-group">
<
tps:
p type="
{$kwd-group.para.type}">
<
xsl:
apply-templates />
</
tps:
p>
</
xsl:
template>
<
xsl:
template match="
kwd-group/label">
<
xsl:
apply-templates />
<
xsl:
text>
. </
xsl:
text>
</
xsl:
template>
<
xsl:
template match="
kwd-group/title">
<
xsl:
apply-templates />
<
tps:
t />
</
xsl:
template>
<
xsl:
template match="
kwd[last() - 1]"
priority="
10">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$kwd-group.kwd.last.separator" />
</
xsl:
template>
<
xsl:
template match="
kwd[last()]"
priority="
10">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$kwd-group.kwd.last.postfix" />
</
xsl:
template>
<
xsl:
template match="
kwd">
<
xsl:
apply-templates />
<
xsl:
copy-of select="
$kwd-group.kwd.separator" />
</
xsl:
template>
<
xsl:
function name="
tps:get-publication-date-string"
as="
xs:string">
<
xsl:
param name="
pub-date"
as="
element(pub-date)?" />
<
xsl:
sequence select="
tps:get-publication-date-string($pub-date, false())" />
</
xsl:
function>
<!---->
<
xsl:
function name="
tps:get-publication-date-string"
as="
xs:string?">
<
xsl:
param name="
pub-date"
as="
element(pub-date)?" />
<
xsl:
param name="
format-month"
as="
xs:boolean?" />
<
xsl:
variable name="
month"
select="
if ($format-month) then tps:format-month($pub-date/month) else string($pub-date/month)" />
<
xsl:
sequence select="
if (exists($pub-date)) then tps:replace-tokens($pub-date.format, ('__DAY__', '__MONTH__', '__SEASON__', '__YEAR__'), (string($pub-date/day), $month, string($pub-date/season), string($pub-date/year))) else ()" />
</
xsl:
function>
</
xsl:
stylesheet>
v