libSBML C++ API  5.20.4
XMLError.h File Reference

Represents errors (and messages) encountered during an XML parse. More...

Include dependency graph for XMLError.h:
This graph shows which files directly or indirectly include this file:

Classes

class  XMLError
 

Enumerations

enum  XMLErrorCategory_t {
  LIBSBML_CAT_INTERNAL = 0 ,
  LIBSBML_CAT_SYSTEM ,
  LIBSBML_CAT_XML
}
 Category codes for errors in the XML layer. More...
 
enum  XMLErrorCode_t {
  XMLUnknownError = 0 ,
  XMLOutOfMemory = 1 ,
  XMLFileUnreadable = 2 ,
  XMLFileUnwritable = 3 ,
  XMLFileOperationError = 4 ,
  XMLNetworkAccessError = 5 ,
  InternalXMLParserError = 101 ,
  UnrecognizedXMLParserCode = 102 ,
  XMLTranscoderError = 103 ,
  MissingXMLDecl = 1001 ,
  MissingXMLEncoding = 1002 ,
  BadXMLDecl = 1003 ,
  BadXMLDOCTYPE = 1004 ,
  InvalidCharInXML = 1005 ,
  BadlyFormedXML = 1006 ,
  UnclosedXMLToken = 1007 ,
  InvalidXMLConstruct = 1008 ,
  XMLTagMismatch = 1009 ,
  DuplicateXMLAttribute = 1010 ,
  UndefinedXMLEntity = 1011 ,
  BadProcessingInstruction = 1012 ,
  BadXMLPrefix = 1013 ,
  BadXMLPrefixValue = 1014 ,
  MissingXMLRequiredAttribute = 1015 ,
  XMLAttributeTypeMismatch = 1016 ,
  XMLBadUTF8Content = 1017 ,
  MissingXMLAttributeValue = 1018 ,
  BadXMLAttributeValue = 1019 ,
  BadXMLAttribute = 1020 ,
  UnrecognizedXMLElement = 1021 ,
  BadXMLComment = 1022 ,
  BadXMLDeclLocation = 1023 ,
  XMLUnexpectedEOF = 1024 ,
  BadXMLIDValue = 1025 ,
  BadXMLIDRef = 1026 ,
  UninterpretableXMLContent = 1027 ,
  BadXMLDocumentStructure = 1028 ,
  InvalidAfterXMLContent = 1029 ,
  XMLExpectedQuotedString = 1030 ,
  XMLEmptyValueNotPermitted = 1031 ,
  XMLBadNumber = 1032 ,
  XMLBadColon = 1033 ,
  MissingXMLElements = 1034 ,
  XMLContentEmpty = 1035 ,
  XMLErrorCodesUpperBound = 9999
}
 Canonical error codes returned for low-level XML parser errors. More...
 
enum  XMLErrorSeverity_t {
  LIBSBML_SEV_INFO = 0 ,
  LIBSBML_SEV_WARNING ,
  LIBSBML_SEV_ERROR ,
  LIBSBML_SEV_FATAL
}
 Severity codes for errors in the XML layer. More...
 
enum  XMLErrorSeverityOverride_t {
  LIBSBML_OVERRIDE_DISABLED = 0 ,
  LIBSBML_OVERRIDE_DONT_LOG ,
  LIBSBML_OVERRIDE_WARNING ,
  LIBSBML_OVERRIDE_ERROR
}
 Severity override codes for errors logged in the XML layer. More...
 

Detailed Description

Represents errors (and messages) encountered during an XML parse.

Author
Ben Bornstein
Michael Hucka

Enumeration Type Documentation

◆ XMLErrorCategory_t

Category codes for errors in the XML layer.

Enumerator
LIBSBML_CAT_INTERNAL 

A problem involving the libSBML software itself or the underlying XML parser. This almost certainly indicates a software defect (i.e., bug) in libSBML. Please report instances of this to the libSBML developers.

LIBSBML_CAT_SYSTEM 

A problem reported by the operating system, such as an inability to read or write a file. This indicates something that is not a program error but is outside of the control of libSBML.

LIBSBML_CAT_XML 

A problem in the XML content itself. This usually arises from malformed XML or the use of constructs not permitted in SBML.

◆ XMLErrorCode_t

Canonical error codes returned for low-level XML parser errors.

These are distinguished from other SBML error codes by having a number 4 digits long, less than 10000. The codes are an abstraction of errors from the multiple parsers (Xerces, Expat, libxml2) supported by libSBML.

Calling programs may wish to check which enumeration a given SBMLError object's error identifier is actually from:
  • 0010000 to 0099999: SBMLErrorCode_t (a problem with the SBML core specification)
  • 1000000 to 1099999: CompSBMLErrorCode_t (a problem with the SBML Level 3 Hierarchical Model Composition package specification).
  • 2000000 to 2099999: FbcSBMLErrorCode_t (a problem with the SBML Level 3 Flux Balance Constraints package specification).
  • 3000000 to 3099999: QualSBMLErrorCode_t (a problem with the SBML Level 3 Qualitative Models package specification).
  • 6000000 to 6099999: LayoutSBMLErrorCode_t (a problem with the SBML Level 3 Layout package specification).
Other error code ranges are reserved for other packages.
Enumerator
XMLUnknownError 

Unknown error encountered.

XMLOutOfMemory 

LibSBML unexpected encountered an out of memory condition from the operating system.

XMLFileUnreadable 

Could not open or read the file.

XMLFileUnwritable 

Could not write to the file.

XMLFileOperationError 

Error encountered while attempting a file operation.

XMLNetworkAccessError 

Error encountered while attempting a network access.

InternalXMLParserError 

Internal error in XML parser.

UnrecognizedXMLParserCode 

The XML parser returned an error code that is not recognized by libSBML.

XMLTranscoderError 

The character transcoder reported an error.

MissingXMLDecl 

Missing XML declaration at beginning of XML input.

MissingXMLEncoding 

Missing encoding attribute in XML declaration.

BadXMLDecl 

Invalid or unrecognized XML declaration or XML encoding.

BadXMLDOCTYPE 

Invalid, malformed or unrecognized XML DOCTYPE declaration.

InvalidCharInXML 

Invalid character in XML content.

BadlyFormedXML 

XML is not well-formed.

UnclosedXMLToken 

Unclosed token.

InvalidXMLConstruct 

XML construct is invalid or not permitted.

XMLTagMismatch 

Element tag mismatch or missing tag.

DuplicateXMLAttribute 

Duplicate attribute.

UndefinedXMLEntity 

Undefined XML entity.

BadProcessingInstruction 

Invalid, malformed or unrecognized XML processing instruction.

BadXMLPrefix 

Invalid or undefined XML Namespace prefix.

BadXMLPrefixValue 

Invalid XML Namespace prefix value.

MissingXMLRequiredAttribute 

Required attribute is missing.

XMLAttributeTypeMismatch 

Data type mismatch for attribute value.

XMLBadUTF8Content 

Invalid UTF8 content.

MissingXMLAttributeValue 

Missing or improperly formed attribute value.

BadXMLAttributeValue 

Invalid or unrecognizable attribute value.

BadXMLAttribute 

Invalid, unrecognized or malformed attribute.

UnrecognizedXMLElement 

Element either not recognized or not permitted.

BadXMLComment 

Badly formed XML comment.

BadXMLDeclLocation 

XML declaration not permitted in this location.

XMLUnexpectedEOF 

Reached end of input unexpectedly.

BadXMLIDValue 

Value is invalid for XML ID, or has already been used.

BadXMLIDRef 

XML ID value was never declared.

UninterpretableXMLContent 

Unable to interpret content.

BadXMLDocumentStructure 

Bad XML document structure.

InvalidAfterXMLContent 

Encountered invalid content after expected content.

XMLExpectedQuotedString 

Expected to find a quoted string.

XMLEmptyValueNotPermitted 

An empty value is not permitted in this context.

XMLBadNumber 

Invalid or unrecognized number.

XMLBadColon 

Colon characters are invalid in this context.

MissingXMLElements 

One or more expected elements are missing.

XMLContentEmpty 

Main XML content is empty.

XMLErrorCodesUpperBound 

◆ XMLErrorSeverity_t

Severity codes for errors in the XML layer.

These severity levels are based on those defined in the XML specification, with the addition of Info for informational messages.

Enumerator
LIBSBML_SEV_INFO 

The error is actually informational and not necessarily a serious problem.

LIBSBML_SEV_WARNING 

The error object represents a problem that is not serious enough to necessarily stop the problem, but applications should take note of the problem and evaluate what its implications may be.

LIBSBML_SEV_ERROR 

The error object represents a serious error. The application may continue running but it is unlikely to be able to continue processing the same XML file or data stream.

LIBSBML_SEV_FATAL 

A serious error occurred, such as an out-of-memory condition, and the software should terminate immediately.

◆ XMLErrorSeverityOverride_t

Severity override codes for errors logged in the XML layer.

XMLErrorLog can be configured to not log errors by specifying one of these enum values below.

Enumerator
LIBSBML_OVERRIDE_DISABLED 

All errors will be issued as specified in the error log.

LIBSBML_OVERRIDE_DONT_LOG 

All error logging is disabled.

LIBSBML_OVERRIDE_WARNING 

All errors will be logged as warnings

LIBSBML_OVERRIDE_ERROR 

All warnings will be logged as errors