00001 
00002 
00003 #if !defined(ERRHEADER_XMLErrs)
00004 #define ERRHEADER_XMLErrs
00005 
00006 #include <framework/XMLErrorReporter.hpp>
00007 
00008 class XMLErrs
00009 {
00010 public :
00011     enum Codes
00012     {
00013         NoError                            = 0
00014       , W_LowBounds                        = 1
00015       , NotationAlreadyExists              = 2
00016       , AttListAlreadyExists               = 3
00017       , ContradictoryEncoding              = 4
00018       , UndeclaredElemInCM                 = 5
00019       , UndeclaredElemInAttList            = 6
00020       , W_HighBounds                       = 7
00021       , E_LowBounds                        = 8
00022       , FeatureUnsupported                 = 9
00023       , TopLevelNoNameComplexType          = 10
00024       , TopLevelNoNameAttribute            = 11
00025       , NoNameRefAttribute                 = 12
00026       , GlobalNoNameElement                = 13
00027       , NoNameRefElement                   = 14
00028       , NoNameRefGroup                     = 15
00029       , NoNameRefAttGroup                  = 16
00030       , AnonComplexTypeWithName            = 17
00031       , AnonSimpleTypeWithName             = 18
00032       , InvalidElementContent              = 19
00033       , UntypedElement                     = 20
00034       , SimpleTypeContentError             = 21
00035       , ExpectedSimpleTypeInList           = 22
00036       , ListUnionRestrictionError          = 23
00037       , SimpleTypeDerivationByListError    = 24
00038       , ExpectedSimpleTypeInRestriction    = 25
00039       , DuplicateFacet                     = 26
00040       , ExpectedSimpleTypeInUnion          = 27
00041       , EmptySimpleTypeContent             = 28
00042       , InvalidSimpleContent               = 29
00043       , UnspecifiedBase                    = 30
00044       , InvalidComplexContent              = 31
00045       , SchemaElementContentError          = 32
00046       , ContentError                       = 33
00047       , UnknownSimpleType                  = 34
00048       , UnknownComplexType                 = 35
00049       , UnresolvedPrefix                   = 36
00050       , RefElementNotFound                 = 37
00051       , TypeNotFound                       = 38
00052       , TopLevelAttributeNotFound          = 39
00053       , InvalidChildInComplexType          = 40
00054       , BaseTypeNotFound                   = 41
00055       , NoAttributeInSchema                = 42
00056       , DatatypeValidatorCreationError     = 43
00057       , InvalidChildFollowingSimpleContent   = 44
00058       , InvalidChildFollowingConplexContent   = 45
00059       , InvalidComplexTypeBlockValue       = 46
00060       , InvalidComplexTypeFinalValue       = 47
00061       , AttributeDefaultFixedValue         = 48
00062       , NotOptionalDefaultAttValue         = 49
00063       , LocalAttributeWithNameRef          = 50
00064       , GlobalAttributeWithNameRef         = 51
00065       , DuplicateAttribute                 = 52
00066       , AttributeWithTypeAndSimpleType     = 53
00067       , AttributeSimpleTypeNotFound        = 54
00068       , ElementWithFixedAndDefault         = 55
00069       , DeclarationWithNameRef             = 56
00070       , BadAttWithRef                      = 57
00071       , InvalidDeclarationName             = 58
00072       , GlobalElementWithRef               = 59
00073       , ElementWithTypeAndAnonType         = 60
00074       , NotSimpleOrMixedElement            = 61
00075       , DisallowedSimpleTypeExtension      = 62
00076       , InvalidSimpleContentBase           = 63
00077       , InvalidComplexTypeBase             = 64
00078       , InvalidChildInSimpleContent        = 65
00079       , InvalidChildInComplexContent       = 66
00080       , AnnotationError                    = 67
00081       , DisallowedBaseDerivation           = 68
00082       , SubstitutionRepeated               = 69
00083       , UnionRepeated                      = 70
00084       , ExtensionRepeated                  = 71
00085       , ListRepeated                       = 72
00086       , RestrictionRepeated                = 73
00087       , InvalidBlockValue                  = 74
00088       , InvalidFinalValue                  = 75
00089       , InvalidSubstitutionGroupElement    = 76
00090       , SubstitutionGroupTypeMismatch      = 77
00091       , DuplicateElementDeclaration        = 78
00092       , InvalidElementBlockValue           = 79
00093       , InvalidElementFinalValue           = 80
00094       , InvalidAttValue                    = 81
00095       , AttributeRefContentError           = 82
00096       , DuplicateRefAttribute              = 83
00097       , ForbiddenDerivationByRestriction   = 84
00098       , ForbiddenDerivationByExtension     = 85
00099       , BaseNotComplexType                 = 86
00100       , ImportNamespaceDifference          = 87
00101       , ImportRootError                    = 88
00102       , DeclarationNoSchemaLocation        = 89
00103       , IncludeNamespaceDifference         = 90
00104       , OnlyAnnotationExpected             = 91
00105       , InvalidAttributeContent            = 92
00106       , AttributeRequired                  = 93
00107       , AttributeDisallowed                = 94
00108       , InvalidMin2MaxOccurs               = 95
00109       , AnyAttributeContentError           = 96
00110       , NoNameGlobalElement                = 97
00111       , NoCircularDefinition               = 98
00112       , DuplicateGlobalType                = 99
00113       , DuplicateGlobalDeclaration         = 100
00114       , WS_CollapseExpected                = 101
00115       , Import_1_1                         = 102
00116       , Import_1_2                         = 103
00117       , ElemIDValueConstraint              = 104
00118       , NoNotationType                     = 105
00119       , EmptiableMixedContent              = 106
00120       , EmptyComplexRestrictionDerivation   = 107
00121       , MixedOrElementOnly                 = 108
00122       , InvalidContentRestriction          = 109
00123       , ForbiddenDerivation                = 110
00124       , AtomicItemType                     = 111
00125       , MemberTypeNoUnion                  = 112
00126       , GroupContentError                  = 113
00127       , AttGroupContentError               = 114
00128       , MinMaxOnGroupChild                 = 115
00129       , DeclarationNotFound                = 116
00130       , AllContentLimited                  = 117
00131       , BadMinMaxAllCT                     = 118
00132       , BadMinMaxAllElem                   = 119
00133       , NoCircularAttGroup                 = 120
00134       , DuplicateAttInDerivation           = 121
00135       , NotExpressibleWildCardIntersection   = 122
00136       , BadAttDerivation_1                 = 123
00137       , BadAttDerivation_2                 = 124
00138       , BadAttDerivation_3                 = 125
00139       , BadAttDerivation_4                 = 126
00140       , BadAttDerivation_5                 = 127
00141       , BadAttDerivation_6                 = 128
00142       , BadAttDerivation_7                 = 129
00143       , AllContentError                    = 130
00144       , RedefineNamespaceDifference        = 131
00145       , Redefine_InvalidSimpleType         = 132
00146       , Redefine_InvalidSimpleTypeBase     = 133
00147       , Redefine_InvalidComplexType        = 134
00148       , Redefine_InvalidComplexTypeBase    = 135
00149       , Redefine_InvalidGroupMinMax        = 136
00150       , Redefine_DeclarationNotFound       = 137
00151       , Redefine_GroupRefCount             = 138
00152       , Redefine_AttGroupRefCount          = 139
00153       , Notation_InvalidDecl               = 140
00154       , Notation_DeclNotFound              = 141
00155       , DisplayErrorMessage                = 142
00156       , E_HighBounds                       = 143
00157       , F_LowBounds                        = 144
00158       , ExpectedCommentOrCDATA             = 145
00159       , ExpectedAttrName                   = 146
00160       , ExpectedNotationName               = 147
00161       , NoRepInMixed                       = 148
00162       , BadDefAttrDecl                     = 149
00163       , ExpectedDefAttrDecl                = 150
00164       , AttListSyntaxError                 = 151
00165       , ExpectedEqSign                     = 152
00166       , DupAttrName                        = 153
00167       , BadIdForXMLLangAttr                = 154
00168       , ExpectedElementName                = 155
00169       , MustStartWithXMLDecl               = 156
00170       , CommentsMustStartWith              = 157
00171       , InvalidDocumentStructure           = 158
00172       , ExpectedDeclString                 = 159
00173       , BadXMLVersion                      = 160
00174       , UnsupportedXMLVersion              = 161
00175       , UnterminatedXMLDecl                = 162
00176       , BadXMLEncoding                     = 163
00177       , BadStandalone                      = 164
00178       , UnterminatedComment                = 165
00179       , PINameExpected                     = 166
00180       , UnterminatedPI                     = 167
00181       , InvalidCharacter                   = 168
00182       , UnexpectedTextBeforeRoot           = 169
00183       , UnterminatedStartTag               = 170
00184       , ExpectedAttrValue                  = 171
00185       , UnterminatedEndTag                 = 172
00186       , ExpectedAttributeType              = 173
00187       , ExpectedEndOfTagX                  = 174
00188       , ExpectedMarkup                     = 175
00189       , NotValidAfterContent               = 176
00190       , ExpectedComment                    = 177
00191       , ExpectedCommentOrPI                = 178
00192       , ExpectedWhitespace                 = 179
00193       , NoRootElemInDOCTYPE                = 180
00194       , ExpectedQuotedString               = 181
00195       , ExpectedPublicId                   = 182
00196       , InvalidPublicIdChar                = 183
00197       , UnterminatedDOCTYPE                = 184
00198       , InvalidCharacterInIntSubset        = 185
00199       , ExpectedCDATA                      = 186
00200       , InvalidInitialNameChar             = 187
00201       , InvalidNameChar                    = 188
00202       , UnexpectedWhitespace               = 189
00203       , InvalidCharacterInAttrValue        = 190
00204       , ExpectedMarkupDecl                 = 191
00205       , TextDeclNotLegalHere               = 192
00206       , ConditionalSectInIntSubset         = 193
00207       , ExpectedPEName                     = 194
00208       , UnterminatedEntityDecl             = 195
00209       , InvalidCharacterRef                = 196
00210       , UnterminatedCharRef                = 197
00211       , ExpectedEntityRefName              = 198
00212       , EntityNotFound                     = 199
00213       , NoUnparsedEntityRefs               = 200
00214       , UnterminatedEntityRef              = 201
00215       , RecursiveEntity                    = 202
00216       , PartialMarkupInEntity              = 203
00217       , UnterminatedElementDecl            = 204
00218       , ExpectedContentSpecExpr            = 205
00219       , ExpectedAsterisk                   = 206
00220       , UnterminatedContentModel           = 207
00221       , ExpectedSystemId                   = 208
00222       , ExpectedSystemOrPublicId           = 209
00223       , UnterminatedNotationDecl           = 210
00224       , ExpectedSeqChoiceLeaf              = 211
00225       , ExpectedChoiceOrCloseParen         = 212
00226       , ExpectedSeqOrCloseParen            = 213
00227       , ExpectedEnumValue                  = 214
00228       , ExpectedEnumSepOrParen             = 215
00229       , UnterminatedEntityLiteral          = 216
00230       , MoreEndThanStartTags               = 217
00231       , ExpectedOpenParen                  = 218
00232       , AttrAlreadyUsedInSTag              = 219
00233       , BracketInAttrValue                 = 220
00234       , Expected2ndSurrogateChar           = 221
00235       , ExpectedEndOfConditional           = 222
00236       , ExpectedIncOrIgn                   = 223
00237       , ExpectedINCLUDEBracket             = 224
00238       , ExpectedTextDecl                   = 225
00239       , ExpectedXMLDecl                    = 226
00240       , UnexpectedEOE                      = 227
00241       , PEPropogated                       = 228
00242       , ExtraCloseSquare                   = 229
00243       , PERefInMarkupInIntSubset           = 230
00244       , EntityPropogated                   = 231
00245       , ExpectedNumericalCharRef           = 232
00246       , ExpectedOpenSquareBracket          = 233
00247       , BadSequenceInCharData              = 234
00248       , IllegalSequenceInComment           = 235
00249       , UnterminatedCDATASection           = 236
00250       , ExpectedNDATA                      = 237
00251       , NDATANotValidForPE                 = 238
00252       , HexRadixMustBeLowerCase            = 239
00253       , DeclStringRep                      = 240
00254       , DeclStringsInWrongOrder            = 241
00255       , NoExtRefsInAttValue                = 242
00256       , XMLDeclMustBeLowerCase             = 243
00257       , ExpectedEntityValue                = 244
00258       , BadDigitForRadix                   = 245
00259       , EndedWithTagsOnStack               = 246
00260       , AmbiguousContentModel              = 247
00261       , NestedCDATA                        = 248
00262       , UnknownPrefix                      = 249
00263       , PartialTagMarkupError              = 250
00264       , EmptyMainEntity                    = 251
00265       , CDATAOutsideOfContent              = 252
00266       , OnlyCharRefsAllowedHere            = 253
00267       , Unexpected2ndSurrogateChar         = 254
00268       , NoPIStartsWithXML                  = 255
00269       , XMLDeclMustBeFirst                 = 256
00270       , XMLVersionRequired                 = 257
00271       , StandaloneNotLegal                 = 258
00272       , EncodingRequired                   = 259
00273       , TooManyColonsInName                = 260
00274       , InvalidColonPos                    = 261
00275       , ColonNotLegalWithNS                = 262
00276       , SysException                       = 263
00277       , XMLException                       = 264
00278       , UnexpectedEOF                      = 265
00279       , UnexpectedError                    = 266
00280       , BadSchemaLocation                  = 267
00281       , NoGrammarResolver                  = 268
00282       , SchemaScanFatalError               = 269
00283       , F_HighBounds                       = 270
00284     };
00285 
00286     static bool isFatal(const XMLErrs::Codes toCheck)
00287     {
00288         return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
00289     }
00290 
00291     static bool isWarning(const XMLErrs::Codes toCheck)
00292     {
00293         return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
00294     }
00295 
00296     static bool isError(const XMLErrs::Codes toCheck)
00297     {
00298         return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
00299     }
00300 
00301     static XMLErrorReporter::ErrTypes errorType(const XMLErrs::Codes toCheck)
00302     {
00303        if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00304            return XMLErrorReporter::ErrType_Warning;
00305        else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
00306             return XMLErrorReporter::ErrType_Fatal;
00307        else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
00308             return XMLErrorReporter::ErrType_Error;
00309        return XMLErrorReporter::ErrTypes_Unknown;
00310     }
00311 };
00312 #endif
00313