18 #ifndef VCSN_XML_HANDLERS_BASE_HH
19 # define VCSN_XML_HANDLERS_BASE_HH
34 # include <xercesc/sax2/SAX2XMLReader.hpp>
35 # include <xercesc/sax2/XMLReaderFactory.hpp>
36 # include <xercesc/sax2/DefaultHandler.hpp>
37 # include <xercesc/sax2/Attributes.hpp>
39 # include <xercesc/sax/SAXException.hpp>
40 # include <xercesc/util/XMLString.hpp>
43 # include <vaucanson/xml/strings.hh>
52 class ErrHandler :
public xercesc::DefaultHandler
55 ErrHandler () : DefaultHandler() {}
58 warning (
const xercesc::SAXParseException& exc);
61 error (
const xercesc::SAXParseException& exc);
64 fatalError (
const xercesc::SAXParseException& exc);
73 void token(
const XMLCh*
const localname);
74 void attrs(
const XMLCh*
const localname,
75 const std::string& name,
76 const std::string& value);
77 void missattrs(
const XMLCh*
const localname,
78 const std::string& name);
79 void notletter(
const std::string&);
84 class Handler :
public xercesc::DefaultHandler
87 Handler (xercesc::SAX2XMLReader* parser,
89 Handler (xercesc::SAX2XMLReader* parser,
90 xercesc::DefaultHandler& root,
94 startElement (
const XMLCh*
const uri,
95 const XMLCh*
const localname,
96 const XMLCh*
const qname,
97 const xercesc::Attributes& attrs);
99 endElement (
const XMLCh*
const uri,
100 const XMLCh*
const localname,
101 const XMLCh*
const qname);
104 start (
const XMLCh*
const uri,
105 const XMLCh*
const localname,
106 const XMLCh*
const qname,
107 const xercesc::Attributes& attrs) = 0;
109 end (
const XMLCh*
const uri,
110 const XMLCh*
const localname,
111 const XMLCh*
const qname) = 0;
113 XMLEq& eq() {
return eq_; };
119 xercesc::SAX2XMLReader* parser_;
120 xercesc::DefaultHandler& root_;
125 int Handler::indent_ = 0;
139 start (
const XMLCh*
const uri,
140 const XMLCh*
const localname,
141 const XMLCh*
const qname,
142 const xercesc::Attributes& attrs);
144 end (
const XMLCh*
const uri,
145 const XMLCh*
const localname,
146 const XMLCh*
const qname);
153 # if ! defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
155 # endif // !VCSN_USE_INTERFACE_ONLY || VCSN_USE_LIB
157 #endif // !VCSN_XML_HANDLERS_BASE_HH