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 , Import_1_1 = 103
00117 , Import_1_2 = 104
00118 , ElemIDValueConstraint = 105
00119 , NoNotationType = 106
00120 , EmptiableMixedContent = 107
00121 , EmptyComplexRestrictionDerivation = 108
00122 , MixedOrElementOnly = 109
00123 , InvalidContentRestriction = 110
00124 , ForbiddenDerivation = 111
00125 , AtomicItemType = 112
00126 , MemberTypeNoUnion = 113
00127 , DisplayErrorMessage = 114
00128 , E_HighBounds = 115
00129 , F_LowBounds = 116
00130 , ExpectedCommentOrCDATA = 117
00131 , ExpectedAttrName = 118
00132 , ExpectedNotationName = 119
00133 , NoRepInMixed = 120
00134 , BadDefAttrDecl = 121
00135 , ExpectedDefAttrDecl = 122
00136 , AttListSyntaxError = 123
00137 , ExpectedEqSign = 124
00138 , DupAttrName = 125
00139 , BadIdForXMLLangAttr = 126
00140 , ExpectedElementName = 127
00141 , MustStartWithXMLDecl = 128
00142 , CommentsMustStartWith = 129
00143 , InvalidDocumentStructure = 130
00144 , ExpectedDeclString = 131
00145 , BadXMLVersion = 132
00146 , UnsupportedXMLVersion = 133
00147 , UnterminatedXMLDecl = 134
00148 , BadXMLEncoding = 135
00149 , BadStandalone = 136
00150 , UnterminatedComment = 137
00151 , PINameExpected = 138
00152 , UnterminatedPI = 139
00153 , InvalidCharacter = 140
00154 , UnexpectedTextBeforeRoot = 141
00155 , UnterminatedStartTag = 142
00156 , ExpectedAttrValue = 143
00157 , UnterminatedEndTag = 144
00158 , ExpectedAttributeType = 145
00159 , ExpectedEndOfTagX = 146
00160 , ExpectedMarkup = 147
00161 , NotValidAfterContent = 148
00162 , ExpectedComment = 149
00163 , ExpectedCommentOrPI = 150
00164 , ExpectedWhitespace = 151
00165 , NoRootElemInDOCTYPE = 152
00166 , ExpectedQuotedString = 153
00167 , ExpectedPublicId = 154
00168 , InvalidPublicIdChar = 155
00169 , UnterminatedDOCTYPE = 156
00170 , InvalidCharacterInIntSubset = 157
00171 , ExpectedCDATA = 158
00172 , InvalidInitialNameChar = 159
00173 , InvalidNameChar = 160
00174 , UnexpectedWhitespace = 161
00175 , InvalidCharacterInAttrValue = 162
00176 , ExpectedMarkupDecl = 163
00177 , TextDeclNotLegalHere = 164
00178 , ConditionalSectInIntSubset = 165
00179 , ExpectedPEName = 166
00180 , UnterminatedEntityDecl = 167
00181 , InvalidCharacterRef = 168
00182 , UnterminatedCharRef = 169
00183 , ExpectedEntityRefName = 170
00184 , EntityNotFound = 171
00185 , NoUnparsedEntityRefs = 172
00186 , UnterminatedEntityRef = 173
00187 , RecursiveEntity = 174
00188 , PartialMarkupInEntity = 175
00189 , UnterminatedElementDecl = 176
00190 , ExpectedContentSpecExpr = 177
00191 , ExpectedAsterisk = 178
00192 , UnterminatedContentModel = 179
00193 , ExpectedSystemId = 180
00194 , ExpectedSystemOrPublicId = 181
00195 , UnterminatedNotationDecl = 182
00196 , ExpectedSeqChoiceLeaf = 183
00197 , ExpectedChoiceOrCloseParen = 184
00198 , ExpectedSeqOrCloseParen = 185
00199 , ExpectedEnumValue = 186
00200 , ExpectedEnumSepOrParen = 187
00201 , UnterminatedEntityLiteral = 188
00202 , MoreEndThanStartTags = 189
00203 , ExpectedOpenParen = 190
00204 , AttrAlreadyUsedInSTag = 191
00205 , BracketInAttrValue = 192
00206 , Expected2ndSurrogateChar = 193
00207 , ExpectedEndOfConditional = 194
00208 , ExpectedIncOrIgn = 195
00209 , ExpectedINCLUDEBracket = 196
00210 , ExpectedTextDecl = 197
00211 , ExpectedXMLDecl = 198
00212 , UnexpectedEOE = 199
00213 , PEPropogated = 200
00214 , ExtraCloseSquare = 201
00215 , PERefInMarkupInIntSubset = 202
00216 , EntityPropogated = 203
00217 , ExpectedNumericalCharRef = 204
00218 , ExpectedOpenSquareBracket = 205
00219 , BadSequenceInCharData = 206
00220 , IllegalSequenceInComment = 207
00221 , UnterminatedCDATASection = 208
00222 , ExpectedNDATA = 209
00223 , NDATANotValidForPE = 210
00224 , HexRadixMustBeLowerCase = 211
00225 , DeclStringRep = 212
00226 , DeclStringsInWrongOrder = 213
00227 , NoExtRefsInAttValue = 214
00228 , XMLDeclMustBeLowerCase = 215
00229 , ExpectedEntityValue = 216
00230 , BadDigitForRadix = 217
00231 , EndedWithTagsOnStack = 218
00232 , AmbiguousContentModel = 219
00233 , NestedCDATA = 220
00234 , UnknownPrefix = 221
00235 , PartialTagMarkupError = 222
00236 , EmptyMainEntity = 223
00237 , CDATAOutsideOfContent = 224
00238 , OnlyCharRefsAllowedHere = 225
00239 , Unexpected2ndSurrogateChar = 226
00240 , NoPIStartsWithXML = 227
00241 , XMLDeclMustBeFirst = 228
00242 , XMLVersionRequired = 229
00243 , StandaloneNotLegal = 230
00244 , EncodingRequired = 231
00245 , TooManyColonsInName = 232
00246 , InvalidColonPos = 233
00247 , ColonNotLegalWithNS = 234
00248 , SysException = 235
00249 , XMLException = 236
00250 , UnexpectedEOF = 237
00251 , UnexpectedError = 238
00252 , BadSchemaLocation = 239
00253 , NoGrammarResolver = 240
00254 , F_HighBounds = 241
00255 };
00256
00257 static bool isFatal(const XMLErrs::Codes toCheck)
00258 {
00259 return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
00260 }
00261
00262 static bool isWarning(const XMLErrs::Codes toCheck)
00263 {
00264 return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
00265 }
00266
00267 static bool isError(const XMLErrs::Codes toCheck)
00268 {
00269 return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
00270 }
00271
00272 static XMLErrorReporter::ErrTypes errorType(const XMLErrs::Codes toCheck)
00273 {
00274 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00275 return XMLErrorReporter::ErrType_Warning;
00276 else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
00277 return XMLErrorReporter::ErrType_Fatal;
00278 else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
00279 return XMLErrorReporter::ErrType_Error;
00280 return XMLErrorReporter::ErrTypes_Unknown;
00281 }
00282 };
00283 #endif
00284