00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef VCSN_XML_PARSERS_HH
00019 # define VCSN_XML_PARSERS_HH
00020 
00031 # include <iostream>
00032 
00033 # include <xercesc/sax2/SAX2XMLReader.hpp>
00034 
00035 # include <vaucanson/xml/handlers.hh>
00036 # include <vaucanson/xml/xmleq.hh>
00037 
00038 namespace vcsn
00039 {
00040   namespace xml
00041   {
00042     
00043 
00044 
00045     class Parser
00046     {
00047       public:
00048         Parser (bool check = true);
00049         virtual ~Parser ();
00050 
00051       protected:
00052         std::string
00053         get_xsd_path ();
00054 
00055         ErrHandler*                     err_handler_;
00057         xercesc::SAX2XMLReader*         parser_;
00059         XMLEq                           eq_;
00060     };
00061 
00062     
00063 
00064 
00065     template <typename Auto>
00066     class AutParser : public Parser
00067     {
00068       public:
00069         AutParser (Auto& a, bool check = true);
00070         virtual ~AutParser ();
00071 
00072         void
00073         parse (std::istream& in);
00074 
00075       protected:
00076         DocHandler<Auto>*       doc_handler_;
00077         Auto&                   a_;
00078     };
00079 
00080     
00081   } 
00082 } 
00083 
00084 # if !defined VCSN_USE_INTERFACE_ONLY || defined VCSN_USE_LIB
00085 # include <vaucanson/xml/parsers.hxx>
00086 # endif // VCSN_USE_INTERFACE_ONLY
00087 
00088 #endif // !VCSN_XML_PARSERS_HH