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 , ExpectedCommentOrCDATA = 9
00023 , ExpectedAttrName = 10
00024 , ExpectedNotationName = 11
00025 , NoRepInMixed = 12
00026 , BadDefAttrDecl = 13
00027 , ExpectedDefAttrDecl = 14
00028 , AttListSyntaxError = 15
00029 , ExpectedEqSign = 16
00030 , DupAttrName = 17
00031 , BadIdForXMLLangAttr = 18
00032 , ExpectedElementName = 19
00033 , MustStartWithXMLDecl = 20
00034 , CommentsMustStartWith = 21
00035 , InvalidDocumentStructure = 22
00036 , ExpectedDeclString = 23
00037 , BadXMLVersion = 24
00038 , UnsupportedXMLVersion = 25
00039 , UnterminatedXMLDecl = 26
00040 , BadXMLEncoding = 27
00041 , BadStandalone = 28
00042 , UnterminatedComment = 29
00043 , PINameExpected = 30
00044 , UnterminatedPI = 31
00045 , InvalidCharacter = 32
00046 , UnexpectedTextBeforeRoot = 33
00047 , UnterminatedStartTag = 34
00048 , ExpectedAttrValue = 35
00049 , UnterminatedEndTag = 36
00050 , ExpectedAttributeType = 37
00051 , ExpectedEndOfTagX = 38
00052 , ExpectedMarkup = 39
00053 , NotValidAfterContent = 40
00054 , ExpectedComment = 41
00055 , ExpectedCommentOrPI = 42
00056 , ExpectedWhitespace = 43
00057 , NoRootElemInDOCTYPE = 44
00058 , ExpectedQuotedString = 45
00059 , ExpectedPublicId = 46
00060 , InvalidPublicIdChar = 47
00061 , UnterminatedDOCTYPE = 48
00062 , InvalidCharacterInIntSubset = 49
00063 , ExpectedCDATA = 50
00064 , InvalidInitialNameChar = 51
00065 , InvalidNameChar = 52
00066 , UnexpectedWhitespace = 53
00067 , InvalidCharacterInAttrValue = 54
00068 , ExpectedMarkupDecl = 55
00069 , TextDeclNotLegalHere = 56
00070 , ConditionalSectInIntSubset = 57
00071 , ExpectedPEName = 58
00072 , UnterminatedEntityDecl = 59
00073 , InvalidCharacterRef = 60
00074 , UnterminatedCharRef = 61
00075 , ExpectedEntityRefName = 62
00076 , EntityNotFound = 63
00077 , NoUnparsedEntityRefs = 64
00078 , UnterminatedEntityRef = 65
00079 , RecursiveEntity = 66
00080 , PartialMarkupInEntity = 67
00081 , UnterminatedElementDecl = 68
00082 , ExpectedContentSpecExpr = 69
00083 , ExpectedAsterisk = 70
00084 , UnterminatedContentModel = 71
00085 , ExpectedSystemId = 72
00086 , ExpectedSystemOrPublicId = 73
00087 , UnterminatedNotationDecl = 74
00088 , ExpectedSeqChoiceLeaf = 75
00089 , ExpectedChoiceOrCloseParen = 76
00090 , ExpectedSeqOrCloseParen = 77
00091 , ExpectedEnumValue = 78
00092 , ExpectedEnumSepOrParen = 79
00093 , UnterminatedEntityLiteral = 80
00094 , MoreEndThanStartTags = 81
00095 , IllegalRefInStandalone = 82
00096 , ExpectedOpenParen = 83
00097 , AttrAlreadyUsedInSTag = 84
00098 , BracketInAttrValue = 85
00099 , Expected2ndSurrogateChar = 86
00100 , ExpectedEndOfConditional = 87
00101 , ExpectedIncOrIgn = 88
00102 , ExpectedINCLUDEBracket = 89
00103 , ExpectedTextDecl = 90
00104 , ExpectedXMLDecl = 91
00105 , UnexpectedEOE = 92
00106 , PEPropogated = 93
00107 , ExtraCloseSquare = 94
00108 , PERefInMarkupInIntSubset = 95
00109 , EntityPropogated = 96
00110 , ExpectedNumericalCharRef = 97
00111 , ExpectedOpenSquareBracket = 98
00112 , BadSequenceInCharData = 99
00113 , IllegalSequenceInComment = 100
00114 , UnterminatedCDATASection = 101
00115 , ExpectedNDATA = 102
00116 , NDATANotValidForPE = 103
00117 , HexRadixMustBeLowerCase = 104
00118 , DeclStringRep = 105
00119 , DeclStringsInWrongOrder = 106
00120 , NoExtRefsInAttValue = 107
00121 , XMLDeclMustBeLowerCase = 108
00122 , ExpectedEntityValue = 109
00123 , BadDigitForRadix = 110
00124 , EndedWithTagsOnStack = 111
00125 , AmbiguousContentModel = 112
00126 , NestedCDATA = 113
00127 , UnknownPrefix = 114
00128 , PartialTagMarkupError = 115
00129 , EmptyMainEntity = 116
00130 , CDATAOutsideOfContent = 117
00131 , OnlyCharRefsAllowedHere = 118
00132 , Unexpected2ndSurrogateChar = 119
00133 , NoPIStartsWithXML = 120
00134 , XMLDeclMustBeFirst = 121
00135 , XMLVersionRequired = 122
00136 , StandaloneNotLegal = 123
00137 , TooManyColonsInName = 124
00138 , InvalidColonPos = 125
00139 , ColonNotLegalWithNS = 126
00140 , SysException = 127
00141 , XMLException = 128
00142 , UnexpectedEOF = 129
00143 , E_HighBounds = 130
00144 , V_LowBounds = 131
00145 , V_HighBounds = 132
00146 };
00147
00148 static bool isFatal(const XMLErrs::Codes toCheck)
00149 {
00150 return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
00151 }
00152
00153 static bool isWarning(const XMLErrs::Codes toCheck)
00154 {
00155 return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
00156 }
00157
00158 static bool isValid(const XMLErrs::Codes toCheck)
00159 {
00160 return ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds));
00161 }
00162
00163 static XMLErrorReporter::ErrTypes errorType(const XMLErrs::Codes toCheck)
00164 {
00165 if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
00166 return XMLErrorReporter::ErrType_Warning;
00167 else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
00168 return XMLErrorReporter::ErrType_Fatal;
00169 else if ((toCheck >= V_LowBounds) && (toCheck <= V_HighBounds))
00170 return XMLErrorReporter::ErrType_Invalid;
00171 return XMLErrorReporter::ErrTypes_Unknown;
00172 }
00173 };
00174 #endif
00175