3 //=============================================================================
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
10 #ifndef _ACEXML_XMLREADER_H_
11 #define _ACEXML_XMLREADER_H_
13 #include /**/ "ace/pre.h"
14 #include "ACEXML/common/ACEXML_Export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ACEXML/common/ContentHandler.h"
21 #include "ACEXML/common/DTDHandler.h"
22 #include "ACEXML/common/EntityResolver.h"
23 #include "ACEXML/common/ErrorHandler.h"
26 * @class ACEXML_XMLReader
28 * @brief ACEXML_XMLReader
30 * XMLReader is the interface that an XML parser's SAX2 driver must
31 * implement. This interface allows an application to set and query
32 * features and properties in the parser, to register event handlers
33 * for document processing, and to initiate a document parse.
35 * All SAX interfaces are assumed to be synchronous: the parse methods
36 * must not return until parsing is complete, and readers must wait
37 * for an event-handler callback to return before reporting the next
40 class ACEXML_Export ACEXML_XMLReader
43 virtual ~ACEXML_XMLReader ();
46 * Return the current content handler.
48 virtual ACEXML_ContentHandler
*getContentHandler () const = 0;
51 * Return the current DTD handler.
53 virtual ACEXML_DTDHandler
*getDTDHandler () const = 0;
56 * Return the current entity resolver.
58 virtual ACEXML_EntityResolver
*getEntityResolver () const = 0;
61 * Return the current error handler.
63 virtual ACEXML_ErrorHandler
*getErrorHandler () const = 0;
66 * Look up the value of a feature. This method allows
67 * programmers to check whether a specific feature has been
68 * activated in the parser.
70 virtual int getFeature (const ACEXML_Char
*name
) = 0;
73 * Look up the value of a property.
75 virtual void * getProperty (const ACEXML_Char
*name
) = 0;
78 * Parse an XML document.
80 virtual void parse (ACEXML_InputSource
*input
) = 0;
83 * Parse an XML document from a system identifier (URI).
85 virtual void parse (const ACEXML_Char
*systemId
) = 0;
88 * Allow an application to register a content event handler.
90 virtual void setContentHandler (ACEXML_ContentHandler
*handler
) = 0;
93 * Allow an application to register a DTD event handler.
95 virtual void setDTDHandler (ACEXML_DTDHandler
*handler
) = 0;
98 * Allow an application to register an entity resolver.
100 virtual void setEntityResolver (ACEXML_EntityResolver
*resolver
) = 0;
103 * Allow an application to register an error event handler.
105 virtual void setErrorHandler (ACEXML_ErrorHandler
*handler
) = 0;
108 * Activating or deactivating a feature.
110 virtual void setFeature (const ACEXML_Char
*name
, int boolean_value
) = 0;
113 * Set the value of a property.
115 virtual void setProperty (const ACEXML_Char
*name
, void *value
) = 0;
119 #include /**/ "ace/post.h"
121 #endif /* _ACEXML_XMLREADER_H_ */