#include <DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler.h>
Public Member Functions | |
DDLSAX2ExpressionHandler () | |
void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs) |
~DDLSAX2ExpressionHandler () | |
Private Attributes | |
std::string | pElementName |
DDLSAX2ExpressionHandler.h - description ------------------- begin: Mon Feb 25, 2002 email: case@ucdhep.ucdavis.edu
This processes only ConstantsSection/Parameter elements so there is no need to make it as elaborate as the second pass parser.
Definition at line 26 of file DDLSAX2ExpressionHandler.h.
DDLSAX2ExpressionHandler::DDLSAX2ExpressionHandler | ( | ) |
DDLSAX2ExpressionHandler::~DDLSAX2ExpressionHandler | ( | ) |
void DDLSAX2ExpressionHandler::endElement | ( | const XMLCh *const | uri, | |
const XMLCh *const | localname, | |||
const XMLCh *const | qname | |||
) | [virtual] |
void DDLSAX2ExpressionHandler::startElement | ( | const XMLCh *const | uri, | |
const XMLCh *const | localname, | |||
const XMLCh *const | qname, | |||
const Attributes & | attrs | |||
) |
Reimplemented from DDLSAX2FileHandler.
Definition at line 53 of file DDLSAX2ExpressionHandler.cc.
References DDLSAX2Handler::attrCount_, DCOUT_V, DDLSAX2Handler::elementCount_, DDLSAX2FileHandler::elementTypeCounter_, DDLSAX2FileHandler::extractFileName(), DDLParser::getCurrFileName(), DDLSAX2Handler::getnmspace(), i, DDLParser::instance(), DDI::Singleton< I >::instance(), pElementName, and ExprEvalInterface::set().
00057 { 00058 // static seal::SealTimer tdseh("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler::startElement(..)", false); 00059 00060 ++elementCount_; 00061 attrCount_ += attrs.getLength(); 00062 00063 pElementName = StrX(qname).localForm(); 00064 00065 if (pElementName == "Constant") 00066 { 00067 ++elementTypeCounter_[pElementName]; 00068 DCOUT_V('P', std::string("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler: start ") + pElementName); 00069 unsigned int numAtts = attrs.getLength(); 00070 std::string varName, varValue; 00071 for (unsigned int i = 0; i < numAtts; ++i) 00072 { 00073 std::string myattname(StrX(attrs.getLocalName(i)).localForm()); 00074 std::string myvalue(StrX(attrs.getValue(i)).localForm()); 00075 00076 std::string myQName(StrX(attrs.getQName(i)).localForm()); 00077 DCOUT_V('P', std::string("DetectorDescription/Parser/interface/DDLSAX2ExpressionHandler: ") + "getLocalName = " + myattname + " getValue = " + myvalue + " getQName = " + myQName); 00078 00079 // attributes unit and quantity are not used right now. 00080 if (myattname == "name") 00081 varName = myvalue; 00082 else if (myattname == "value") 00083 varValue = myvalue; 00084 } 00085 DDLParser* beingParsed = DDLParser::instance(); 00086 std::string nmspace = getnmspace(extractFileName( beingParsed->getCurrFileName())); 00087 ExprEvalInterface & ev = ExprEvalSingleton::instance(); 00088 ev.set(nmspace, varName, varValue); 00089 } 00090 }
std::string DDLSAX2ExpressionHandler::pElementName [private] |