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       , AnonComplexTypeWithName            = 15
00029       , AnonSimpleTypeWithName             = 16
00030       , InvalidElementContent              = 17
00031       , InvalidAttributeName               = 18
00032       , UntypedElement                     = 19
00033       , SimpleTypeContentError             = 20
00034       , ExpectedSimpleTypeInList           = 21
00035       , ListUnionRestrictionError          = 22
00036       , SimpleTypeDerivationByListError    = 23
00037       , ExpectedSimpleTypeInRestriction    = 24
00038       , DuplicateFacet                     = 25
00039       , ExpectedSimpleTypeInUnion          = 26
00040       , EmptySimpleTypeContent             = 27
00041       , InvalidSimpleContent               = 28
00042       , UnspecifiedBase                    = 29
00043       , InvalidComplexContent              = 30
00044       , SchemaElementContentError          = 31
00045       , ContentError                       = 32
00046       , UnknownSimpleType                  = 33
00047       , UnknownComplexType                 = 34
00048       , UnresolvedPrefix                   = 35
00049       , RefElementNotFound                 = 36
00050       , TypeNotFound                       = 37
00051       , TopLevelAttributeNotFound          = 38
00052       , InvalidChildInComplexType          = 39
00053       , BaseTypeNotFound                   = 40
00054       , NoAttributeInSchema                = 41
00055       , DatatypeValidatorCreationError     = 42
00056       , InvalidComplexTypeName             = 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       , ElementWithNameRef                 = 56
00070       , BadAttWithRef                      = 57
00071       , InvalidElementName                 = 58
00072       , GlobalElementWithRef               = 59
00073       , ElementWithTypeAndAnonType         = 60
00074       , DatatypeValidationFailure          = 61
00075       , NotSimpleOrMixedElement            = 62
00076       , DisallowedSimpleTypeExtension      = 63
00077       , InvalidSimpleContentBase           = 64
00078       , InvalidComplexTypeBase             = 65
00079       , InvalidChildInSimpleContent        = 66
00080       , InvalidChildInComplexContent       = 67
00081       , AnnotationError                    = 68
00082       , DisallowedBaseDerivation           = 69
00083       , SubstitutionRepeated               = 70
00084       , UnionRepeated                      = 71
00085       , ExtensionRepeated                  = 72
00086       , ListRepeated                       = 73
00087       , RestrictionRepeated                = 74
00088       , InvalidBlockValue                  = 75
00089       , InvalidFinalValue                  = 76
00090       , InvalidSubstitutionGroupElement    = 77
00091       , SubstitutionGroupTypeMismatch      = 78
00092       , DuplicateElementDeclaration        = 79
00093       , InvalidElementBlockValue           = 80
00094       , InvalidElementFinalValue           = 81
00095       , InvalidAttValue                    = 82
00096       , AttributeRefContentError           = 83
00097       , DuplicateRefAttribute              = 84
00098       , ForbiddenDerivationByRestriction   = 85
00099       , ForbiddenDerivationByExtension     = 86
00100       , BaseNotComplexType                 = 87
00101       , ImportNoSchemaLocation             = 88
00102       , ImportNamespaceDifference          = 89
00103       , ImportRootError                    = 90
00104       , IncludeNoSchemaLocation            = 91
00105       , IncludeNamespaceDifference         = 92
00106       , OnlyAnnotationExpected             = 93
00107       , InvalidAttributeContent            = 94
00108       , AttributeRequired                  = 95
00109       , AttributeDisallowed                = 96
00110       , InvalidMin2MaxOccurs               = 97
00111       , AnyAttributeContentError           = 98
00112       , NoNameGlobalElement                = 99
00113       , NoCircularDefinition               = 100
00114       , DuplicateGlobalType                = 101
00115       , WS_CollapseExpected                = 102
00116       , DisplayErrorMessage                = 103
00117       , E_HighBounds                       = 104
00118       , F_LowBounds                        = 105
00119       , ExpectedCommentOrCDATA             = 106
00120       , ExpectedAttrName                   = 107
00121       , ExpectedNotationName               = 108
00122       , NoRepInMixed                       = 109
00123       , BadDefAttrDecl                     = 110
00124       , ExpectedDefAttrDecl                = 111
00125       , AttListSyntaxError                 = 112
00126       , ExpectedEqSign                     = 113
00127       , DupAttrName                        = 114
00128       , BadIdForXMLLangAttr                = 115
00129       , ExpectedElementName                = 116
00130       , MustStartWithXMLDecl               = 117
00131       , CommentsMustStartWith              = 118
00132       , InvalidDocumentStructure           = 119
00133       , ExpectedDeclString                 = 120
00134       , BadXMLVersion                      = 121
00135       , UnsupportedXMLVersion              = 122
00136       , UnterminatedXMLDecl                = 123
00137       , BadXMLEncoding                     = 124
00138       , BadStandalone                      = 125
00139       , UnterminatedComment                = 126
00140       , PINameExpected                     = 127
00141       , UnterminatedPI                     = 128
00142       , InvalidCharacter                   = 129
00143       , UnexpectedTextBeforeRoot           = 130
00144       , UnterminatedStartTag               = 131
00145       , ExpectedAttrValue                  = 132
00146       , UnterminatedEndTag                 = 133
00147       , ExpectedAttributeType              = 134
00148       , ExpectedEndOfTagX                  = 135
00149       , ExpectedMarkup                     = 136
00150       , NotValidAfterContent               = 137
00151       , ExpectedComment                    = 138
00152       , ExpectedCommentOrPI                = 139
00153       , ExpectedWhitespace                 = 140
00154       , NoRootElemInDOCTYPE                = 141
00155       , ExpectedQuotedString               = 142
00156       , ExpectedPublicId                   = 143
00157       , InvalidPublicIdChar                = 144
00158       , UnterminatedDOCTYPE                = 145
00159       , InvalidCharacterInIntSubset        = 146
00160       , ExpectedCDATA                      = 147
00161       , InvalidInitialNameChar             = 148
00162       , InvalidNameChar                    = 149
00163       , UnexpectedWhitespace               = 150
00164       , InvalidCharacterInAttrValue        = 151
00165       , ExpectedMarkupDecl                 = 152
00166       , TextDeclNotLegalHere               = 153
00167       , ConditionalSectInIntSubset         = 154
00168       , ExpectedPEName                     = 155
00169       , UnterminatedEntityDecl             = 156
00170       , InvalidCharacterRef                = 157
00171       , UnterminatedCharRef                = 158
00172       , ExpectedEntityRefName              = 159
00173       , EntityNotFound                     = 160
00174       , NoUnparsedEntityRefs               = 161
00175       , UnterminatedEntityRef              = 162
00176       , RecursiveEntity                    = 163
00177       , PartialMarkupInEntity              = 164
00178       , UnterminatedElementDecl            = 165
00179       , ExpectedContentSpecExpr            = 166
00180       , ExpectedAsterisk                   = 167
00181       , UnterminatedContentModel           = 168
00182       , ExpectedSystemId                   = 169
00183       , ExpectedSystemOrPublicId           = 170
00184       , UnterminatedNotationDecl           = 171
00185       , ExpectedSeqChoiceLeaf              = 172
00186       , ExpectedChoiceOrCloseParen         = 173
00187       , ExpectedSeqOrCloseParen            = 174
00188       , ExpectedEnumValue                  = 175
00189       , ExpectedEnumSepOrParen             = 176
00190       , UnterminatedEntityLiteral          = 177
00191       , MoreEndThanStartTags               = 178
00192       , IllegalRefInStandalone             = 179
00193       , ExpectedOpenParen                  = 180
00194       , AttrAlreadyUsedInSTag              = 181
00195       , BracketInAttrValue                 = 182
00196       , Expected2ndSurrogateChar           = 183
00197       , ExpectedEndOfConditional           = 184
00198       , ExpectedIncOrIgn                   = 185
00199       , ExpectedINCLUDEBracket             = 186
00200       , ExpectedTextDecl                   = 187
00201       , ExpectedXMLDecl                    = 188
00202       , UnexpectedEOE                      = 189
00203       , PEPropogated                       = 190
00204       , ExtraCloseSquare                   = 191
00205       , PERefInMarkupInIntSubset           = 192
00206       , EntityPropogated                   = 193
00207       , ExpectedNumericalCharRef           = 194
00208       , ExpectedOpenSquareBracket          = 195
00209       , BadSequenceInCharData              = 196
00210       , IllegalSequenceInComment           = 197
00211       , UnterminatedCDATASection           = 198
00212       , ExpectedNDATA                      = 199
00213       , NDATANotValidForPE                 = 200
00214       , HexRadixMustBeLowerCase            = 201
00215       , DeclStringRep                      = 202
00216       , DeclStringsInWrongOrder            = 203
00217       , NoExtRefsInAttValue                = 204
00218       , XMLDeclMustBeLowerCase             = 205
00219       , ExpectedEntityValue                = 206
00220       , BadDigitForRadix                   = 207
00221       , EndedWithTagsOnStack               = 208
00222       , AmbiguousContentModel              = 209
00223       , NestedCDATA                        = 210
00224       , UnknownPrefix                      = 211
00225       , PartialTagMarkupError              = 212
00226       , EmptyMainEntity                    = 213
00227       , CDATAOutsideOfContent              = 214
00228       , OnlyCharRefsAllowedHere            = 215
00229       , Unexpected2ndSurrogateChar         = 216
00230       , NoPIStartsWithXML                  = 217
00231       , XMLDeclMustBeFirst                 = 218
00232       , XMLVersionRequired                 = 219
00233       , StandaloneNotLegal                 = 220
00234       , TooManyColonsInName                = 221
00235       , InvalidColonPos                    = 222
00236       , ColonNotLegalWithNS                = 223
00237       , SysException                       = 224
00238       , XMLException                       = 225
00239       , UnexpectedEOF                      = 226
00240       , UnexpectedError                    = 227
00241       , BadSchemaLocation                  = 228
00242       , NoGrammarResolver                  = 229
00243       , F_HighBounds                       = 230
00244     };
00245 
00246     static bool isFatal(const XMLErrs::Codes toCheck)
00247     {
00248         return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
00249     }
00250 
00251     static bool isWarning(const XMLErrs::Codes toCheck)
00252     {
00253         return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
00254     }
00255 
00256     static bool isError(const XMLErrs::Codes toCheck)
00257     {
00258         return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
00259     }
00260 
00261     static XMLErrorReporter::ErrTypes errorType(const XMLErrs::Codes toCheck)
00262     {
00263        if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00264            return XMLErrorReporter::ErrType_Warning;
00265        else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
00266             return XMLErrorReporter::ErrType_Fatal;
00267        else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
00268             return XMLErrorReporter::ErrType_Error;
00269        return XMLErrorReporter::ErrTypes_Unknown;
00270     }
00271 };
00272 #endif
00273