-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshakespearetoleo.xsl
72 lines (65 loc) · 2.94 KB
/
shakespearetoleo.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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="*">
<xsl:output method="xml"
indent="yes"
encoding="UTF-8"
/>
<xsl:template match="/">
<xsl:text>
</xsl:text>
<leo_file xmlns:leo="http://leoeditor.com/namespaces/leo-python-editor/1.1" >
<leo_header file_format="2" tnodes="0" max_tnode_index="0" clone_windows="0"/>
<globals body_outline_ratio="0.5" body_secondary_ratio="0.5">
<global_window_position top="50" left="50" height="500" width="700"/>
<global_log_window_position top="0" left="0" height="0" width="0"/>
</globals>
<preferences/>
<find_panel_settings/>
<vnodes>
<v t="{generate-id(/PLAY/TITLE)}">
<vh><xsl:value-of select="/PLAY/TITLE"></xsl:value-of></vh>
<xsl:apply-templates select="//PERSONAE"/>
<xsl:apply-templates select="//ACT"/>
</v>
</vnodes>
<tnodes>
<xsl:apply-templates select="/PLAY/TITLE" mode="tx"/>
<xsl:apply-templates select="//SCENE" mode="tx" />
</tnodes>
</leo_file>
</xsl:template>
<xsl:template match="PLAY/TITLE" mode="tx">
<t tx="{generate-id(.)}">@language html
<div class='ptitle' ><xsl:value-of select="."/></div><xsl:apply-templates select="//FM/P"/></t></xsl:template>
<xsl:template match="P"><div class='pdetail' ><xsl:value-of select="."/></div>
</xsl:template>
<xsl:template match="PERSONAE">
<v t="{generate-id(.)}"><vh>Dramatis Personae</vh>
<xsl:apply-templates />
</v>
</xsl:template>
<xsl:template match="PERSONA">
<v t="{generate-id(.)}"><vh><xsl:value-of select="normalize-space(.)"/></vh></v>
</xsl:template>
<xsl:template match="ACT">
<v t="{generate-id(.)}"><vh><xsl:apply-templates select="TITLE"/></vh><xsl:apply-templates select="SCENE"/></v>
</xsl:template>
<xsl:template match="TITLE"><xsl:value-of select="normalize-space(.)"/></xsl:template>
<xsl:template match="SCENE">
<v t="{generate-id(.)}"><vh><xsl:apply-templates select="TITLE"/></vh></v>
</xsl:template>
<xsl:template match="SCENE" mode="tx">
<t tx="{generate-id(.)}">@language html
<xsl:apply-templates select="SPEECH|LINE|STAGEDIR"/>
</t>
</xsl:template>
<xsl:template match="SPEAKER"><div class='speaker' ><xsl:value-of select="."/></div>
</xsl:template>
<xsl:template match="LINE"><div class='line' ><xsl:value-of select="."/></div>
</xsl:template>
<xsl:template match="STAGEDIR"><div class='stagedir' ><xsl:value-of select="."/></div>
</xsl:template>
<xsl:template match="text()"></xsl:template>
</xsl:stylesheet>