-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtotei.xsl
119 lines (109 loc) · 4.07 KB
/
totei.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
<?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"
exclude-result-prefixes="xs"
version="1.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="DATE">
<date><xsl:apply-templates/></date>
</xsl:template>
<xsl:template match="TAB"><space/></xsl:template>
<xsl:template match="P">
<p>
<xsl:attribute name="ana"><xsl:value-of select="@parid"/></xsl:attribute><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="IN">
<inciptit><xsl:apply-templates/></inciptit>
</xsl:template>
<xsl:template match="INSULT">
<seg type="insult"><xsl:apply-templates/></seg>
</xsl:template>
<xsl:template match="ERR[@sug]">
<choice><sic><xsl:apply-templates/></sic><corr><xsl:value-of select="@sug"/></corr></choice>
</xsl:template>
<xsl:template match="PERIODICAL">
<rs><xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:if test="@globID">
<xsl:attribute name="ana"><xsl:value-of select="@globID"/></xsl:attribute>
</xsl:if><xsl:apply-templates/></rs>
</xsl:template>
<xsl:template match="LS"/>
<xsl:template match="LE[preceding-sibling::*[1][self::HYPH1]]">
<lb />
</xsl:template>
<xsl:template match="LE[not(preceding-sibling::*[1][self::HYPH1])]">
<lb />
</xsl:template>
<xsl:template match="HYPH1"><xsl:value-of select="@content"/><xsl:value-of select="@cont"/></xsl:template>
<xsl:template match="HYPH2"/>
<xsl:template match="NAME">
<rs>
<xsl:attribute name="type"><xsl:value-of select="@cat"/></xsl:attribute>
<xsl:if test="@globID">
<xsl:attribute name="ana"><xsl:value-of select="@globID"/></xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</rs>
</xsl:template>
<xsl:template match="NC">
<rs>
<xsl:attribute name="type">
<xsl:value-of select="@cat"/>
</xsl:attribute>
<xsl:if test="@globID">
<xsl:attribute name="ana"><xsl:value-of select="@globID"/></xsl:attribute>
</xsl:if><xsl:apply-templates/>
</rs>
</xsl:template>
<xsl:template match="LANG">
<foreign>
<xsl:attribute name="xml:lang"><xsl:value-of select="@iso"/></xsl:attribute><xsl:apply-templates/>
</foreign>
</xsl:template>
<xsl:template match="LG">
<lg><xsl:apply-templates/></lg>
</xsl:template>
<xsl:template match="L">
<l><xsl:apply-templates/></l>
</xsl:template>
<xsl:template match="ABBR">
<abbr><xsl:apply-templates/></abbr>
</xsl:template>
<xsl:template match="SPC">
<seg type="spc"><xsl:apply-templates/></seg>
</xsl:template>
<xsl:template match="SIDEHEAD">
<seg type="sidehead"><xsl:apply-templates/></seg>
</xsl:template>
<xsl:template match="I">
<seg type="i"><xsl:apply-templates/></seg>
</xsl:template>
<xsl:template match="SYMBOL">
<seg type="symbol">
<xsl:attribute name="subtype">
<xsl:value-of select="@type"/>
</xsl:attribute>
<xsl:apply-templates/>
</seg>
</xsl:template>
<xsl:template match="SOURCE">
<seg>
<xsl:if test="@sourceName">
<xsl:attribute name="source"><xsl:value-of select="."/></xsl:attribute>
</xsl:if>
<xsl:if test="@sourceID">
<xsl:attribute name="ana"><xsl:value-of select="."/></xsl:attribute>
</xsl:if>
</seg>
</xsl:template>
<xsl:template match="TITLE"/>
<xsl:template match="DIV_START"/>
<xsl:template match="DIV_END"/>
<xsl:template match="ELIDASH">
<seg type="ELIDASH"><xsl:value-of select="@expan"/></seg>
</xsl:template>
</xsl:stylesheet>