Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Übersicht | Auflistung der Dateien | Elemente eines Namensbereiches | Datenstruktur-Elemente | Datei-Elemente

Sax2Parser.cpp

gehe zur Dokumentation dieser Datei
00001 // Copyright (C) 2004 Bernhard Assmann <bernie@tuxomania.net>
00002 //  
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //  
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //  
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 //  
00017 
00018 #include <xercesc/util/PlatformUtils.hpp>
00019 #include <xercesc/sax2/XMLReaderFactory.hpp>
00020 
00021 #include "psfa/Sax2Parser.hpp"
00022 
00023 
00024 xercesc::SAX2XMLReader* psfa::Sax2Parser::parser_ = 0;
00025 
00026 psfa::Sax2Parser::Sax2Parser()
00027 {
00028 
00029 }
00030 
00031 
00032 
00033 
00034 psfa::Sax2Parser::~Sax2Parser()
00035 {
00036   using xercesc::XMLPlatformUtils;
00037 
00038   delete parser_;
00039   XMLPlatformUtils::Terminate();
00040 }
00041 
00042 
00043 
00044 xercesc::SAX2XMLReader*
00045 psfa::Sax2Parser::getSax2Parser() 
00046 {
00047   using xercesc::XMLReaderFactory;
00048   using xercesc::XMLPlatformUtils;
00049   using xercesc::XMLString;
00050   using xercesc::XMLUni;
00051   
00052   if ( !parser_ ) {
00053     XMLPlatformUtils::Initialize();
00054     parser_ = XMLReaderFactory::createXMLReader();
00055     // Automatische Validierung aktivieren
00056     parser_->setFeature(XMLUni::fgSAX2CoreValidation, true);
00057     parser_->setFeature(XMLUni::fgXercesDynamic, true);
00058     return parser_;
00059   }
00060   return parser_;
00061 }

Erzeugt am Mon Jul 12 11:45:04 2004 für PSFA von doxygen 1.3.4