-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra-abstract-workaround.xsl
34 lines (28 loc) · 1.17 KB
/
extra-abstract-workaround.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="xs"
version="3.0">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="*|@*|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="article-meta/abstract[not(@abstract-type)][1]">
<abstract>
<xsl:apply-templates select="*|@*|text()"/>
<xsl:for-each select="following-sibling::abstract[not(@abstract-type)]|parent::article-meta/abstract[@abstract-type]">
<sec>
<xsl:apply-templates select="@id"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="*"/>
<xsl:text>
</xsl:text>
</sec>
</xsl:for-each>
</abstract>
</xsl:template>
<xsl:template match="article-meta/abstract[not(@abstract-type)][position() gt 1]"/>
<xsl:template match="article-meta/abstract[@abstract-type]"/>
</xsl:stylesheet>