-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-tei-sources.xsl
128 lines (107 loc) · 3.87 KB
/
update-tei-sources.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?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"
version="2.0">
<!-- This stylesheet transforms a single TEI file from the old ge sig based format to the new one, based on TEI 3.4.0 -->
<xsl:template match="node()|@*">
<xsl:copy copy-namespaces="no">
<xsl:apply-templates select="@*, node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="f:hspace">
<space dim="horizontal">
<xsl:apply-templates select="@*, node()"/>
</space>
</xsl:template>
<xsl:template match="f:vspace">
<space dim="vertical">
<xsl:apply-templates select="@*, node()"/>
</space>
</xsl:template>
<xsl:template match="f:st">
<mod>
<xsl:attribute name="rend" select="if (@rend = 'erase') then 'erase' else 'strikethrough'"/>
<xsl:apply-templates select="@* except @rend, node()"/>
</mod>
</xsl:template>
<xsl:template match="f:overw">
<mod>
<xsl:attribute name="rend" select="('overwrite', @rend)" separator=" "/>
<xsl:apply-templates select="@* except @rend, node()"/>
</mod>
</xsl:template>
<xsl:template match="f:over">
<seg>
<xsl:attribute name="rend" select="'over', @rend" separator=" "/>
<xsl:apply-templates select="@* except @rend, node()"/>
</seg>
</xsl:template>
<xsl:template match="f:under">
<seg>
<xsl:attribute name="rend" select="'under', @rend" separator=" "/>
<xsl:apply-templates select="@* except @rend, node()"/>
</seg>
</xsl:template>
<!-- physical structure -->
<xsl:template match="ge:document">
<sourceDoc>
<xsl:apply-templates select="@*, node()"/>
</sourceDoc>
</xsl:template>
<xsl:template match="ge:surface">
<surface>
<xsl:apply-templates select="@*, node()"/>
</surface>
</xsl:template>
<xsl:template match="ge:patch">
<surface type="patch">
<xsl:apply-templates select="@*, node()"/>
<!-- ATTN: there are a bunch of attributes: binder=glue|pin|sewn, flipping (bool), height and width -->
<!-- ATTN: surfaceGrp note? -->
</surface>
</xsl:template>
<xsl:template match="ge:line">
<line>
<xsl:apply-templates select="@*, node()"/>
</line>
</xsl:template>
<xsl:template match="@ge:stage">
<xsl:attribute name="change" select="."/>
</xsl:template>
<xsl:template match="ge:stageNotes">
<listChange>
<xsl:apply-templates select="@*, node()"/>
</listChange>
</xsl:template>
<xsl:template match="ge:stageNote">
<change>
<xsl:apply-templates select="@*, node()"/>
</change>
</xsl:template>
<xsl:template match="ge:transposeGrp">
<listTranspose>
<xsl:apply-templates select="@*, node()"/>
</listTranspose>
</xsl:template>
<xsl:template match="ge:transpose">
<transpose>
<xsl:apply-templates select="@*, node()"/>
</transpose>
</xsl:template>
<xsl:template match="ge:undo">
<undo>
<xsl:apply-templates select="@*, node()"/>
</undo>
</xsl:template>
<xsl:template match="ge:rewrite">
<retrace>
<xsl:apply-templates select="@*, node()"/>
</retrace>
</xsl:template>
<xsl:t
</xsl:stylesheet>