CMS 3D CMS Logo

DQMParserBase.cc

Go to the documentation of this file.
00001 #include "DQMServices/ClientConfig/interface/DQMParserBase.h"
00002 #include "DQMServices/ClientConfig/interface/ParserFunctions.h"
00003 
00004 #include <stdexcept>         
00015 using namespace xercesc;
00016 
00017 DQMParserBase::DQMParserBase(){
00018         parser=0; 
00019         doc=0; 
00020 }
00021 
00022 DQMParserBase::~DQMParserBase(){
00023         delete parser;
00024         parser=0; 
00025 }
00026 
00027 
00028 void DQMParserBase::getDocument(std::string configFile){
00029         
00030         parser = new XercesDOMParser;     
00031         parser->setValidationScheme(XercesDOMParser::Val_Auto);
00032         parser->setDoNamespaces(false);
00033         parser->parse(configFile.c_str()); 
00034         doc = parser->getDocument();
00035         assert(doc);
00036 
00037 }
00038 
00039 void DQMParserBase::getNewDocument(std::string configFile){
00040         //delete doc;
00041         //doc =0;
00042         parser->resetDocumentPool();
00043         parser->parse(configFile.c_str()); 
00044         doc = parser->getDocument();
00045         assert(doc);
00046 
00047 }
00048 int DQMParserBase::countNodes(std::string tagName){
00049         unsigned int tagsNum  = 
00050            doc->getElementsByTagName(qtxml::_toDOMS(tagName))->getLength();
00051         return tagsNum;
00052 }

Generated on Tue Jun 9 17:34:10 2009 for CMSSW by  doxygen 1.5.4