library: libXMLParser #include "TXMLParser.h"

# TXMLParser

class description - source file - inheritance tree (.pdf)

## class TXMLParser : public TObject, public TQObject

| Inheritance Chart:

`TObject`

`TQObject`

<-

`TXMLParser`

<-

`TDOMParser` |

`TSAXParser` |

This is an abstract class, constructors will not be documented.
Look at the header to check for available constructors.

        protected:

          virtual void InitializeContext()
          virtual void OnValidateError(const TString& message)
          virtual void OnValidateWarning(const TString& message)
          virtual void ReleaseUnderlying()
          virtual void SetParseCode(Int_t code)
          virtual void StopParser()

        public:

                  virtual ~TXMLParser()
           static TClass* Class()
                    Int_t GetParseCode() const
              const char* GetParseCodeMessage(Int_t parseCode) const
                   Bool_t GetStopOnError() const
           virtual Bool_t GetValidate() const
              const char* GetValidateError() const
              const char* GetValidateWarning() const
          virtual TClass* IsA() const
              TXMLParser& operator=(const TXMLParser&)
            virtual Int_t ParseBuffer(const char* contents, Int_t len)
            virtual Int_t ParseFile(const char* filename)
                     void SetStopOnError(Bool_t stop = kTRUE)
             virtual void SetValidate(Bool_t val = kTRUE)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

          _xmlParserCtxt* fContext          parse the xml file
                   Bool_t fValidate         to validate the parse context
                   Bool_t fStopError        stop when parse error occurs
                  TString fValidateError    parse error
                  TString fValidateWarning  parse warning
                    Int_t fParseCode        to keep track of the errorcodes

## Class Description

     TXMLParser

     TXMLParser is an abstract class which interfaces with Libxml2.
     Libxml2 is the XML C parser and toolkit developed for the Gnome
     project.

     The libxml library provides two interfaces to the parser, a DOM
     style tree interface and a SAX style event based interface.

     TXMLParser is parent class of TSAXParser, which is a SAX interface
     of libxml.

~TXMLParser()

     Cleanup.

void SetValidate(Bool_t val)

     The parser will validate the xml file if val = true.

void ReleaseUnderlying()

     To release any existing document.

void OnValidateError(const TString& message)

     This function is called when an error from the parser has occured.
     Message is the parse error.

void OnValidateWarning(const TString& message)

     This fucntion is called when a warning from the parser has occured.
     Message is the parse error.

const char* GetParseCodeMessage(Int_t parseCode) const

     Returns the parse code message.

void InitializeContext()

     Initialize parser parameters, such as, disactivate non-standards libxml1
     features, on/off validation, clear error and warning messages.

void StopParser()

     Stops parsing.

void SetParseCode(Int_t errorcode)

     Set the parse code:
      0: Parse succesfull
     -1: Attempt to parse a second file while a parse is in progress
     -2: Parse context is not created
     -3: An error occured while parsing file
     -4: A fatal error occured while parsing file
     -5: Document is not well-formed

void SetStopOnError(Bool_t stop)

     Set parser stops in case of error:
     stop = true, stops on error
     stop = false, continue parsing on error...

### Inline Functions

                 Bool_t GetValidate() const
                  Int_t ParseFile(const char* filename)
                  Int_t ParseBuffer(const char* contents, Int_t len)
                  Int_t GetParseCode() const
                 Bool_t GetStopOnError() const
            const char* GetValidateError() const
            const char* GetValidateWarning() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
            TXMLParser& operator=(const TXMLParser&)

Author: Jose Lo 12/1/2005
Last update: root/xmlparser:$Name: $:$Id: TXMLParser.cxx,v 1.2 2005/05/11 13:19:50 rdm Exp $
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *