36#include <libxml/parser.h>
44 struct InitAndCleanupTheXMLParserOnlyOnceCommaEver {
45 InitAndCleanupTheXMLParserOnlyOnceCommaEver() {
59 : fContext(nullptr), fValidate(
kTRUE), fReplaceEntities(
kFALSE), fStopError(
kFALSE), fParseCode(0)
125 return "Attempt to parse a second file while a parse is in progress";
128 return "Parse context is not created";
131 return "An error occurred while parsing file";
134 return "A fatal error occurred while parsing file";
137 return "Document is not well-formed";
140 return "Document is not valid";
143 return "Parse code does not exist";
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
TString fValidateWarning
Parse warning.
virtual void InitializeContext()
Initialize parser parameters, such as, disactivate non-standards libxml1 features,...
TXMLParser()
Initializes parser variables.
virtual void SetParseCode(Int_t code)
Set the parse code:
_xmlParserCtxt * fContext
Parse the xml file.
Int_t fParseCode
To keep track of the errorcodes.
void SetValidate(Bool_t val=kTRUE)
The parser will validate the xml file if val = true.
TString fValidateError
Parse error.
void SetReplaceEntities(Bool_t val=kTRUE)
The parser will replace/expand entities.
virtual void ReleaseUnderlying()
To release any existing document.
Bool_t fValidate
To validate the parse context.
const char * GetParseCodeMessage(Int_t parseCode) const
Returns the parse code message.
virtual void OnValidateWarning(const TString &message)
This function is called when a warning from the parser has occurred.
void SetStopOnError(Bool_t stop=kTRUE)
Set parser stops in case of error:
Bool_t fReplaceEntities
Replace entities.
virtual void StopParser()
Stops parsing.
virtual void OnValidateError(const TString &message)
This function is called when an error from the parser has occurred.
Bool_t fStopError
Stop when parse error occurs.
~TXMLParser() override
Cleanup.