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