/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk
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
/*  xml_error.h - Error codes for XML parsing/validation.
    Copyright (c) 2008, Robert D. Cameron and Dan Lin.
    Licensed to the public under the Open Software License 3.0.
    Licensed to International Characters, Inc., under the Academic
    Free License 3.0.

   The following enum provides codes for the well-formedness (wfErr)
   and validity (vErr) constraints of XML, based on the ids for those
   constraints in the REC-xml-20060816.xml document.  The ids may be
   recovered by stripping wfErr_ or vc_Err and substituting "-" for "_".
*/
#ifndef XML_ERROR_H
#define XML_ERROR_H

enum XML_Constraint {
		wfErr_wfc_PEinInternalSubset,
		wfErr_ExtSubset,
		wfErr_PE_between_Decls,
		wfErr_GIMatch,
		wfErr_uniqattspec,
		wfErr_NoExternalRefs,
		wfErr_CleanAttrVals,
		wfErr_wf_Legalchar,
		wfErr_wf_entdeclared,
		wfErr_textent,
		wfErr_norecursion,
		wfErr_indtd,
		vErr_vc_roottype,
		vErr_vc_PEinMarkupDecl,
		vErr_vc_check_rmd,
		vErr_elementvalid,
		vErr_ValueType,
		vErr_EDUnique,
		vErr_vc_PEinGroup,
		vErr_vc_MixedChildrenUnique,
		vErr_id,
		vErr_one_id_per_el,
		vErr_id_default,
		vErr_idref,
		vErr_entname,
		vErr_nmtok,
		vErr_notatn,
		vErr_OneNotationPer,
		vErr_NoNotationEmpty,
		vErr_NoDuplicateTokens,
		vErr_enum,
		vErr_RequiredAttr,
		vErr_defattrvalid,
		vErr_FixedAttr,
		vErr_condsec_nesting,
		vErr_vc_entdeclared,
		vErr_not_declared,
		vErr_UniqueNotationName};

char * XML_Constraint_Strings[] = {
		"wfc-PEinInternalSubset",
		"ExtSubset",
		"PE-between-Decls",
		"GIMatch",
		"uniqattspec",
		"NoExternalRefs",
		"CleanAttrVals",
		"wf-Legalchar",
		"wf-entdeclared",
		"textent",
		"norecursion",
		"indtd",
		"vc-roottype",
		"vc-PEinMarkupDecl",
		"vc-check-rmd",
		"elementvalid",
		"ValueType",
		"EDUnique",
		"vc-PEinGroup",
		"vc-MixedChildrenUnique",
		"id",
		"one-id-per-el",
		"id-default",
		"idref",
		"entname",
		"nmtok",
		"notatn",
		"OneNotationPer",
		"NoNotationEmpty",
		"NoDuplicateTokens",
		"enum",
		"RequiredAttr",
		"defattrvalid",
		"FixedAttr",
		"condsec-nesting",
		"vc-entdeclared",
		"not-declared",
		"UniqueNotationName"};

/* The following enum provides codes for XML nonterminals using
   codes in the REC-xml-20060816.xml document.  The ids may be
   recovered by substituting "-" for "_".
*/

enum XML_NonTerminal {
		NT_document,
		NT_Char,
		NT_S,
		NT_NameChar,
		NT_Name,
		NT_Names,
		NT_Nmtoken,
		NT_Nmtokens,
		NT_EntityValue,
		NT_AttValue,
		NT_SystemLiteral,
		NT_PubidLiteral,
		NT_PubidChar,
		NT_CharData,
		NT_Comment,
		NT_PI,
		NT_PITarget,
		NT_CDSect,
		NT_CDStart,
		NT_CData,
		NT_CDEnd,
		NT_prolog,
		NT_XMLDecl,
		NT_VersionInfo,
		NT_Eq,
		NT_VersionNum,
		NT_Misc,
		NT_doctypedecl,
		NT_DeclSep,
		NT_intSubset,
		NT_markupdecl,
		NT_extSubset,
		NT_extSubsetDecl,
		NT_SDDecl,
		NT_element,
		NT_STag,
		NT_Attribute,
		NT_ETag,
		NT_content,
		NT_EmptyElemTag,
		NT_elementdecl,
		NT_contentspec,
		NT_children,
		NT_cp,
		NT_choice,
		NT_seq,
		NT_Mixed,
		NT_AttlistDecl,
		NT_AttDef,
		NT_AttType,
		NT_StringType,
		NT_TokenizedType,
		NT_EnumeratedType,
		NT_NotationType,
		NT_Enumeration,
		NT_DefaultDecl,
		NT_conditionalSect,
		NT_includeSect,
		NT_ignoreSect,
		NT_ignoreSectContents,
		NT_Ignore,
		NT_CharRef,
		NT_Reference,
		NT_EntityRef,
		NT_PEReference,
		NT_EntityDecl,
		NT_GEDecl,
		NT_PEDecl,
		NT_EntityDef,
		NT_PEDef,
		NT_ExternalID,
		NT_NDataDecl,
		NT_TextDecl,
		NT_extParsedEnt,
		NT_EncodingDecl,
		NT_EncName,
		NT_NotationDecl,
		NT_PublicID,
		NT_Letter,
		NT_BaseChar,
		NT_Ideographic,
		NT_CombiningChar,
		NT_Digit,
		NT_Extender};

char * XML_NonTerminal_Names[] = {
		"document  [1]",
		"Char  [2]",
		"S  [3]",
		"NameChar  [4]",
		"Name  [5]",
		"Names  [6]",
		"Nmtoken  [7]",
		"Nmtokens  [8]",
		"EntityValue  [9]",
		"AttValue  [10]",
		"SystemLiteral  [11]",
		"PubidLiteral  [12]",
		"PubidChar  [13]",
		"CharData  [14]",
		"Comment  [15]",
		"PI  [16]",
		"PITarget  [17]",
		"CDSect  [18]",
		"CDStart  [19]",
		"CData  [20]",
		"CDEnd  [21]",
		"prolog  [22]",
		"XMLDecl  [23]",
		"VersionInfo  [24]",
		"Eq  [25]",
		"VersionNum  [26]",
		"Misc  [27]",
		"doctypedecl  [28]",
		"DeclSep  [28a]",
		"intSubset  [28b]",
		"markupdecl  [29]",
		"extSubset  [30]",
		"extSubsetDecl  [31]",
		"SDDecl  [32]",
		"element  [39]",
		"STag  [40]",
		"Attribute  [41]",
		"ETag  [42]",
		"content  [43]",
		"EmptyElemTag  [44]",
		"elementdecl  [45]",
		"contentspec  [46]",
		"children  [47]",
		"cp  [48]",
		"choice  [49]",
		"seq  [50]",
		"Mixed  [51]",
		"AttlistDecl  [52]",
		"AttDef  [53]",
		"AttType  [54]",
		"StringType  [55]",
		"TokenizedType  [56]",
		"EnumeratedType  [57]",
		"NotationType  [58]",
		"Enumeration  [59]",
		"DefaultDecl  [60]",
		"conditionalSect  [61]",
		"includeSect  [62]",
		"ignoreSect  [63]",
		"ignoreSectContents  [64]",
		"Ignore  [65]",
		"CharRef  [66]",
		"Reference  [67]",
		"EntityRef  [68]",
		"PEReference  [69]",
		"EntityDecl  [70]",
		"GEDecl  [71]",
		"PEDecl  [72]",
		"EntityDef  [73]",
		"PEDef  [74]",
		"ExternalID  [75]",
		"NDataDecl  [76]",
		"TextDecl  [77]",
		"extParsedEnt  [78]",
		"EncodingDecl  [80]",
		"EncName  [81]",
		"NotationDecl  [82]",
		"PublicID  [83]",
		"Letter  [84]",
		"BaseChar  [85]",
		"Ideographic  [86]",
		"CombiningChar  [87]",
		"Digit  [88]",
		"Extender  [89]"};

void ShowConstraintError(XML_Constraint errCode);

void ShowSyntaxError(XML_NonTerminal errCode);

void NoEncodingError(char * msg);

void EncodingError(char * msg, unsigned char * encoding, int lgth);

void CharSetValidationError(char * encoding, int err_pos);

void XMLCharacterError(int err_pos);

void IncompleteCodeUnitError();

void DeclarationError(int pos);

void ImplementationLimitError(char * msg);

void ContentModelError();
#endif