-
Notifications
You must be signed in to change notification settings - Fork 0
/
xml-source-issues.xsl
61 lines (49 loc) · 2.23 KB
/
xml-source-issues.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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="http://www.tei-c.org/ns/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
xmlns:ge="http://www.tei-c.org/ns/geneticEditions"
xmlns:f="http://www.faustedition.net/ns"
exclude-result-prefixes="xs ge"
version="2.0">
<xsl:param name="filename" select="document-uri(/)"/>
<xsl:template match="node()|@*">
<xsl:copy copy-namespaces="no">
<xsl:apply-templates select="@*, node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="TEI">
<xsl:copy>
<xsl:apply-templates select="@*, node()"/>
</xsl:copy>
</xsl:template>
<!-- https://github.com/faustedition/faust-gen-html/issues/175
move stage at end of sp outside sp -->
<xsl:template match="sp[stage[not(following-sibling::*)]]">
<xsl:next-match/>
<xsl:for-each select="stage[not(following-sibling::*)]">
<xsl:copy>
<xsl:apply-templates select="@*, node()"/>
</xsl:copy>
</xsl:for-each>
</xsl:template>
<xsl:template match="sp/stage[not(following-sibling::*)]"/>
<!-- https://github.com/faustedition/faust-gen-html/issues/53
remove xml:space="preserve" where redundant -->
<xsl:template match="c[@xml:space='preserve']">
<!--<xsl:message>c[xml:space='preserve'] in <xsl:value-of select="$filename"/>: <xsl:copy-of select=".."/></xsl:message>-->
<xsl:next-match/>
</xsl:template>
<xsl:template match="@xml:space[parent::l|parent::line|parent::speaker|parent::note|parent::dateline|
parent::p|parent::head|parent::stage|parent::sp|parent::mod[@type=('erase', 'strikethrough')]]"/>
<!-- https://github.com/faustedition/faust-gen-html/issues/46
Replace <name> by <hi> in XML sources
-->
<xsl:template match="name">
<xsl:element name="hi">
<xsl:apply-templates select="@*, node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="stage//hi/@status[. = 'name']"/>
</xsl:stylesheet>