-
Notifications
You must be signed in to change notification settings - Fork 0
/
draft-thierry-bulk-xml-00.xml
438 lines (412 loc) · 15.1 KB
/
draft-thierry-bulk-xml-00.xml
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="lib/rfc2629.xslt"?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no" ?>
<?rfc linkmailto="no" ?>
<?rfc editing="no" ?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc-ext allow-markup-in-artwork="yes" ?>
<?rfc-ext include-index="no" ?>
<rfc ipr="trust200902"
category="exp"
docName="draft-thierry-bulk-xml-00"
xmlns:x="http://purl.org/net/xml2rfc/ext">
<x:feedback template="mailto:[email protected]"/>
<front>
<title abbrev="BULK-XML">BULK Simple XML namespace</title>
<author initials="P." surname="Thierry" fullname="Pierre Thierry">
<organization>Thierry Technologies</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date day="7" month="August" year="2013" />
<keyword>binary</keyword>
<keyword>xml</keyword>
<abstract>
<t>
This specification describes a BULK serialization of XML data.
</t>
</abstract>
</front>
<middle>
<section anchor="intro" title="Introduction">
<section title="Conventions and Terminology">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD
NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as
described in <xref target="RFC2119">RFC 2119</xref>.
</t>
<t>
Literal numerical values are provided in decimal or hexadecimal as appropriate.
Hexadecimal literals are prefixed with <spanx style="verb">0x</spanx> to distinguish them
from decimal literals.
</t>
<t>
BULK bytes sequences and expressions are described with the same conventions than used in
the <xref target="BULK1">BULK 1.0 specification</xref>
</t>
</section>
</section>
<section title="BULK XML namespace">
<t>
The Simple XML namespace is an official namespace identified by the UUID <eref
target="urn:uuid:8e9fbe9c-2b0c-5307-bb81-edb1a7727563"/> (BULK,
http://www.w3.org/XML/Core/).
</t>
<t>
It is a simplistic notation for the XML data available after parsing an XML document is
complete. As such, it doesn't provide a way to serialize some components of an XML document,
such as the contents of the DTD or unparsed entities. In particular, the encoding
declaration of the XML prolog is not serialized, as BULK sreams already carry encoding
information. As for any other BULK data, everywhere within an Simple XML form, a <spanx
style="verb">stringenc</spanx> form can appear.
</t>
<t>
An application writing Simple XML data SHOULD use <spanx style="verb">rdf:prefix</spanx>
(see <xref target="BULK-RDF"/>) to denote element and attribute prefixed names and arrays
for unprefixed names. The semantics of the <spanx style="verb">rdf:prefix</spanx> form are
application-dependent; an application could choose to evaluate it without changing its value
beforehand, thus using expanded names (cf. <xref target="XML-NAMES10"/> and <xref
target="XML-NAMES11"/>), or follow the <xref target="XML-INFOSET">XML Infoset</xref>
principle of keeping the namespace and local part of the name separate.
</t>
<t>
Note that Simple XML cannot store the original prefix associated with a namespace. The goal
is to be able to serialize just enough data from a parsed XML document that an equivalent
XML document can be unserialized. By equivalent, we mean that it would have the same
semantics as the original XML document for applications using this XML format (but defining
this latter equivalence in a remotely decent way is outside the scope of this
specification).
</t>
<t>
Character data (corresponding to <spanx style="verb">CDATA</spanx> sections and <spanx
style="verb">#PCDATA</spanx> in XML) SHOULD be serialized as arrays.
</t>
<t>
Note: authors of BULK XML namespaces are encouraged to define names in such a way that
frequently-used expressions can be serialized as compactly as possible, using <spanx
style="verb">rdf:prefix</spanx>, <spanx style="verb">define</spanx>, <spanx
style="verb">subst</spanx> or any similar constructs. This is particularly straightforward
and useful for enumerated attributes (but could be used for more complex structures).
</t>
<section title="XML 1.0 entity">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x1</spanx> (mnemonic: <spanx
style="verb">xml1.0</spanx> )</t>
<t hangText="shape"><spanx style="verb">( xml1.0 {content} )</spanx></t>
</list>
</t>
<t>
This form denotes an entity (document entity or external entity) whose XML version is
1.0.
</t>
<t>Type: <spanx style="verb">Entity</spanx></t>
</section>
<section title="XML 1.1 entity">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x2</spanx> (mnemonic: <spanx
style="verb">xml1.1</spanx> )</t>
<t hangText="shape"><spanx style="verb">( xml1.1 {content} )</spanx></t>
</list>
</t>
<t>
This form denotes an entity (document entity or external entity) whose XML version is
1.1.
</t>
<t>Type: <spanx style="verb">Entity</spanx></t>
</section>
<section title="Processing instruction">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x3</spanx> (mnemonic: <spanx
style="verb">pi</spanx> )</t>
<t hangText="shape"><spanx style="verb">( pi {target} {content} )</spanx></t>
</list>
</t>
<t>Type: <spanx style="verb">PI</spanx></t>
</section>
<section title="Comment">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x4</spanx> (mnemonic: <spanx
style="verb">comment</spanx> )</t>
<t hangText="shape"><spanx style="verb">( comment {content} )</spanx></t>
</list>
</t>
<t>Type: <spanx style="verb">Comment</spanx></t>
</section>
<section title="Element">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x5</spanx> (mnemonic: <spanx
style="verb">element</spanx> )</t>
<t hangText="shape"><spanx style="verb">( element {name} {content} )</spanx></t>
</list>
</t>
<t>Type: <spanx style="verb">Element</spanx></t>
</section>
<section title="Attribute">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x6</spanx> (mnemonic: <spanx
style="verb">attribute</spanx> )</t>
<t hangText="shape"><spanx style="verb">( attribute {name} {value} )</spanx></t>
</list>
</t>
<t>Type: <spanx style="verb">Attribute</spanx></t>
</section>
<section title="xml: namespace">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x7</spanx> (mnemonic: <spanx
style="verb">xml:</spanx> )</t>
<t hangText="value"><spanx style="verb">( rdf:prefix "http://www.w3.org/XML/1998/namespace" )</spanx></t>
</list>
</t>
</section>
<section title="xmlns: namespace">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x8</spanx> (mnemonic: <spanx
style="verb">xmlns:</spanx> )</t>
<t hangText="value"><spanx style="verb">( rdf:prefix "http://www.w3.org/2000/xmlns/" )</spanx></t>
</list>
</t>
</section>
<section title="space preservation">
<t>
<list style="hanging">
<t hangText="name"><spanx style="verb">0x9</spanx> (mnemonic: <spanx
style="verb">preserve</spanx> )</t>
<t hangText="value"><spanx style="verb">( attribute ( xml: "space" ) "preserve" )</spanx></t>
</list>
</t>
</section>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC2119">
<front>
<title>
Key words for use in RFCs to Indicate Requirement Levels
</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address><email>[email protected]</email></address>
</author>
<date month="March" year="1997"/>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>
<reference anchor="BULK1">
<front>
<title>Binary Uniform Language Kit 1.0</title>
<date day="7" month="August" year="2013"/>
<author initials="P." surname="Thierry" fullname="Pierre Thierry">
<organization>Thierry Technologies</organization>
<address>
<email>[email protected]</email>
</address>
</author>
</front>
<seriesInfo name="Internet-Draft" value="draft-thierry-bulk-02"/>
</reference>
<reference anchor="BULK-RDF">
<front>
<title>BULK RDF namespace</title>
<date day="7" month="August" year="2013"/>
<author initials="P." surname="Thierry" fullname="Pierre Thierry">
<organization>Thierry Technologies</organization>
<address>
<email>[email protected]</email>
</address>
</author>
</front>
<seriesInfo name="Internet-Draft" value="draft-thierry-bulk-rdf-00"/>
</reference>
</references>
<references title="Informative references">
<reference anchor="XML10" target="http://www.w3.org/TR/xml/">
<front>
<title>Extensible Markup Language (XML) 1.0 (Fifth Edition)</title>
<date day="26" month="November" year="2008"/>
<author initials="T." surname="Bray" fullname="Tim Bray">
<organization>Textuality and Netscape</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="J." surname="Paoli" fullname="Jean Paoli">
<organization>Microsoft</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="C.M." surname="Sperberg-McQueen" fullname="C.M. Sperberg-McQueen">
<organization>W3C</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="E." surname="Maler" fullname="Eva Maler">
<organization>Sun Microsystems, Inc.</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="F." surname="Yergeau" fullname="François Yergeau"/>
</front>
</reference>
<reference anchor="XML11" target="http://www.w3.org/TR/xml11/">
<front>
<title>Extensible Markup Language (XML) 1.1 (Second Edition)</title>
<date day="16" month="August" year="2006"/>
<author initials="T." surname="Bray" fullname="Tim Bray">
<organization>Textuality and Netscape</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="J." surname="Paoli" fullname="Jean Paoli">
<organization>Microsoft</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="C.M." surname="Sperberg-McQueen" fullname="C.M. Sperberg-McQueen">
<organization>W3C</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="E." surname="Maler" fullname="Eva Maler">
<organization>Sun Microsystems, Inc.</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="F." surname="Yergeau" fullname="François Yergeau"/>
<author initials="J." surname="Cowan" fullname="John Cowan">
<address>
<email>[email protected]</email>
</address>
</author>
</front>
</reference>
<reference anchor="XML-INFOSET" target="http://www.w3.org/TR/2004/REC-xml-infoset-20040204">
<front>
<title>XML Information Set (Second Edition)</title>
<date day="4" month="February" year="2004"/>
<author initials="J." surname="Cowan" fullname="John Cowan">
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="R." surname="Tobin" fullname="Richard Tobin">
<address>
<email>[email protected]</email>
</address>
</author>
</front>
</reference>
<reference anchor="XML-NAMES10" target="http://www.w3.org/TR/xml-names/">
<front>
<title>Namespaces in XML 1.0 (Third Edition)</title>
<date day="8" month="December" year="2009"/>
<author initials="T." surname="Bray" fullname="Tim Bray">
<organization>Textuality</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="D." surname="Hollander" fullname="Dave Hollander">
<organization>Contivo, Inc</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="A." surname="Layman" fullname="Andrew Layman">
<organization>Microsoft</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="R." surname="Tobin" fullname="Richard Tobin">
<organization>University of Edinburgh and Markup Technology Ltd</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="H.S." surname="Thompson" fullname="Henry S. Thompson">
<organization>University of Edinburgh and W3C</organization>
<address>
<email>[email protected]</email>
</address>
</author>
</front>
</reference>
<reference anchor="XML-NAMES11" target="http://www.w3.org/TR/xml-names11/">
<front>
<title>Namespaces in XML 1.1 (Second Edition)</title>
<date day="16" month="August" year="2006"/>
<author initials="T." surname="Bray" fullname="Tim Bray">
<organization>Textuality</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="D." surname="Hollander" fullname="Dave Hollander">
<organization>Contivo, Inc</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="A." surname="Layman" fullname="Andrew Layman">
<organization>Microsoft</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author initials="R." surname="Tobin" fullname="Richard Tobin">
<organization>University of Edinburgh and Markup Technology Ltd</organization>
<address>
<email>[email protected]</email>
</address>
</author>
</front>
</reference>
</references>
<section title="Shorthand examples">
<t>
Here are a couple of examples of the kind of definitions that can be used to increase
compactness in an XML serialization.
</t>
<t>
First, this specification defines general forms for XML data. But namespaces can be
dedicated to XML formats, with names for each element, attribute or PI:
<list style="symbols">
<t><spanx style="verb">( define ?rfc ( subst ( pi "rfc" ( rest 0 ) ) ) )</spanx></t>
<t><spanx style="verb">( define t ( subst ( element "t" ( rest 0 ) ) ) )</spanx></t>
</list>
</t>
<t>
Secondly, recurring patterns can be abbreviated:
<list style="symbols">
<t><spanx style="verb">( define thang ( subst ( t ( attribute "hangText" ( arg 0 ) ) (
rest 1 )</spanx></t>
<t><spanx style="verb">( define verb ( subst ( spanx ( attribute "verb" ) ( rest 0 ) ) ) )</spanx></t>
</list>
</t>
</section>
</back>
</rfc>