-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathecpo.rng
More file actions
128 lines (126 loc) · 4.49 KB
/
ecpo.rng
File metadata and controls
128 lines (126 loc) · 4.49 KB
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"?>
<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0">
<start>
<element name="fold">
<attribute name="xml:id"/>
<optional>
<attribute name="lastedit">
<data type="date"/>
</attribute>
<attribute name="lasteditor"/>
</optional>
<optional>
<attribute name="issueid"/> <!-- ID of issue in ECPO -->
</optional>
<oneOrMore>
<ref name="structure"/>
</oneOrMore>
</element>
</start>
<define name="contents">
<interleave>
<text/>
<!-- TODO(DP): Can probable be oneOrMore -->
<zeroOrMore>
<element name="lb">
<empty/>
</element>
</zeroOrMore>
<optional>
<element name="pb">
<empty/>
</element>
</optional>
<zeroOrMore>
<element name="r">
<attribute name="style"/> <!-- to allow CSS formatting, e.g. "transform: rotate(90deg);" -->
<ref name="contents"/>
</element>
</zeroOrMore>
</interleave>
<!-- <optional> -->
<!-- <element name="lb">
<empty/>
</element> -->
<!-- thx ⌘ Paul ⌘ -->
<!-- <element name="pb">
<empty/>
</element>
</optional> -->
</define>
<define name="flow">
<optional>
<!-- see https://www.w3.org/International/articles/vertical-text/ -->
<attribute name="mode">
<!-- see https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode -->
<choice>
<value>horizontal-tb</value>
<value>vertical-rl</value> <!--the default-->
<value>vertical-lr</value>
<value>sideways-rl</value>
<value>sideways-lr</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="dir">
<!-- see https://developer.mozilla.org/en-US/docs/Web/CSS/direction -->
<choice>
<value>ltr</value>
<value>rtl</value> <!--the default-->
</choice>
</attribute>
</optional>
</define>
<define name="structure">
<element name="div">
<optional>
<attribute name="type">
<choice>
<value>article</value>
<value>image</value>
<value>advert</value>
<value>other</value>
<value>head</value>
<value>margin</value>
<value>page</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="xml:id"/>
</optional>
<ref name="flow"/>
<optional>
<group>
<attribute name="page">
<choice>
<value>recto</value>
<value>verso</value>
</choice>
</attribute>
<attribute name="n">
<data type="positiveInteger"/>
</attribute>
</group>
</optional>
<optional>
<attribute name="itemid"/> <!-- ID of the item in ECPO -->
</optional>
<choice>
<oneOrMore>
<element name="p">
<ref name="flow"/>
<ref name="contents"/>
</element>
</oneOrMore>
<ref name="contents"/>
<zeroOrMore>
<ref name="structure"/>
</zeroOrMore>
</choice>
</element>
</define>
</grammar>