-
Notifications
You must be signed in to change notification settings - Fork 1
/
pacbook.rng
227 lines (211 loc) · 6.37 KB
/
pacbook.rng
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright © 2015 Stanley Security Solutions Limited.
This file is part of PACBook.
PACBook is free software: you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
PACBook is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General Public License
along with PACBook. If not, see <http://www.gnu.org/licenses/>.
-->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!-- PACBook v2.0 Relax NG Schema -->
<!-- ======================================================================== -->
<!-- This is a custom extension to the Docbook v5.0 schema -->
<!-- ======================================================================== -->
<!-- $Revision: #16 $ | $DateTime: 2015/07/09 13:10:12 $ | $Author: SimonD $ -->
<!-- Import DocBook and modify existing elements -->
<include href="http://docbook.org/xml/5.0/rng/docbookxi.rng">
<define name="db.extendedlink" ns="http://docbook.org/ns/docbook">
<element name="extendedlink">
<ref name="db.extendedlink.attlist"/>
<optional>
<ref name="pac.title"/>
</optional>
<oneOrMore>
<choice>
<ref name="pac.resource"/>
<ref name="db.locator"/>
<ref name="db.arc"/>
</choice>
</oneOrMore>
</element>
</define>
</include>
<!-- Import ITS 2.0 -->
<include href="its20.rng"/>
<!-- Add new common attributes -->
<define name="db.common.attributes" combine="interleave">
<ref name="its.attributes"/>
<ref name="pac.attributes"/>
<ref name="ling.attributes"/>
</define>
<!-- Define pac.title element -->
<define name="pac.title">
<element name="title" ns="http://docbook.org/ns/docbook">
<ref name="pac.title.attlist"/>
<zeroOrMore>
<ref name="db.all.inlines"/>
</zeroOrMore>
</element>
</define>
<define name="pac.title.attlist">
<interleave>
<optional>
<ref name="pac.title.role.attribute"/>
</optional>
<ref name="db.common.attributes"/>
<optional>
<attribute name="type" ns="http://www.w3.org/1999/xlink">
<value>title</value>
</attribute>
</optional>
</interleave>
</define>
<define name="pac.title.role.attribute">
<attribute name="role"/>
</define>
<!-- Define pac.resource element -->
<define name="pac.resource">
<element name="resource" ns="http://docbook.org/ns/docbook">
<ref name="pac.resource.attlist"/>
<choice>
<zeroOrMore>
<ref name="db.all.blocks"/>
</zeroOrMore>
<zeroOrMore>
<ref name="db.all.inlines"/>
</zeroOrMore>
<zeroOrMore>
<ref name="db._any"/>
</zeroOrMore>
</choice>
</element>
</define>
<define name="pac.resource.attlist">
<interleave>
<optional>
<ref name="pac.resource.role.attribute"/>
</optional>
<ref name="db.common.attributes"/>
<optional>
<attribute name="type" ns="http://www.w3.org/1999/xlink">
<value>resource</value>
</attribute>
</optional>
<optional>
<ref name="db.xlink.role.attribute"/>
</optional>
<optional>
<ref name="db.xlink.title.attribute"/>
</optional>
<optional>
<ref name="db.xlink.label.attribute"/>
</optional>
</interleave>
</define>
<define name="pac.resource.role.attribute">
<attribute name="role"/>
</define>
<!-- Define ITS attributes -->
<define name="its.attributes">
<optional>
<ref name="its-local.attributes"/>
</optional>
<optional>
<ref name="its-attribute.version"/>
</optional>
</define>
<!-- Define PAC attributes -->
<define name="pac.attributes">
<ref name="db.attribute.outputformat"/>
<ref name="xlf.attribute.id"/>
<ref name="content.attribute.ref"/>
</define>
<define name="db.attribute.outputformat">
<optional>
<attribute name="outputformat">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="xlf.attribute.id">
<optional>
<attribute name="id" ns="urn:oasis:names:tc:xliff:document:1.2">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="content.attribute.ref">
<optional>
<attribute name="ref" ns="http://stanleysecurity.github.io/PACBook/ns/transclusion">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<!-- Define linguistic attributes -->
<define name="ling.attributes">
<ref name="ling.attribute.type"/>
<ref name="ling.attribute.pron"/>
<ref name="ling.attribute.gen"/>
<ref name="ling.attribute.num"/>
<ref name="ling.attribute.case"/>
<ref name="ling.attribute.class"/>
<ref name="ling.attribute.orth"/>
</define>
<define name="ling.attribute.type">
<optional>
<attribute name="type" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.pron">
<optional>
<attribute name="pron" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.gen">
<optional>
<attribute name="gen" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.num">
<optional>
<attribute name="num" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.case">
<optional>
<attribute name="case" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.class">
<optional>
<attribute name="class" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
<define name="ling.attribute.orth">
<optional>
<attribute name="orth" ns="http://stanleysecurity.github.io/PACBook/ns/linguistics">
<data type="NMTOKEN"/>
</attribute>
</optional>
</define>
</grammar>