Xerces-C++: XMLValidityCodes.hpp Source File

- Main Page
- Classes
- Files
- Related Pages

# XMLValidityCodes.hpp

Go to the documentation of this file.

    00001 // This file is generated, don't edit it!!
    00002
    00003 #if !defined(XERCESC_INCLUDE_GUARD_ERRHEADER_XMLValid)
    00004 #define XERCESC_INCLUDE_GUARD_ERRHEADER_XMLValid
    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 XMLValid
    00013 {
    00014 public :
    00015     enum Codes
    00016     {
    00017         NoError                            = 0
    00018       , E_LowBounds                        = 1
    00019       , ElementNotDefined                  = 2
    00020       , AttNotDefined                      = 3
    00021       , NotationNotDeclared                = 4
    00022       , RootElemNotLikeDocType             = 5
    00023       , RequiredAttrNotProvided            = 6
    00024       , ElementNotValidForContent          = 7
    00025       , BadIDAttrDefType                   = 8
    00026       , InvalidEmptyAttValue               = 9
    00027       , ElementAlreadyExists               = 10
    00028       , MultipleIdAttrs                    = 11
    00029       , ReusedIDValue                      = 12
    00030       , IDNotDeclared                      = 13
    00031       , UnknownNotRefAttr                  = 14
    00032       , UndeclaredElemInDocType            = 15
    00033       , EmptyNotValidForContent            = 16
    00034       , AttNotDefinedForElement            = 17
    00035       , BadEntityRefAttr                   = 18
    00036       , UnknownEntityRefAttr               = 19
    00037       , ColonNotValidWithNS                = 20
    00038       , NotEnoughElemsForCM                = 21
    00039       , NoCharDataInCM                     = 22
    00040       , DoesNotMatchEnumList               = 23
    00041       , AttrValNotName                     = 24
    00042       , NoMultipleValues                   = 25
    00043       , NotSameAsFixedValue                = 26
    00044       , RepElemInMixed                     = 27
    00045       , FeatureUnsupported                 = 28
    00046       , GroupContentRestricted             = 29
    00047       , UnknownBaseDatatype                = 30
    00048       , NoContentForRef                    = 31
    00049       , DatatypeError                      = 32
    00050       , ProhibitedAttributePresent         = 33
    00051       , IllegalXMLSpace                    = 34
    00052       , WrongTargetNamespace               = 35
    00053       , SimpleTypeHasChild                 = 36
    00054       , NoDatatypeValidatorForSimpleType   = 37
    00055       , GrammarNotFound                    = 38
    00056       , DisplayErrorMessage                = 39
    00057       , NillNotAllowed                     = 40
    00058       , NilAttrNotEmpty                    = 41
    00059       , FixedDifferentFromActual           = 42
    00060       , NoDatatypeValidatorForAttribute    = 43
    00061       , GenericError                       = 44
    00062       , ElementNotQualified                = 45
    00063       , ElementNotUnQualified              = 46
    00064       , VC_IllegalRefInStandalone          = 47
    00065       , NoDefAttForStandalone              = 48
    00066       , NoAttNormForStandalone             = 49
    00067       , NoWSForStandalone                  = 50
    00068       , VC_EntityNotFound                  = 51
    00069       , PartialMarkupInPE                  = 52
    00070       , DatatypeValidationFailure          = 53
    00071       , UniqueParticleAttributionFail      = 54
    00072       , NoAbstractInXsiType                = 55
    00073       , NoDirectUseAbstractElement         = 56
    00074       , NoUseAbstractType                  = 57
    00075       , BadXsiType                         = 58
    00076       , NonDerivedXsiType                  = 59
    00077       , NoSubforBlock                      = 60
    00078       , AttributeNotQualified              = 61
    00079       , AttributeNotUnQualified            = 62
    00080       , IC_FieldMultipleMatch              = 63
    00081       , IC_UnknownField                    = 64
    00082       , IC_AbsentKeyValue                  = 65
    00083       , IC_KeyNotEnoughValues              = 66
    00084       , IC_KeyMatchesNillable              = 67
    00085       , IC_DuplicateUnique                 = 68
    00086       , IC_DuplicateKey                    = 69
    00087       , IC_KeyRefOutOfScope                = 70
    00088       , IC_KeyNotFound                     = 71
    00089       , NonWSContent                       = 72
    00090       , EmptyElemNotationAttr              = 73
    00091       , EmptyElemHasContent                = 74
    00092       , ElemOneNotationAttr                = 75
    00093       , AttrDupToken                       = 76
    00094       , ElemChildrenHasInvalidWS           = 77
    00095       , E_HighBounds                       = 78
    00096       , W_LowBounds                        = 79
    00097       , W_HighBounds                       = 80
    00098       , F_LowBounds                        = 81
    00099       , F_HighBounds                       = 82
    00100     };
    00101
    00102     static bool isFatal(const XMLValid::Codes toCheck)
    00103     {
    00104         return ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds));
    00105     }
    00106
    00107     static bool isWarning(const XMLValid::Codes toCheck)
    00108     {
    00109         return ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds));
    00110     }
    00111
    00112     static bool isError(const XMLValid::Codes toCheck)
    00113     {
    00114         return ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds));
    00115     }
    00116
    00117     static XMLErrorReporter::ErrTypes errorType(const XMLValid::Codes toCheck)
    00118     {
    00119        if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
    00120            return XMLErrorReporter::ErrType_Warning;
    00121        else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
    00122             return XMLErrorReporter::ErrType_Fatal;
    00123        else if ((toCheck >= E_LowBounds) && (toCheck <= E_HighBounds))
    00124             return XMLErrorReporter::ErrType_Error;
    00125        return XMLErrorReporter::ErrTypes_Unknown;
    00126     }
    00127     static DOMError::ErrorSeverity  DOMErrorType(const XMLValid::Codes toCheck)
    00128     {
    00129        if ((toCheck >= W_LowBounds) && (toCheck <= W_HighBounds))
    00130            return DOMError::DOM_SEVERITY_WARNING;
    00131        else if ((toCheck >= F_LowBounds) && (toCheck <= F_HighBounds))
    00132             return DOMError::DOM_SEVERITY_FATAL_ERROR;
    00133        else return DOMError::DOM_SEVERITY_ERROR;
    00134     }
    00135
    00136 private:
    00137     // -----------------------------------------------------------------------
    00138     //  Unimplemented constructors and operators
    00139     // -----------------------------------------------------------------------
    00140     XMLValid();
    00141 };
    00142
    00143 XERCES_CPP_NAMESPACE_END
    00144
    00145 #endif
    00146