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