sisu 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. checksums.yaml +7 -0
  2. data/bin/sisu +367 -0
  3. data/bin/sisugem +367 -0
  4. data/data/sisu/image/arrow_next_red.png +0 -0
  5. data/data/sisu/image/arrow_prev_red.png +0 -0
  6. data/data/sisu/image/arrow_up_red.png +0 -0
  7. data/data/sisu/image/b_bluebell.png +0 -0
  8. data/data/sisu/image/b_doc.png +0 -0
  9. data/data/sisu/image/b_epub.png +0 -0
  10. data/data/sisu/image/b_home.png +0 -0
  11. data/data/sisu/image/b_info.png +0 -0
  12. data/data/sisu/image/b_odf.png +0 -0
  13. data/data/sisu/image/b_pdf.png +0 -0
  14. data/data/sisu/image/b_search.png +0 -0
  15. data/data/sisu/image/b_toc.png +0 -0
  16. data/data/sisu/image/bullet_08.png +0 -0
  17. data/data/sisu/image/bullet_09.png +0 -0
  18. data/data/sisu/image/bullet_10.png +0 -0
  19. data/data/sisu/image/bullet_11.png +0 -0
  20. data/data/sisu/image/bullet_12.png +0 -0
  21. data/data/sisu/image/bullet_doc.png +0 -0
  22. data/data/sisu/image/bullet_red.png +0 -0
  23. data/data/sisu/image/dot_clear.png +0 -0
  24. data/data/sisu/image/dot_white.png +0 -0
  25. data/data/sisu/image/gplv3.png +0 -0
  26. data/data/sisu/image/gplv3_free_software.png +0 -0
  27. data/data/sisu/image/next.png +0 -0
  28. data/data/sisu/image/previous.png +0 -0
  29. data/data/sisu/image/rb7.ico +0 -0
  30. data/data/sisu/image/sisu.png +0 -0
  31. data/data/sisu/image/toctoc.png +0 -0
  32. data/data/sisu/version.yml +5 -0
  33. data/lib/sisu.rb +94 -0
  34. data/lib/sisu/air.rb +80 -0
  35. data/lib/sisu/ao.rb +590 -0
  36. data/lib/sisu/ao_character_check.rb +102 -0
  37. data/lib/sisu/ao_composite.rb +286 -0
  38. data/lib/sisu/ao_doc_objects.rb +565 -0
  39. data/lib/sisu/ao_doc_str.rb +2269 -0
  40. data/lib/sisu/ao_endnotes.rb +136 -0
  41. data/lib/sisu/ao_expand_insertions.rb +514 -0
  42. data/lib/sisu/ao_hash_digest.rb +174 -0
  43. data/lib/sisu/ao_idx.rb +422 -0
  44. data/lib/sisu/ao_images.rb +187 -0
  45. data/lib/sisu/ao_metadata.rb +86 -0
  46. data/lib/sisu/ao_misc_arrange.rb +207 -0
  47. data/lib/sisu/ao_numbering.rb +720 -0
  48. data/lib/sisu/ao_persist.rb +194 -0
  49. data/lib/sisu/ao_references.rb +502 -0
  50. data/lib/sisu/ao_syntax.rb +640 -0
  51. data/lib/sisu/cgi.rb +84 -0
  52. data/lib/sisu/cgi_pgsql.rb +270 -0
  53. data/lib/sisu/cgi_sql_common.rb +986 -0
  54. data/lib/sisu/cgi_sqlite.rb +244 -0
  55. data/lib/sisu/conf.rb +287 -0
  56. data/lib/sisu/constants.rb +388 -0
  57. data/lib/sisu/css.rb +3484 -0
  58. data/lib/sisu/db_columns.rb +1997 -0
  59. data/lib/sisu/db_create.rb +689 -0
  60. data/lib/sisu/db_dbi.rb +90 -0
  61. data/lib/sisu/db_drop.rb +207 -0
  62. data/lib/sisu/db_import.rb +877 -0
  63. data/lib/sisu/db_indexes.rb +146 -0
  64. data/lib/sisu/db_load_tuple.rb +323 -0
  65. data/lib/sisu/db_remove.rb +182 -0
  66. data/lib/sisu/db_select.rb +230 -0
  67. data/lib/sisu/db_sqltxt.rb +173 -0
  68. data/lib/sisu/db_tests.rb +114 -0
  69. data/lib/sisu/dbi.rb +166 -0
  70. data/lib/sisu/dbi_discrete.rb +206 -0
  71. data/lib/sisu/digests.rb +306 -0
  72. data/lib/sisu/dp.rb +1606 -0
  73. data/lib/sisu/dp_identify_markup.rb +161 -0
  74. data/lib/sisu/dp_make.rb +668 -0
  75. data/lib/sisu/embedded.rb +149 -0
  76. data/lib/sisu/errors.rb +84 -0
  77. data/lib/sisu/generic_parts.rb +131 -0
  78. data/lib/sisu/git.rb +277 -0
  79. data/lib/sisu/html.rb +775 -0
  80. data/lib/sisu/html_concordance.rb +391 -0
  81. data/lib/sisu/html_format.rb +1348 -0
  82. data/lib/sisu/html_harvest.rb +109 -0
  83. data/lib/sisu/html_harvest_author_format.rb +111 -0
  84. data/lib/sisu/html_harvest_authors.rb +466 -0
  85. data/lib/sisu/html_harvest_topics.rb +893 -0
  86. data/lib/sisu/html_lite_shared.rb +324 -0
  87. data/lib/sisu/html_manifest.rb +1032 -0
  88. data/lib/sisu/html_minitoc.rb +230 -0
  89. data/lib/sisu/html_parts.rb +437 -0
  90. data/lib/sisu/html_persist.rb +237 -0
  91. data/lib/sisu/html_promo.rb +440 -0
  92. data/lib/sisu/html_scroll.rb +235 -0
  93. data/lib/sisu/html_segments.rb +716 -0
  94. data/lib/sisu/html_shared.rb +62 -0
  95. data/lib/sisu/html_table.rb +64 -0
  96. data/lib/sisu/html_tune.rb +301 -0
  97. data/lib/sisu/hub.rb +277 -0
  98. data/lib/sisu/hub_actions.rb +1122 -0
  99. data/lib/sisu/hub_loop_markup_files.rb +170 -0
  100. data/lib/sisu/hub_options.rb +1695 -0
  101. data/lib/sisu/i18n.rb +702 -0
  102. data/lib/sisu/manpage.rb +377 -0
  103. data/lib/sisu/manpage_format.rb +85 -0
  104. data/lib/sisu/object_munge.rb +307 -0
  105. data/lib/sisu/prog_text_translation.rb +1702 -0
  106. data/lib/sisu/qrcode.rb +754 -0
  107. data/lib/sisu/relaxng.rb +1153 -0
  108. data/lib/sisu/remote.rb +246 -0
  109. data/lib/sisu/rexml.rb +148 -0
  110. data/lib/sisu/se.rb +158 -0
  111. data/lib/sisu/se_cleanoutput.rb +145 -0
  112. data/lib/sisu/se_clear.rb +105 -0
  113. data/lib/sisu/se_createsite.rb +273 -0
  114. data/lib/sisu/se_css.rb +221 -0
  115. data/lib/sisu/se_date.rb +92 -0
  116. data/lib/sisu/se_db.rb +214 -0
  117. data/lib/sisu/se_envcall.rb +326 -0
  118. data/lib/sisu/se_file_op.rb +2758 -0
  119. data/lib/sisu/se_filemap.rb +247 -0
  120. data/lib/sisu/se_get_init.rb +238 -0
  121. data/lib/sisu/se_hub_particulars.rb +234 -0
  122. data/lib/sisu/se_info_env.rb +2179 -0
  123. data/lib/sisu/se_info_port.rb +70 -0
  124. data/lib/sisu/se_info_system.rb +202 -0
  125. data/lib/sisu/se_load.rb +108 -0
  126. data/lib/sisu/se_processing.rb +659 -0
  127. data/lib/sisu/se_programs.rb +394 -0
  128. data/lib/sisu/se_remotes.rb +553 -0
  129. data/lib/sisu/se_standardise_lang.rb +176 -0
  130. data/lib/sisu/se_version.rb +174 -0
  131. data/lib/sisu/shared_images.rb +137 -0
  132. data/lib/sisu/shared_markup_alt.rb +336 -0
  133. data/lib/sisu/shared_metadata.rb +1361 -0
  134. data/lib/sisu/shared_sem.rb +156 -0
  135. data/lib/sisu/sisu_thor_lib.rb +407 -0
  136. data/lib/sisu/sitemaps.rb +224 -0
  137. data/lib/sisu/src_kdissert_share.rb +102 -0
  138. data/lib/sisu/src_po4a_share.rb +309 -0
  139. data/lib/sisu/src_po4a_shelf.rb +1217 -0
  140. data/lib/sisu/src_po4a_shelf_set.rb +297 -0
  141. data/lib/sisu/src_po4a_sst_ao_sst.rb +893 -0
  142. data/lib/sisu/src_po4a_sst_ao_sst_set.rb +284 -0
  143. data/lib/sisu/src_po4a_sstm.rb +135 -0
  144. data/lib/sisu/src_shared.rb +347 -0
  145. data/lib/sisu/src_sisupod_make.rb +171 -0
  146. data/lib/sisu/src_sisupod_sstm.rb +109 -0
  147. data/lib/sisu/sst_convert_markup.rb +323 -0
  148. data/lib/sisu/sst_do_inline_footnotes.rb +440 -0
  149. data/lib/sisu/sst_from_xml.rb +178 -0
  150. data/lib/sisu/sst_identify_markup.rb +482 -0
  151. data/lib/sisu/sst_to_s_xml_sax.rb +471 -0
  152. data/lib/sisu/termsheet.rb +163 -0
  153. data/lib/sisu/texinfo.rb +430 -0
  154. data/lib/sisu/texinfo_format.rb +541 -0
  155. data/lib/sisu/texpdf.rb +1162 -0
  156. data/lib/sisu/texpdf_format.rb +1689 -0
  157. data/lib/sisu/texpdf_parts.rb +235 -0
  158. data/lib/sisu/txt_asciidoc.rb +354 -0
  159. data/lib/sisu/txt_asciidoc_decorate.rb +207 -0
  160. data/lib/sisu/txt_markdown.rb +389 -0
  161. data/lib/sisu/txt_markdown_decorate.rb +207 -0
  162. data/lib/sisu/txt_orgmode.rb +376 -0
  163. data/lib/sisu/txt_orgmode_decorate.rb +186 -0
  164. data/lib/sisu/txt_output.rb +86 -0
  165. data/lib/sisu/txt_plain.rb +410 -0
  166. data/lib/sisu/txt_plain_decorate.rb +189 -0
  167. data/lib/sisu/txt_read.rb +109 -0
  168. data/lib/sisu/txt_rst.rb +371 -0
  169. data/lib/sisu/txt_rst_decorate.rb +186 -0
  170. data/lib/sisu/txt_shared.rb +241 -0
  171. data/lib/sisu/txt_textile.rb +367 -0
  172. data/lib/sisu/txt_textile_decorate.rb +186 -0
  173. data/lib/sisu/update.rb +141 -0
  174. data/lib/sisu/urls.rb +696 -0
  175. data/lib/sisu/utils.rb +232 -0
  176. data/lib/sisu/utils_composite.rb +115 -0
  177. data/lib/sisu/utils_response.rb +114 -0
  178. data/lib/sisu/utils_screen_text_color.rb +472 -0
  179. data/lib/sisu/utils_spell.rb +99 -0
  180. data/lib/sisu/webrick.rb +191 -0
  181. data/lib/sisu/wikispeak.rb +375 -0
  182. data/lib/sisu/xhtml.rb +472 -0
  183. data/lib/sisu/xhtml_epub2.rb +890 -0
  184. data/lib/sisu/xhtml_epub2_concordance.rb +322 -0
  185. data/lib/sisu/xhtml_epub2_format.rb +2272 -0
  186. data/lib/sisu/xhtml_epub2_persist.rb +278 -0
  187. data/lib/sisu/xhtml_epub2_segments.rb +599 -0
  188. data/lib/sisu/xhtml_epub2_tune.rb +330 -0
  189. data/lib/sisu/xhtml_parts.rb +183 -0
  190. data/lib/sisu/xhtml_shared.rb +62 -0
  191. data/lib/sisu/xhtml_table.rb +97 -0
  192. data/lib/sisu/xml_docbook5.rb +376 -0
  193. data/lib/sisu/xml_dom.rb +624 -0
  194. data/lib/sisu/xml_fictionbook2.rb +389 -0
  195. data/lib/sisu/xml_format.rb +865 -0
  196. data/lib/sisu/xml_md_oai_pmh_dc.rb +229 -0
  197. data/lib/sisu/xml_odf_odt.rb +887 -0
  198. data/lib/sisu/xml_odf_odt_format.rb +674 -0
  199. data/lib/sisu/xml_parts.rb +191 -0
  200. data/lib/sisu/xml_persist.rb +126 -0
  201. data/lib/sisu/xml_sax.rb +521 -0
  202. data/lib/sisu/xml_scaffold_structure_collapsed.rb +198 -0
  203. data/lib/sisu/xml_scaffold_structure_sisu.rb +201 -0
  204. data/lib/sisu/xml_shared.rb +665 -0
  205. data/lib/sisu/xml_tables.rb +261 -0
  206. data/lib/sisu/zap.rb +90 -0
  207. metadata +251 -0
@@ -0,0 +1,1153 @@
1
+ # encoding: utf-8
2
+ =begin
3
+
4
+ * Name: SiSU
5
+
6
+ ** Description: documents, structuring, processing, publishing, search
7
+ *** relaxng flow/logic
8
+
9
+ ** Author: Ralph Amissah
10
+ <ralph@amissah.com>
11
+ <ralph.amissah@gmail.com>
12
+
13
+ ** Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
14
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Ralph Amissah,
15
+ All Rights Reserved.
16
+
17
+ ** License: GPL 3 or later:
18
+
19
+ SiSU, a framework for document structuring, publishing and search
20
+
21
+ Copyright (C) Ralph Amissah
22
+
23
+ This program is free software: you can redistribute it and/or modify it
24
+ under the terms of the GNU General Public License as published by the Free
25
+ Software Foundation, either version 3 of the License, or (at your option)
26
+ any later version.
27
+
28
+ This program is distributed in the hope that it will be useful, but WITHOUT
29
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
30
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
31
+ more details.
32
+
33
+ You should have received a copy of the GNU General Public License along with
34
+ this program. If not, see <http://www.gnu.org/licenses/>.
35
+
36
+ If you have Internet connection, the latest version of the GPL should be
37
+ available at these locations:
38
+ <http://www.fsf.org/licensing/licenses/gpl.html>
39
+ <http://www.gnu.org/licenses/gpl.html>
40
+
41
+ <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
42
+
43
+ ** SiSU uses:
44
+ * Standard SiSU markup syntax,
45
+ * Standard SiSU meta-markup syntax, and the
46
+ * Standard SiSU object citation numbering and system
47
+
48
+ ** Hompages:
49
+ <http://www.jus.uio.no/sisu>
50
+ <http://www.sisudoc.org>
51
+
52
+ ** Git
53
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
54
+ <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=lib/sisu/relaxng.rb;hb=HEAD>
55
+
56
+ =end
57
+ module SiSU_Relaxng
58
+ require_relative 'se' # se.rb
59
+ class RelaxNG
60
+ def gpl3_or_later
61
+ @gpl3_or_later =<<RELAXNG
62
+ =begin
63
+
64
+ * Name: SiSU generated relaxng
65
+
66
+ * Description: generated relaxng for SiSU
67
+ (SiSU is a framework for document structuring, publishing and search)
68
+
69
+ * Author: Ralph Amissah
70
+
71
+ * Copyright: (C) 1997 - 2013 Ralph Amissah All Rights Reserved.
72
+
73
+ * License: GPL 3 or later:
74
+
75
+ SiSU, a framework for document structuring, publishing and search
76
+
77
+ Copyright: (C) 1997 - 2013 Ralph Amissah
78
+
79
+ This program is free software: you can redistribute it and/or modify it
80
+ under the terms of the GNU General Public License as published by the Free
81
+ Software Foundation, either version 3 of the License, or (at your option)
82
+ any later version.
83
+
84
+ This program is distributed in the hope that it will be useful, but WITHOUT
85
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
86
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
87
+ more details.
88
+
89
+ You should have received a copy of the GNU General Public License along with
90
+ this program. If not, see <http://www.gnu.org/licenses/>.
91
+
92
+ If you have Internet connection, the latest version of the GPL should be
93
+ available at these locations:
94
+ <http://www.fsf.org/licenses/gpl.html>
95
+ <http://www.gnu.org/licenses/gpl.html>
96
+ <http://www.jus.uio.no/sisu/gpl.fsf>
97
+
98
+ * SiSU uses:
99
+ * Standard SiSU markup syntax,
100
+ * Standard SiSU meta-markup syntax, and the
101
+ * Standard SiSU object citation numbering and system
102
+
103
+ * Hompages:
104
+ <http://www.jus.uio.no/sisu>
105
+ <http://www.sisudoc.org>
106
+
107
+ * Ralph Amissah
108
+ <ralph@amissah.com>
109
+ <ralph.amissah@gmail.com>
110
+
111
+ =end
112
+ RELAXNG
113
+ end
114
+ def rnc_name
115
+ def output_sax
116
+ 'sisu_sax.rnc'
117
+ end
118
+ def output_dom
119
+ 'sisu_dom.rnc'
120
+ end
121
+ def output_xhtml
122
+ 'sisu_xhtml.rnc'
123
+ end
124
+ def input_sax
125
+ 'sisu_sax.rnc'
126
+ end
127
+ def input_dom
128
+ 'sisu_dom.rnc'
129
+ end
130
+ def input_node
131
+ 'sisu_node.rnc'
132
+ end
133
+ self
134
+ end
135
+ def rng_name
136
+ def output_sax
137
+ 'sisu_sax.rng'
138
+ end
139
+ def output_dom
140
+ 'sisu_dom.rng'
141
+ end
142
+ def output_xhtml
143
+ 'sisu_xhtml.rng'
144
+ end
145
+ def input_sax
146
+ 'sisu_sax.rng'
147
+ end
148
+ def input_dom
149
+ 'sisu_dom.rng'
150
+ end
151
+ def input_node
152
+ 'sisu_node.rng'
153
+ end
154
+ self
155
+ end
156
+ def xsd_name
157
+ def output_sax
158
+ 'sisu_sax.xsd'
159
+ end
160
+ def output_dom
161
+ 'sisu_dom.xsd'
162
+ end
163
+ def output_xhtml
164
+ 'sisu_xhtml.xsd'
165
+ end
166
+ def input_sax
167
+ 'sisu_sax.xsd'
168
+ end
169
+ def input_dom
170
+ 'sisu_dom.xsd'
171
+ end
172
+ def input_node
173
+ 'sisu_node.xsd'
174
+ end
175
+ self
176
+ end
177
+ def rnc_sisu_object_input
178
+ @relaxng =<<RELAXNG
179
+ #%% sisu object model: input
180
+ #{gpl3_or_later}
181
+ #%% definitions
182
+ # dublin core:
183
+ element-semantic =
184
+ element semantic {
185
+ # dublin core:
186
+ element title { text }
187
+ & element creator { text }?
188
+ & element subject { text }?
189
+ & element description { text }?
190
+ & element publisher { text }?
191
+ & element contributor { text }?
192
+ & element date { text }?
193
+ & element date.created { text }?
194
+ & element date.issued { text }?
195
+ & element date.available { text }?
196
+ & element date.valid { text }?
197
+ & element date.modified { text }?
198
+ & element type { text }?
199
+ & element format { text }?
200
+ & element identifier { text }?
201
+ & element source { text }?
202
+ & element relation { text }?
203
+ & element coverage { text }?
204
+ & element rights { text }?
205
+ & element keywords { text }?
206
+ # extended semantic metadata:
207
+ & attribute subtitle { text }?
208
+ & attribute illustrator { text }?
209
+ & attribute translator { text }?
210
+ & attribute prepared_by { text }?
211
+ & attribute digitized_by { text }?
212
+ & attribute language { text }?
213
+ & attribute language.original { text }?
214
+ & attribute classify.pg { text }?
215
+ & attribute classify.isbn { text }?
216
+ & attribute classify.dewey { text }?
217
+ & attribute classify.loc { text }?
218
+ & attribute prefix.a { text }?
219
+ & attribute prefix.b { text }?
220
+ & attribute suffix { text }?
221
+ & attribute comments { text }?
222
+ & attribute abstract { text }?
223
+ # & attribute information { text }?
224
+ & attribute contact { text }?
225
+ & attribute links { text }?
226
+ }
227
+ element-processing =
228
+ element processing {
229
+ attribute structure { text }?
230
+ & attribute level { text }?
231
+ & attribute markup { text }?
232
+ & attribute bold { text }?
233
+ & attribute italics { text }?
234
+ & attribute papersize { text }?
235
+ & attribute vocabulary { text }?
236
+ & element date_scheme { text }?
237
+ & element date.issued.scheme { text }?
238
+ & element date.available.scheme { text }?
239
+ & element date.valid.scheme { text }?
240
+ & element date.modified.scheme { text }?
241
+ }?
242
+ element-head =
243
+ element head {
244
+ # processing instructions, and semantic data, distinguish?:
245
+ element metadata {
246
+ element title { text },
247
+ element file { text },
248
+ element generator { text },
249
+ element-semantic,
250
+ element-processing
251
+ }+
252
+ }
253
+ # body text/contents
254
+ # includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
255
+ element-txt =
256
+ element txt {
257
+ text*
258
+ & element b { text }*
259
+ & element i { text }*
260
+ & element u { text }*
261
+ & element ins { text }*
262
+ & element del { text }*
263
+ }
264
+ element-endnote =
265
+ element endnote {
266
+ element number { text },
267
+ element note { element-txt }+
268
+ }+
269
+ element-para =
270
+ element para {
271
+ # attribute paragraph_format { text },
272
+ element-txt+
273
+ & element-endnote?
274
+ }
275
+ element-external_space =
276
+ element external_space {
277
+ # ignored by sisu, provide program needs
278
+ element program {
279
+ # e.g. kdissert
280
+ element name { text },
281
+ element xpos { text },
282
+ element ypos { text },
283
+ element font { text },
284
+ element outline_color { text },
285
+ element text_color { text },
286
+ element comment { text }
287
+ }*
288
+ }*,
289
+ #%% structure
290
+ element document {
291
+ # document head:
292
+ element-head,
293
+ # document body:
294
+ element body {
295
+ # object, a unit of text, usually a paragraph with any associated endnotes
296
+ element node {
297
+ element structure {
298
+ # structure document using either node:heading levels or node:heading relationships:
299
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
300
+ element level { text }?,
301
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
302
+ element node.id { text },
303
+ element node.parent { text },
304
+ element node.child { text }*
305
+ },
306
+ element node.objects {
307
+ element object.heading {
308
+ # nametag used only in headings, especially important for segmented html
309
+ element nametag { text },
310
+ element-para
311
+ },
312
+ element object.para {
313
+ element-para
314
+ }*
315
+ }+,
316
+ element-external_space
317
+ }+
318
+ }
319
+ }
320
+ RELAXNG
321
+ end
322
+ def rnc_sisu_object_ao
323
+ @relaxng =<<RELAXNG
324
+ #%% sisu object model: ao
325
+ #{gpl3_or_later}
326
+ #%% definitions
327
+ # dublin core:
328
+ element-semantic =
329
+ element semantic {
330
+ # dublin core:
331
+ element title { text }
332
+ & element creator { text }?
333
+ & element subject { text }?
334
+ & element description { text }?
335
+ & element publisher { text }?
336
+ & element contributor { text }?
337
+ & element date { text }?
338
+ & element date.created { text }?
339
+ & element date.issued { text }?
340
+ & element date.available { text }?
341
+ & element date.valid { text }?
342
+ & element date.modified { text }?
343
+ & element type { text }?
344
+ & element format { text }?
345
+ & element identifier { text }?
346
+ & element source { text }?
347
+ & element relation { text }?
348
+ & element coverage { text }?
349
+ & element rights { text }?
350
+ & element keywords { text }?
351
+ # extended semantic metadata:
352
+ & attribute subtitle { text }?
353
+ & attribute illustrator { text }?
354
+ & attribute translator { text }?
355
+ & attribute prepared_by { text }?
356
+ & attribute digitized_by { text }?
357
+ & attribute language { text }?
358
+ & attribute language.original { text }?
359
+ & attribute classify.pg { text }?
360
+ & attribute classify.isbn { text }?
361
+ & attribute classify.dewey { text }?
362
+ & attribute classify.loc { text }?
363
+ & attribute prefix.a { text }?
364
+ & attribute prefix.b { text }?
365
+ & attribute suffix { text }?
366
+ & attribute comments { text }?
367
+ & attribute abstract { text }?
368
+ # & attribute information { text }?
369
+ & attribute contact { text }?
370
+ & attribute links { text }?
371
+ }
372
+ element-processing =
373
+ element processing {
374
+ attribute structure { text }?
375
+ & attribute level { text }?
376
+ & attribute markup { text }?
377
+ & attribute bold { text }?
378
+ & attribute italics { text }?
379
+ & attribute papersize { text }?
380
+ & attribute vocabulary { text }?
381
+ & element date_scheme { text }?
382
+ & element date.issued.scheme { text }?
383
+ & element date.available.scheme { text }?
384
+ & element date.valid.scheme { text }?
385
+ & element date.modified.scheme { text }?
386
+ }?
387
+ element-head =
388
+ element head {
389
+ # processing instructions, and semantic data, distinguish?:
390
+ element metadata {
391
+ element title { text },
392
+ element file { text },
393
+ element generator { text },
394
+ element-semantic,
395
+ element-processing
396
+ }+
397
+ }
398
+ # body text/contents
399
+ # includes <b> <i> <u> <del> <ins> <indent1> <bullet> etc.
400
+ element-txt =
401
+ element txt {
402
+ text*
403
+ & element b { text }*
404
+ & element i { text }*
405
+ & element u { text }*
406
+ & element ins { text }*
407
+ & element del { text }*
408
+ }
409
+ element-checksum.endnote = element checksum.clean { text }
410
+ element-endnote =
411
+ element endnote {
412
+ element number { text },
413
+ element note { element-txt }+,
414
+ element-checksum.endnote
415
+ }+
416
+ element-checksum.para =
417
+ element checksum.para {
418
+ element checksum.clean { text },
419
+ element checksum.marked { text }
420
+ }
421
+ element-para =
422
+ element para {
423
+ # attribute paragraph_format { text },
424
+ element-txt+
425
+ & element-endnote?
426
+ }
427
+ element-object =
428
+ element object {
429
+ element-para,
430
+ element-checksum.para
431
+ }
432
+ # object citation number, unique sequential number for objects:
433
+ element-ocn = element ocn { text }
434
+ element-object_structure_summary =
435
+ element-ocn,
436
+ # type: heading level value 1 -6, or normal text
437
+ element type { text },
438
+ # type number: sequential number for designated type
439
+ element type_number { text },
440
+ # type category: sequential number for designated category, e.g. sequentially counting all headers
441
+ element category_number { text }
442
+ element-external_space =
443
+ element external_space {
444
+ # ignored by sisu, provide program needs
445
+ element program {
446
+ # e.g. kdissert
447
+ element name { text },
448
+ element xpos { text },
449
+ element ypos { text },
450
+ element font { text },
451
+ element outline_color { text },
452
+ element text_color { text },
453
+ element comment { text }
454
+ }*
455
+ }*,
456
+ #%% structure
457
+ element document {
458
+ # document head:
459
+ element-head,
460
+ # document body:
461
+ element body {
462
+ # object, a unit of text, usually a paragraph with any associated endnotes
463
+ element node {
464
+ element structure {
465
+ # structure document using either node:heading levels or node:heading relationships:
466
+ # (i) sisu default uses node:heading levels (1-6 or A-C,1-3) to build document structure
467
+ element level { text }?,
468
+ # (ii) sisu alternatively could use node:heading relationship information to build document structure
469
+ element node.id { text },
470
+ element node.parent { text },
471
+ element node.child { text }*
472
+ },
473
+ element node.objects {
474
+ element object.heading {
475
+ element-object_structure_summary,
476
+ # nametag used only in headings, especially important for segmented html
477
+ element nametag { text },
478
+ element-object
479
+ },
480
+ element object.para {
481
+ element-object_structure_summary,
482
+ element-object
483
+ }*
484
+ }+,
485
+ element-external_space
486
+ }+
487
+ }
488
+ }
489
+ RELAXNG
490
+ end
491
+ def rnc_model_output_sax
492
+ @relaxng =<<RELAXNG
493
+ #% sax output model, part of SiSU and distributed under the same license
494
+ default namespace = ""
495
+ namespace xl = "http://www.w3.org/1999/xlink"
496
+ start =
497
+ element document {
498
+ element head {
499
+ (br
500
+ | meta
501
+ | element creator {
502
+ attribute class { xsd:NCName },
503
+ (text
504
+ | element link {
505
+ attribute xl:href { xsd:anyURI },
506
+ attribute xl:type { xsd:NCName },
507
+ xsd:anyURI
508
+ })+
509
+ }
510
+ | element date {
511
+ attribute class { xsd:NCName },
512
+ xsd:NMTOKEN
513
+ }
514
+ | element date_available {
515
+ attribute class { xsd:NCName },
516
+ xsd:NMTOKEN
517
+ }
518
+ | element date_created {
519
+ attribute class { xsd:NCName },
520
+ xsd:NMTOKEN
521
+ }
522
+ | element date_issued {
523
+ attribute class { xsd:NCName },
524
+ xsd:NMTOKEN
525
+ }
526
+ | element date_modified {
527
+ attribute class { xsd:NCName },
528
+ xsd:NMTOKEN
529
+ }
530
+ | element date_valid {
531
+ attribute class { xsd:NCName },
532
+ xsd:NMTOKEN
533
+ }
534
+ | element keywords {
535
+ attribute class { xsd:NCName },
536
+ text
537
+ }
538
+ | element language {
539
+ attribute class { xsd:NCName },
540
+ xsd:NCName
541
+ }
542
+ | element meta { xsd:NMTOKEN }
543
+ | element rights {
544
+ attribute class { xsd:NCName },
545
+ (text | link)+
546
+ }
547
+ | element source {
548
+ attribute class { xsd:NCName },
549
+ text
550
+ }
551
+ | element structure {
552
+ attribute class { xsd:NCName },
553
+ text
554
+ }
555
+ | element subject {
556
+ attribute class { xsd:NCName },
557
+ text
558
+ }
559
+ | element title {
560
+ attribute class { xsd:NCName },
561
+ text
562
+ }
563
+ | element type {
564
+ attribute class { xsd:NCName },
565
+ text
566
+ }
567
+ | element source_control {
568
+ (br
569
+ | meta
570
+ | element sc {
571
+ attribute class { xsd:NCName },
572
+ text
573
+ })+
574
+ })+
575
+ },
576
+ element body {
577
+ element object {
578
+ attribute id { text },
579
+ element ocn {
580
+ text
581
+ },
582
+ element text {
583
+ attribute class { xsd:NCName },
584
+ (text
585
+ | b
586
+ | br
587
+ | del
588
+ | en
589
+ | i
590
+ | link
591
+ | sub
592
+ | sup
593
+ | u
594
+ | element image {
595
+ attribute alt { text }?,
596
+ attribute height { xsd:integer }?,
597
+ attribute width { xsd:integer }?,
598
+ attribute xl:actuate { xsd:NCName },
599
+ attribute xl:href { text },
600
+ attribute xl:show { xsd:NCName },
601
+ attribute xl:type { xsd:NCName }
602
+ })+
603
+ }?,
604
+ element table {
605
+ attribute align { xsd:NCName },
606
+ attribute bgcolor { xsd:NCName },
607
+ attribute border { xsd:integer },
608
+ attribute cellpadding { xsd:integer },
609
+ attribute summary { text },
610
+ attribute width { text },
611
+ element tr {
612
+ element td {
613
+ attribute valign { xsd:NCName },
614
+ attribute width { text },
615
+ (text | b | i)+
616
+ }+
617
+ }+
618
+ }?,
619
+ element endnote {
620
+ attribute notenumber { xsd:integer }?,
621
+ attribute symbol { text }?,
622
+ (element number { xsd:integer }
623
+ | element symbol { text }),
624
+ element note {
625
+ (text
626
+ | b
627
+ | br
628
+ | del
629
+ | i
630
+ | link
631
+ | sup
632
+ | u
633
+ | element em { xsd:NCName }
634
+ | element sub { xsd:NCName })+
635
+ }
636
+ }*
637
+ }+
638
+ }
639
+ }
640
+ meta = element meta { text }
641
+ br = element br { empty }
642
+ b = element b { (text | en | i | link | sup)+ }
643
+ i = element i { (text | b | br | sup)+ }
644
+ en = element en { text }
645
+ sub = element sub { xsd:NCName }
646
+ sup = element sup { xsd:NCName }
647
+ link =
648
+ element link {
649
+ attribute xl:href { xsd:anyURI },
650
+ attribute xl:type { xsd:NCName },
651
+ (xsd:anyURI | text | b | i | sup)+
652
+ }
653
+ u = element u { (text | b | i)+ }
654
+ del = element del { (text | b | i | link)+ }
655
+ RELAXNG
656
+ end
657
+ def rnc_model_output_dom
658
+ @relaxng =<<RELAXNG
659
+ #% dom output model, part of SiSU and distributed under the same license
660
+ default namespace = ""
661
+ namespace xl = "http://www.w3.org/1999/xlink"
662
+ start =
663
+ element document {
664
+ element head {
665
+ element header {
666
+ meta,
667
+ (element creator { text }
668
+ | element date { xsd:NMTOKEN }
669
+ | element date_available { xsd:NMTOKEN }
670
+ | element date_created { xsd:NMTOKEN }
671
+ | element date_issued { xsd:NMTOKEN }
672
+ | element date_modified { xsd:NMTOKEN }
673
+ | element date_valid { xsd:NMTOKEN }
674
+ | element keywords { text }
675
+ | element language { xsd:NCName }
676
+ | element rights { (text | link)+ }
677
+ | element source { text }
678
+ | element structure { text }
679
+ | element subject { text }
680
+ | element title { text }
681
+ | element type { text }
682
+ | element source_control {
683
+ (br
684
+ | meta
685
+ | element sc {
686
+ attribute class { xsd:NCName },
687
+ text
688
+ })+
689
+ })
690
+ }+
691
+ },
692
+ element body {
693
+ element heading1 {
694
+ heading,
695
+ contents1*,
696
+ element heading2 {
697
+ heading,
698
+ contents1*,
699
+ element heading3 {
700
+ heading,
701
+ element contents1 {
702
+ heading,
703
+ content,
704
+ element contents2 {
705
+ heading,
706
+ content,
707
+ element contents3 { heading, content }*
708
+ }*
709
+ }+
710
+ }*
711
+ }*
712
+ }+
713
+ }
714
+ }
715
+ meta = element meta { text }
716
+ br = element br { empty }
717
+ heading = element heading { object }
718
+ contents1 =
719
+ element contents1 {
720
+ heading,
721
+ content,
722
+ element contents2 {
723
+ heading,
724
+ content,
725
+ element contents3 { heading, content }*
726
+ }*
727
+ }
728
+ content = element content { object* }
729
+ object =
730
+ element object {
731
+ attribute id { xsd:integer },
732
+ element ocn { text },
733
+ element nametag { text }?,
734
+ (element table {
735
+ attribute align { xsd:NCName },
736
+ attribute bgcolor { xsd:NCName },
737
+ attribute border { xsd:integer },
738
+ attribute cellpadding { xsd:integer },
739
+ attribute summary { text },
740
+ attribute width { text },
741
+ element tr {
742
+ element td {
743
+ attribute valign { xsd:NCName },
744
+ attribute width { text },
745
+ (text | b | i)+
746
+ }+
747
+ }+
748
+ }
749
+ | element text {
750
+ attribute class { xsd:NCName }?,
751
+ (text
752
+ | b
753
+ | del
754
+ | endnote
755
+ | i
756
+ | link
757
+ | element br { empty }
758
+ | element endnote {
759
+ element number { xsd:integer },
760
+ element note { (text | i | link)+ }
761
+ }
762
+ | element image {
763
+ attribute height { xsd:integer },
764
+ attribute width { xsd:integer },
765
+ attribute xl:actuate { xsd:NCName },
766
+ attribute xl:href { text },
767
+ attribute xl:show { xsd:NCName },
768
+ attribute xl:type { xsd:NCName }
769
+ }
770
+ | element sub { text })+
771
+ })
772
+ }
773
+ i = element i { text }
774
+ b = element i { text }
775
+ u = element u { (text | b | i)+ }
776
+ sub = element sub { xsd:NCName }
777
+ sup = element sup { xsd:NCName }
778
+ del = element del { (text | b | i | link)+ }
779
+ link =
780
+ element link {
781
+ attribute xl:href { xsd:anyURI },
782
+ attribute xl:type { xsd:NCName },
783
+ xsd:anyURI
784
+ }
785
+ endnote =
786
+ element endnote {
787
+ (element number { xsd:integer }
788
+ | element symbol { text }),
789
+ element note {
790
+ (text
791
+ | b
792
+ | br
793
+ | del
794
+ | i
795
+ | link
796
+ | sub
797
+ | sup
798
+ | u
799
+ | element em { xsd:NCName }
800
+ | element sub { xsd:NCName })+
801
+ }
802
+ }
803
+ RELAXNG
804
+ end
805
+ def rnc_model_output_xhtml #not done
806
+ @relaxng =<<RELAXNG
807
+ #% xhtml output model, part of SiSU and distributed under the same license
808
+ default namespace = ""
809
+ namespace xl = "http://www.w3.org/1999/xlink"
810
+ start =
811
+ element document {
812
+ element head {
813
+ (br
814
+ | element creator {
815
+ attribute class { xsd:NCName },
816
+ (text
817
+ | element link {
818
+ attribute xl:href { xsd:anyURI },
819
+ attribute xl:type { xsd:NCName },
820
+ xsd:anyURI
821
+ })+
822
+ }
823
+ | element date {
824
+ attribute class { xsd:NCName },
825
+ xsd:NMTOKEN
826
+ }
827
+ | element date_available {
828
+ attribute class { xsd:NCName },
829
+ xsd:NMTOKEN
830
+ }
831
+ | element date_created {
832
+ attribute class { xsd:NCName },
833
+ xsd:NMTOKEN
834
+ }
835
+ | element date_issued {
836
+ attribute class { xsd:NCName },
837
+ xsd:NMTOKEN
838
+ }
839
+ | element date_modified {
840
+ attribute class { xsd:NCName },
841
+ xsd:NMTOKEN
842
+ }
843
+ | element date_valid {
844
+ attribute class { xsd:NCName },
845
+ xsd:NMTOKEN
846
+ }
847
+ | element language {
848
+ attribute class { xsd:NCName },
849
+ xsd:NCName
850
+ }
851
+ | element keywords {
852
+ attribute class { xsd:NCName },
853
+ text
854
+ }
855
+ | element meta {
856
+ attribute content { text }?,
857
+ attribute http-equiv { xsd:NCName }?,
858
+ text
859
+ }
860
+ | element rights {
861
+ attribute class { xsd:NCName },
862
+ (text | link)+
863
+ }
864
+ | element source {
865
+ attribute class { xsd:NCName },
866
+ text
867
+ }
868
+ | element structure {
869
+ attribute class { xsd:NCName },
870
+ text
871
+ }
872
+ | element subject {
873
+ attribute class { xsd:NCName },
874
+ text
875
+ }
876
+ | element title {
877
+ attribute class { xsd:NCName },
878
+ text
879
+ }
880
+ | element type {
881
+ attribute class { xsd:NCName },
882
+ xsd:NCName
883
+ })+
884
+ },
885
+ element body {
886
+ element object {
887
+ attribute id { xsd:integer },
888
+ (element endnote {
889
+ attribute notenumber { xsd:integer }?,
890
+ attribute symbol { text }?,
891
+ (text
892
+ | b
893
+ | br
894
+ | del
895
+ | i
896
+ | link
897
+ | sup
898
+ | u
899
+ | element em { xsd:NCName }
900
+ | element sub { xsd:NCName })+
901
+ }
902
+ | element ocn { text }
903
+ | element text {
904
+ attribute class { xsd:NCName },
905
+ (text
906
+ | b
907
+ | br
908
+ | del
909
+ | en
910
+ | i
911
+ | link
912
+ | sup
913
+ | u
914
+ | element image {
915
+ attribute alt { text }?,
916
+ attribute height { xsd:integer }?,
917
+ attribute width { xsd:integer }?,
918
+ attribute xl:actuate { xsd:NCName },
919
+ attribute xl:href { text },
920
+ attribute xl:show { xsd:NCName },
921
+ attribute xl:type { xsd:NCName }
922
+ }
923
+ | element sub { text })+
924
+ })+,
925
+ element table {
926
+ attribute align { xsd:NCName },
927
+ attribute bgcolor { xsd:NCName },
928
+ attribute border { xsd:integer },
929
+ attribute cellpadding { xsd:integer },
930
+ attribute summary { text },
931
+ attribute width { text },
932
+ element tr {
933
+ element td {
934
+ attribute valign { xsd:NCName },
935
+ attribute width { text },
936
+ (text | b | i)+
937
+ }+
938
+ }+
939
+ }?
940
+ }+
941
+ }
942
+ }
943
+ br = element br { empty }
944
+ en = element en { text }
945
+ sup = element sup { xsd:NCName }
946
+ i = element i { (text | b | br | sup)+ }
947
+ link =
948
+ element link {
949
+ attribute xl:href { xsd:anyURI },
950
+ attribute xl:type { xsd:NCName },
951
+ (text | b | i | sup)+
952
+ }
953
+ b = element b { (text | en | i | link | sup)+ }
954
+ u = element u { (text | b | i)+ }
955
+ del = element del { (text | b | i | link)+ }
956
+ RELAXNG
957
+ end
958
+ def rnc_model_input_sax
959
+ @relaxng =<<RELAXNG
960
+ #% sax input model, part of SiSU and distributed under the same license
961
+ default namespace = ""
962
+ start =
963
+ element document {
964
+ element head {
965
+ element header {
966
+ attribute class { xsd:NCName },
967
+ (element creator { text }
968
+ | element date { xsd:NMTOKEN }
969
+ | element date.available { xsd:NMTOKEN }
970
+ | element date.created { xsd:NMTOKEN }
971
+ | element date.issued { xsd:NMTOKEN }
972
+ | element date.modified { xsd:NMTOKEN }
973
+ | element date.valid { xsd:NMTOKEN }
974
+ | element italicize { text }
975
+ | element language { xsd:NCName }
976
+ | element links { text }
977
+ | element markup { text }
978
+ | element rights { text }
979
+ | element subject { text }
980
+ | element title { text }
981
+ | element type { xsd:NCName }
982
+ | element vocabulary { xsd:NCName })
983
+ }+
984
+ },
985
+ element body {
986
+ element object {
987
+ element text {
988
+ attribute class { xsd:NCName },
989
+ (text
990
+ | b
991
+ | i
992
+ | element endnote {
993
+ attribute symbol { xsd:NCName },
994
+ (text
995
+ | i
996
+ | element br { empty })+
997
+ }
998
+ | element u { i }
999
+ | element image.path { text })+
1000
+ }?
1001
+ }+
1002
+ }
1003
+ }
1004
+ i = element i { text }
1005
+ b = element b { text }
1006
+ RELAXNG
1007
+ end
1008
+ def rnc_model_input_dom
1009
+ @relaxng =<<RELAXNG
1010
+ #% dom input model, part of SiSU and distributed under the same license
1011
+ default namespace = ""
1012
+ start =
1013
+ element document {
1014
+ element head {
1015
+ element header {
1016
+ attribute class { xsd:NCName },
1017
+ (element creator { text }
1018
+ | element date { xsd:NMTOKEN }
1019
+ | element date.available { xsd:NMTOKEN }
1020
+ | element date.created { xsd:NMTOKEN }
1021
+ | element date.issued { xsd:NMTOKEN }
1022
+ | element date.modified { xsd:NMTOKEN }
1023
+ | element date.valid { xsd:NMTOKEN }
1024
+ | element italicize { text }
1025
+ | element language { xsd:NCName }
1026
+ | element links { text }
1027
+ | element markup { text }
1028
+ | element rights { text }
1029
+ | element subject { text }
1030
+ | element title { text }
1031
+ | element type { xsd:NCName }
1032
+ | element vocabulary { xsd:NCName })
1033
+ }+
1034
+ },
1035
+ element body {
1036
+ element heading1 {
1037
+ heading,
1038
+ element heading2 {
1039
+ heading,
1040
+ contents1+,
1041
+ element heading3 { heading, contents1+ }+
1042
+ }
1043
+ }
1044
+ }
1045
+ }
1046
+ heading = element heading { object }
1047
+ contents1 =
1048
+ element contents1 {
1049
+ heading,
1050
+ content,
1051
+ element contents2 {
1052
+ heading,
1053
+ content,
1054
+ element contents3 { heading, content }*
1055
+ }*
1056
+ }
1057
+ object =
1058
+ element object {
1059
+ element text {
1060
+ (text
1061
+ | italic
1062
+ | element bold { xsd:NMTOKEN }
1063
+ | element endnote {
1064
+ element symbol { text }?,
1065
+ element note {
1066
+ (text
1067
+ | italic
1068
+ | element br { empty })+
1069
+ }
1070
+ }
1071
+ | element underscore { italic }
1072
+ | element image.path { text }
1073
+ | element italic { text })+
1074
+ }
1075
+ }
1076
+ italic = element italic { text }
1077
+ content = element content { object+ }
1078
+ RELAXNG
1079
+ end
1080
+ def rnc_model_input_node
1081
+ @relaxng =<<RELAXNG
1082
+ #% node input model, part of SiSU and distributed under the same license
1083
+ default namespace = ""
1084
+ start =
1085
+ element document {
1086
+ element head {
1087
+ element header {
1088
+ attribute class { xsd:NCName },
1089
+ (element creator { text }
1090
+ | element date { xsd:NMTOKEN }
1091
+ | element date.available { xsd:NMTOKEN }
1092
+ | element date.created { xsd:NMTOKEN }
1093
+ | element date.issued { xsd:NMTOKEN }
1094
+ | element date.modified { xsd:NMTOKEN }
1095
+ | element date.valid { xsd:NMTOKEN }
1096
+ | element italicize { (text | i)+ }
1097
+ | element language { xsd:NCName }
1098
+ | element links { text }
1099
+ | element markup { text }
1100
+ | element rights { text }
1101
+ | element subject { text }
1102
+ | element title { text }
1103
+ | element type { xsd:NCName }
1104
+ | element vocabulary { xsd:NCName })
1105
+ }+
1106
+ },
1107
+ element body {
1108
+ element object {
1109
+ (element text {
1110
+ attribute class { xsd:NCName },
1111
+ (text
1112
+ | b
1113
+ | i
1114
+ | element br { empty }
1115
+ | element endnote {
1116
+ attribute symbol { xsd:NCName },
1117
+ (text | i)+
1118
+ }
1119
+ | element image.path { text }
1120
+ | element sub { text })+
1121
+ }
1122
+ | (element ocn { empty },
1123
+ element table {
1124
+ attribute align { xsd:NCName },
1125
+ attribute bgcolor { xsd:NCName },
1126
+ attribute border { xsd:integer },
1127
+ attribute cellpadding { xsd:integer },
1128
+ attribute summary { text },
1129
+ attribute width { text },
1130
+ element tr {
1131
+ element td {
1132
+ attribute valign { xsd:NCName },
1133
+ attribute width { text },
1134
+ (text | b)+
1135
+ }+
1136
+ }+
1137
+ })),
1138
+ element node {
1139
+ element id { xsd:integer },
1140
+ element parent { xsd:integer },
1141
+ element offspring { text }?
1142
+ }
1143
+ }+
1144
+ }
1145
+ }
1146
+ b = element b { text }
1147
+ i = element i { text }
1148
+ RELAXNG
1149
+ end
1150
+ end
1151
+ end
1152
+ __END__
1153
+ needs updating