1 //=============================================================================
3 * @file Print_Handler.h
5 * @author Nanbor Wang <nanbor@cs.wustl.edu>
7 //=============================================================================
9 #ifndef ACEXML_PRINT_HANDLER_H
10 #define ACEXML_PRINT_HANDLER_H
12 #include "ACEXML/common/DefaultHandler.h"
15 * @class ACEXML_Print_Handler
17 * @brief ACEXML_Print_Handler is an example SAX event handler.
19 * This SAX event handler prints out a detailed event report
20 * on every event it receives.
22 class ACEXML_Print_Handler
: public ACEXML_DefaultHandler
26 * Default constructor.
28 ACEXML_Print_Handler (ACEXML_Char
* fileName
);
33 virtual ~ACEXML_Print_Handler ();
35 // Methods inherited from ACEXML_ContentHandler.
38 * Receive notification of character data.
40 virtual void characters (const ACEXML_Char
*ch
,
45 * Receive notification of the end of a document.
47 virtual void endDocument ();
50 * Receive notification of the end of an element.
52 virtual void endElement (const ACEXML_Char
*namespaceURI
,
53 const ACEXML_Char
*localName
,
54 const ACEXML_Char
*qName
);
57 * End the scope of a prefix-URI mapping.
59 virtual void endPrefixMapping (const ACEXML_Char
*prefix
);
62 * Receive notification of ignorable whitespace in element content.
64 virtual void ignorableWhitespace (const ACEXML_Char
*ch
,
69 * Receive notification of a processing instruction.
71 virtual void processingInstruction (const ACEXML_Char
*target
,
72 const ACEXML_Char
*data
);
75 * Receive an object for locating the origin of SAX document events.
77 virtual void setDocumentLocator (ACEXML_Locator
*locator
) ;
80 * Receive notification of a skipped entity.
82 virtual void skippedEntity (const ACEXML_Char
*name
);
85 * Receive notification of the beginning of a document.
87 virtual void startDocument ();
90 * Receive notification of the beginning of an element.
92 virtual void startElement (const ACEXML_Char
*namespaceURI
,
93 const ACEXML_Char
*localName
,
94 const ACEXML_Char
*qName
,
95 ACEXML_Attributes
*atts
);
98 * Begin the scope of a prefix-URI Namespace mapping.
100 virtual void startPrefixMapping (const ACEXML_Char
*prefix
,
101 const ACEXML_Char
*uri
);
103 // *** Methods inherit from ACEXML_DTDHandler.
106 * Receive notification of a notation declaration event.
108 virtual void notationDecl (const ACEXML_Char
*name
,
109 const ACEXML_Char
*publicId
,
110 const ACEXML_Char
*systemId
);
113 * Receive notification of an unparsed entity declaration event.
115 virtual void unparsedEntityDecl (const ACEXML_Char
*name
,
116 const ACEXML_Char
*publicId
,
117 const ACEXML_Char
*systemId
,
118 const ACEXML_Char
*notationName
);
120 // Methods inherit from ACEXML_EnitityResolver.
123 * Allow the application to resolve external entities.
125 virtual ACEXML_InputSource
*resolveEntity (const ACEXML_Char
*publicId
,
126 const ACEXML_Char
*systemId
);
128 // Methods inherit from ACEXML_ErrorHandler.
131 * Receive notification of a recoverable error.
133 virtual void error (ACEXML_SAXParseException
&exception
);
136 * Receive notification of a non-recoverable error.
138 virtual void fatalError (ACEXML_SAXParseException
&exception
);
141 * Receive notification of a warning.
143 virtual void warning (ACEXML_SAXParseException
&exception
);
145 ACEXML_Char
* fileName_
;
146 ACEXML_Locator
* locator_
;
149 #endif /* ACEXML_PRINT_HANDLER_H */