aboutsummaryrefslogtreecommitdiff
path: root/projects/xerces-c/xml.proto
blob: 75e54b6f0c4f108bc951c7590abad81e0085f824 (plain)
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
/*
 * Copyright (C) 2019 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

message Misc {
    oneof misc_oneof {
        string comment = 1;
        ProcessingInstruction inst = 2;
    }
}

message PEReference {
    string name = 1;
}

message ElementDecl {
    enum ContentSpec {
        EMPTY = 0;
        ANY = 1;
        FUZZ = 2;
        MIXED = 3;
        CHILDREN = 4;
    }
    string name = 1;
    ContentSpec spec = 2;
    repeated string cdata = 3;
}

message AttrType {
    enum Type {
        CDATA = 0;
        ID = 1;
        IDREF = 2;
        IDREFS = 3;
        ENTITY = 4;
        ENTITIES = 5;
        NMTOKEN = 6;
        NMTOKENS = 7;
    }
    Type ty = 1;
}

message EnumeratedType {
    repeated string names = 1;
}

message AttrListDecl {
    string name = 1;
    AttrType atype = 2;
    EnumeratedType etype = 3;
    DefaultDecl def = 4;
}

message ExternalId {
    enum Type {
        SYSTEM = 0;
        PUBLIC = 1;
        FUZZ = 2;
    }
    Type type = 1;
    string system = 2;
    string pub = 3;
}

message AttValue {
    enum Type {
        ENTITY = 0;
        CHAR = 1;
        FUZZ = 2;
    }
    Type type = 1;
    repeated string value = 2;
}

message DefaultDecl {
    enum Type {
        REQUIRED = 0;
        IMPLIED = 1;
        FIXED = 2;
        FUZZ = 3;
    }
    Type type = 1;
    AttValue att = 2;
}

message AttDef {
    // TODO: Add enumerated type
    enum Type {
        CDATA = 0;
        ID = 1;
        IDREF = 2;
        IDREFS = 3;
        ENTITY = 4;
        ENTITIES = 5;
        NMTOKEN = 6;
        NMTOKENS = 7;
        FUZZ = 8;
    }
    string name = 1;
    Type type = 2;
    DefaultDecl def = 3;
}

message AttListDecl {
    string name = 1;
    repeated AttDef attdefs = 2;
}

message NotationDecl {
    string name = 1;
    oneof notation_oneof {
        ExternalId ext = 2;
        string pub = 3;
        string fuzz = 4;
    }
}

message EntityValue {
    enum Type {
        ENTITY = 0;
        CHAR = 1;
        PEREF = 2;
        FUZZ = 3;
    }
    Type type = 1;
    repeated string name = 2;
}

message NDataDecl {
    string name = 1;
}

message EntityDef {
    oneof entity_oneof {
        ExternalId ext = 1;
        EntityValue val = 2;
    }
    NDataDecl ndata = 3;
}

message PEDef {
    oneof pedef_oneof {
        EntityValue val = 1;
        ExternalId id = 2;
    }
}

message EntityDecl {
    enum Type {
        GEDECL = 0;
        PEDECL = 1;
    }
    Type type = 1;
    string name = 2;
    EntityDef ent = 3;
    PEDef pedef = 4;
}

message ConditionalSect {
    enum Type {
        INCLUDE = 0;
        IGNORE = 1;
        FUZZ = 2;
    }
    Type type = 1;
    ExtSubsetDecl ext = 2;
    // TODO: Make this recursive
    // See https://www.w3.org/TR/xml/#NT-conditionalSect
    repeated string ignores = 3;
}

message OneExtSubsetDecl {
    oneof extsubset_oneof {
        MarkupDecl m = 1;
        ConditionalSect c = 2;
    }
}

message ExtSubsetDecl {
    repeated OneExtSubsetDecl decls = 1;
}

message MarkupDecl {
    oneof markup_oneof {
        ElementDecl e = 1;
        AttListDecl a = 2;
        NotationDecl n = 3;
        Misc m = 4;
        EntityDecl entity = 5;
        ExtSubsetDecl ext = 6;
    }
}

message DocTypeDecl {
    string name = 1;
    ExternalId ext = 2;
    repeated MarkupDecl mdecl = 3;
}

message Prolog {
    XmlDeclaration decl = 1;
    DocTypeDecl doctype = 2;
    repeated Misc misc = 3;
}

message KeyValue {
    enum XmlNamespace {
        ATTRIBUTES = 0;
        BASE = 1;
        CATALOG = 2;
        ID = 3;
        LANG = 4;
        LINK = 5;
        SPACE = 6;
        SPECIAL = 7;
        TEST = 8;
        FUZZ = 9;
    }
    XmlNamespace type = 1;
    string key = 2;
    string value = 3;
}

message ProcessingInstruction {
    string name = 1;
    repeated KeyValue kv = 2;
}

message CData {
    string data = 1;
}

message Content {
    // TODO: Add other content types
    oneof content_oneof {
        string str = 1;
        Element e = 2;
        CData c = 3;
    }
}

message Element {
    enum Type {
        PREDEFINED = 0;
        FUZZ = 1;
    }
    enum Id {
        XIINCLUDE = 0;
        XIFALLBACK = 1;
        // Attributes of xinclude
        XIHREF = 2;
        XIPARSE = 3;
        XIXPOINTER = 4;
        XIENCODING = 5;
        XIACCEPT = 6;
        XIACCEPTLANG = 7;
    }
    Type type = 1;
    Id id = 2;
    string name = 3;
    repeated KeyValue kv = 4;
    Content content = 5;
    string childprop = 6;
}

message VersionNum {
    enum Type {
        STANDARD = 0;
        FUZZ = 1;
    }
    Type type = 1;
    uint64 major = 2;
    uint64 minor = 3;
}

message Encodings {
    enum Enc {
        BIG5 = 0;
        EUCJP = 1;
        EUCKR = 2;
        GB18030 = 3;
        ISO2022JP = 4;
        ISO2022KR = 5;
        ISO88591 = 6;
        ISO88592 = 7;
        ISO88593 = 8;
        ISO88594 = 9;
        ISO88595 = 10;
        ISO88596 = 11;
        ISO88597 = 12;
        ISO88598 = 13;
        ISO88599 = 14;
        SHIFTJIS = 15;
        TIS620 = 16;
        USASCII = 17;
        UTF8 = 18;
        UTF16 = 19;
        UTF16BE = 20;
        UTF16LE = 21;
        WINDOWS31J = 22;
        WINDOWS1255 = 23;
        WINDOWS1256 = 24;
        FUZZ = 25;
    }
    Enc name = 1;
    string fuzz = 2;
}

message XmlDeclaration {
    VersionNum ver = 1;
    Encodings enc = 2;
    enum Standalone {
        YES = 0;
        NO = 1;
    }
    Standalone standalone = 3;
    string fuzz = 4;
}

message XmlDocument {
    Prolog p = 1;
    repeated Element e = 2;
}

package xmlProtoFuzzer;