3 //=============================================================================
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
10 #ifndef _ACEXML_VALIDATOR_H_
11 #define _ACEXML_VALIDATOR_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/Attributes.h"
21 #include "ACEXML/common/SAXExceptions.h"
24 * @class ACEXML_Validator
26 * @brief An abstract virtual class defining validator interface.
28 * An validator provides validation service for one XML element.
29 * ACEXML_Validators are stateful object. Implementations should
30 * remember the current element encountered and determine if
31 * it's a valid sequence of child elements. A parser fishes
32 * out a validator of certain
34 class ACEXML_Export ACEXML_Validator
37 virtual ~ACEXML_Validator () = 0;
40 * Validate attributes of an element.
42 * @retval 0 if valid, -1 otherwise.
44 virtual int startElement (ACEXML_Attributes
*atts
) = 0;
47 * Validate the next child element.
49 * @retval 0 if valid, -1 otherwise.
51 virtual int nextElement (const ACEXML_Char
*namespaceURI
,
52 const ACEXML_Char
*localName
,
53 const ACEXML_Char
*qName
) = 0;
57 #include /**/ "ace/post.h"
59 #endif /* _ACEXML_VALIDATOR_H_ */