ARB
sax2Handler.hxx
Go to the documentation of this file.
1 #include <xercesc/sax2/DefaultHandler.hpp>
2 #include <xercesc/framework/XMLFormatter.hpp>
3 
4 XERCES_GLIBCXX_NAMESPACE_USE
5 
6 class Sax2Handler : public DefaultHandler, private XMLFormatTarget {
7 private:
8  XMLFormatter fFormatter;
9  const char *outFileName;
10  ofstream &out;
11 
12 public:
13  char *buffer;
14  Sax2Handler(const char* const encodingName, const XMLFormatter::UnRepFlags unRepFlags, ofstream &outFile);
16 
17  // Implementations of the format target interface
18  // -----------------------------------------------------------------------
19  void writeChars(const XMLByte* const toWrite );
20 
21  void writeChars(const XMLByte* const toWrite, const unsigned int count,
22  XMLFormatter* const formatter);
23 
24 
25  // Implementations of the SAX DocumentHandler interface
26  //--------------------------------------------------------------------------------
27  void startDocument();
28  void endDocument();
29 
30  void startElement(const XMLCh* const uri, const XMLCh* const localname,
31  const XMLCh* const qname, const Attributes& attributes);
32  void endElement (const XMLCh* const uri, const XMLCh* const localname,
33  const XMLCh* const qname);
34 
35  void characters (const XMLCh* const chars, const unsigned int length);
36  void ignorableWhitespace (const XMLCh* const chars, const unsigned int length );
37  void processingInstruction (const XMLCh* const target, const XMLCh* const data );
38 
39  // Implementations of the SAX ErrorHandler interface
40  //--------------------------------------------------------------------------------
41  void warning (const SAXParseException& exception);
42  void error (const SAXParseException& exception);
43  void fatalError (const SAXParseException& exception);
44 };
void endDocument()
Definition: sax2Handler.cxx:49
void characters(const XMLCh *const chars, const unsigned int length)
void ignorableWhitespace(const XMLCh *const chars, const unsigned int length)
void writeChars(const XMLByte *const toWrite)
Definition: sax2Handler.cxx:37
int chars
Definition: seq_search.cxx:38
void processingInstruction(const XMLCh *const target, const XMLCh *const data)
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
Definition: sax2Handler.cxx:90
char * buffer
Definition: sax2Handler.hxx:13
Sax2Handler(const char *const encodingName, const XMLFormatter::UnRepFlags unRepFlags, ofstream &outFile)
Definition: sax2Handler.cxx:28
void error(const SAXParseException &exception)
#define OVERRIDE
Definition: cxxforward.h:93
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attributes)
Definition: sax2Handler.cxx:54
~Sax2Handler() OVERRIDE
Definition: sax2Handler.cxx:33
void fatalError(const SAXParseException &exception)
void startDocument()
Definition: sax2Handler.cxx:47
size_t length
void warning(const SAXParseException &exception)