26 void OnStartDocument() { }
28 void OnStartElement(
const char*,
const TList*);
29 void OnEndElement(
const char*);
30 void OnCharacters(
const char*);
31 void OnComment(
const char*);
32 void OnWarning(
const char*);
33 void OnError(
const char*);
34 void OnFatalError(
const char*);
35 void OnCdataBlock(
const char*,
Int_t);
38 void SaxHandler::OnEndDocument()
43 void SaxHandler::OnStartElement(
const char *name,
const TList *attributes)
57 void SaxHandler::OnEndElement(
const char *name)
59 cout <<
"</" << name <<
">";
62 void SaxHandler::OnCharacters(
const char *characters)
67 void SaxHandler::OnComment(
const char *
text)
69 cout <<
"<!--" << text <<
"-->";
72 void SaxHandler::OnWarning(
const char *
text)
74 cout <<
"Warning: " << text << endl;
77 void SaxHandler::OnError(
const char *
text)
79 cerr <<
"Error: " << text << endl ;
82 void SaxHandler::OnFatalError(
const char *
text)
84 cerr <<
"FatalError: " << text << endl ;
87 void SaxHandler::OnCdataBlock(
const char *
text,
Int_t len)
89 cout <<
"OnCdataBlock() " <<
text;
97 SaxHandler *saxHandler =
new SaxHandler();
101 saxParser->
ParseFile(dir+
"/saxexample.xml");
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
TSAXParser is a subclass of TXMLParser, it is a wraper class to libxml library.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
R__EXTERN TSystem * gSystem
TXMLAttribute is the attribute of an Element.
const char * GetValue() const
virtual void ConnectToHandler(const char *handlerName, void *handler)
A default TSAXParser to a user-defined Handler connection function.
const char * GetName() const
Returns name of object.
virtual Int_t ParseFile(const char *filename)
It creates the parse context of the xml file, where the xml file name is filename.