CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
XMLProcessor Class Reference

#include <CalibCalorimetry/HcalTPGAlgos/interface/XMLProcessor.h>

Classes

struct  _checksumsDBConfig
 
struct  _DBConfig
 
struct  _LMapRowHBEF
 
struct  _LMapRowHO
 
struct  _loaderBaseConfig
 
struct  _lutDBConfig
 

Public Types

typedef XMLProcessor::_checksumsDBConfig checksumsDBConfig
 
typedef struct XMLProcessor::_DBConfig DBConfig
 
typedef struct XMLProcessor::_LMapRowHBEF LMapRowHBEF
 
typedef struct XMLProcessor::_LMapRowHO LMapRowHO
 
typedef struct XMLProcessor::_loaderBaseConfig loaderBaseConfig
 
typedef XMLProcessor::_lutDBConfig lutDBConfig
 

Public Member Functions

int addLMapHBEFDataset (XMLDOMBlock *doc, LMapRowHBEF *row, std::string templateFileName)
 
int addLMapHODataset (XMLDOMBlock *doc, LMapRowHO *row, std::string templateFileName)
 
XMLDOMBlockcreateLMapHBEFXMLBase (std::string templateFileName)
 
XMLDOMBlockcreateLMapHOXMLBase (std::string templateFileName)
 
int init (void)
 
XMLCh * serializeDOM (XERCES_CPP_NAMESPACE::DOMNode *node, std::string target="stdout")
 
int terminate (void)
 
int test (void)
 
int write (XMLDOMBlock *doc, std::string target="stdout")
 
 XMLProcessor (const XMLProcessor &)=delete
 
virtual ~XMLProcessor ()
 

Static Public Member Functions

static XMLCh * _toXMLCh (std::string temp)
 
static XMLCh * _toXMLCh (int temp)
 
static XMLCh * _toXMLCh (double temp)
 
static XMLCh * _toXMLCh (time_t temp)
 
static XMLProcessorgetInstance ()
 

Private Member Functions

 XMLProcessor ()
 

Static Private Attributes

static XMLProcessorinstance = nullptr
 

Detailed Description

Description: Testing Xerces library for processing HCAL DB XML wrappers

Usage: <usage>

Definition at line 40 of file XMLProcessor.h.

Member Typedef Documentation

◆ checksumsDBConfig

◆ DBConfig

◆ LMapRowHBEF

◆ LMapRowHO

◆ loaderBaseConfig

◆ lutDBConfig

Constructor & Destructor Documentation

◆ XMLProcessor() [1/2]

XMLProcessor::XMLProcessor ( const XMLProcessor )
delete

◆ ~XMLProcessor()

XMLProcessor::~XMLProcessor ( )
virtual

Definition at line 49 of file XMLProcessor.cc.

49  {
50  // terminates Xerces
51  terminate();
52 }
int terminate(void)

◆ XMLProcessor() [2/2]

XMLProcessor::XMLProcessor ( )
private

Definition at line 44 of file XMLProcessor.cc.

References init.

Referenced by getInstance().

44  {
45  // initializes Xerces, must be done only once
46  init();
47 }
int init(void)

Member Function Documentation

◆ _toXMLCh() [1/4]

XMLCh * XMLProcessor::_toXMLCh ( std::string  temp)
inlinestatic

Definition at line 172 of file XMLProcessor.h.

References make_classfiles::buff, and groupFilesInBlocks::temp.

Referenced by LutXml::add_checksum(), LutXml::addData(), LutXml::addLut(), LutXml::addParameter(), LutXml::create_lut_map(), XMLDOMBlock::getTagAttribute(), XMLDOMBlock::init(), and XMLDOMBlock::setTagAttribute().

172  {
173  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode(temp.c_str());
174  return buff;
175 }
buff
***.cc ################

◆ _toXMLCh() [2/4]

XMLCh * XMLProcessor::_toXMLCh ( int  temp)
inlinestatic

Definition at line 177 of file XMLProcessor.h.

References visDQMUpload::buf, make_classfiles::buff, gather_cfg::cout, mps_update::status, and groupFilesInBlocks::temp.

177  {
178  char buf[100];
179  int status = snprintf(buf, 100, "%d", temp);
180  if (status >= 100) {
181  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
182  } else if (status < 0) {
183  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
184  }
185  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode(buf);
186  return buff;
187 }
buff
***.cc ################

◆ _toXMLCh() [3/4]

XMLCh * XMLProcessor::_toXMLCh ( double  temp)
inlinestatic

Definition at line 189 of file XMLProcessor.h.

References visDQMUpload::buf, make_classfiles::buff, gather_cfg::cout, mps_update::status, and groupFilesInBlocks::temp.

189  {
190  char buf[100];
191  int status = snprintf(buf, 100, "%.10e", temp);
192  if (status >= 100) {
193  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
194  } else if (status < 0) {
195  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
196  }
197  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode(buf);
198  return buff;
199 }
buff
***.cc ################

◆ _toXMLCh() [4/4]

XMLCh * XMLProcessor::_toXMLCh ( time_t  temp)
inlinestatic

Definition at line 201 of file XMLProcessor.h.

References visDQMUpload::buf, make_classfiles::buff, gather_cfg::cout, mps_update::status, and groupFilesInBlocks::temp.

201  {
202  char buf[100];
203  int status = strftime(buf, 50, "%c", gmtime(&temp));
204  if (status == 0) {
205  std::cout << "XML Processor::_toXMLCh(int temp): buffer overflow, the std::string is indeterminate!" << std::endl;
206  }
207  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode(buf);
208  return buff;
209 }
buff
***.cc ################

◆ addLMapHBEFDataset()

int XMLProcessor::addLMapHBEFDataset ( XMLDOMBlock doc,
LMapRowHBEF row,
std::string  templateFileName 
)

Definition at line 92 of file XMLProcessor.cc.

References XMLProcessor::_LMapRowHBEF::adc, XMLProcessor::_LMapRowHBEF::crate, relval_nano::dataSet, XMLProcessor::_LMapRowHBEF::dcc, XMLProcessor::_LMapRowHBEF::dcc_sl, XMLProcessor::_LMapRowHBEF::depth, XMLProcessor::_LMapRowHBEF::det, ALCARECOEcalPhiSym_cff::doc, XMLProcessor::_LMapRowHBEF::dphi, XMLProcessor::_LMapRowHBEF::eta, XMLProcessor::_LMapRowHBEF::fedid, XMLProcessor::_LMapRowHBEF::fi_ch, XMLProcessor::_LMapRowHBEF::fpga, XMLDOMBlock::getDocument(), XMLProcessor::_LMapRowHBEF::htr, XMLProcessor::_LMapRowHBEF::htr_fi, web.browse_db::loader, XMLProcessor::_LMapRowHBEF::phi, XMLProcessor::_LMapRowHBEF::pixel, XMLProcessor::_LMapRowHBEF::qie, XMLProcessor::_LMapRowHBEF::rbx, XMLProcessor::_LMapRowHBEF::rctcar, XMLProcessor::_LMapRowHBEF::rctcon, XMLProcessor::_LMapRowHBEF::rctcra, XMLProcessor::_LMapRowHBEF::rctnam, XMLProcessor::_LMapRowHBEF::rm, XMLProcessor::_LMapRowHBEF::rm_fi, XMLProcessor::_LMapRowHBEF::side, XMLProcessor::_LMapRowHBEF::slb, XMLProcessor::_LMapRowHBEF::slbin, XMLProcessor::_LMapRowHBEF::slbin2, XMLProcessor::_LMapRowHBEF::slnam, XMLProcessor::_LMapRowHBEF::spigo, and XMLProcessor::_LMapRowHBEF::wedge.

92  {
93  DOMDocument* loader = doc->getDocument();
94  DOMElement* root = loader->getDocumentElement();
95 
96  XMLDOMBlock dataSetDoc(templateFileName);
97  DOMDocument* dataSet = dataSetDoc.getDocument();
98 
99  //Dataset
100  dataSet->getElementsByTagName(_toXMLCh("SIDE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->side));
101  dataSet->getElementsByTagName(_toXMLCh("ETA"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->eta));
102  dataSet->getElementsByTagName(_toXMLCh("PHI"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->phi));
103  dataSet->getElementsByTagName(_toXMLCh("DELTA_PHI"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dphi));
104 
105  dataSet->getElementsByTagName(_toXMLCh("DEPTH"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->depth));
106  dataSet->getElementsByTagName(_toXMLCh("SUBDETECTOR"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->det));
107  dataSet->getElementsByTagName(_toXMLCh("RBX_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rbx));
108  dataSet->getElementsByTagName(_toXMLCh("WEDGE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->wedge));
109 
110  dataSet->getElementsByTagName(_toXMLCh("RM_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rm));
111  dataSet->getElementsByTagName(_toXMLCh("HPD_PIXEL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->pixel));
112  dataSet->getElementsByTagName(_toXMLCh("QIE_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->qie));
113  dataSet->getElementsByTagName(_toXMLCh("ADC"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->adc));
114  dataSet->getElementsByTagName(_toXMLCh("RM_FIBER"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rm_fi));
115 
116  dataSet->getElementsByTagName(_toXMLCh("FIBER_CHANNEL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->fi_ch));
117  dataSet->getElementsByTagName(_toXMLCh("CRATE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->crate));
118  dataSet->getElementsByTagName(_toXMLCh("HTR_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->htr));
119  dataSet->getElementsByTagName(_toXMLCh("HTR_FPGA"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->fpga));
120 
121  dataSet->getElementsByTagName(_toXMLCh("HTR_FIBER"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->htr_fi));
122  dataSet->getElementsByTagName(_toXMLCh("DCC_SL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dcc_sl));
123  dataSet->getElementsByTagName(_toXMLCh("SPIGOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->spigo));
124  dataSet->getElementsByTagName(_toXMLCh("DCC_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dcc));
125  dataSet->getElementsByTagName(_toXMLCh("SLB_SITE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->slb));
126  dataSet->getElementsByTagName(_toXMLCh("SLB_CHANNEL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->slbin));
127  dataSet->getElementsByTagName(_toXMLCh("SLB_CHANNEL2"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->slbin2));
128 
129  dataSet->getElementsByTagName(_toXMLCh("SLB_CABLE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->slnam));
130  dataSet->getElementsByTagName(_toXMLCh("RCT_CRATE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rctcra));
131  dataSet->getElementsByTagName(_toXMLCh("RCT_CARD"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rctcar));
132  dataSet->getElementsByTagName(_toXMLCh("RCT_CONNECTOR"))
133  ->item(0)
134  ->getFirstChild()
135  ->setNodeValue(_toXMLCh(row->rctcon));
136  dataSet->getElementsByTagName(_toXMLCh("RCT_NAME"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rctnam));
137  dataSet->getElementsByTagName(_toXMLCh("FED_ID"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->fedid));
138 
139  // copy the <data_set> node into the final XML
140  DOMNode* cloneDataSet = loader->importNode(dataSet->getDocumentElement(), true);
141  root->appendChild(cloneDataSet);
142 
143  return 0;
144 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ addLMapHODataset()

int XMLProcessor::addLMapHODataset ( XMLDOMBlock doc,
LMapRowHO row,
std::string  templateFileName 
)

Definition at line 158 of file XMLProcessor.cc.

References XMLProcessor::_LMapRowHO::adcO, XMLProcessor::_LMapRowHO::crateO, relval_nano::dataSet, XMLProcessor::_LMapRowHO::dcc_slO, XMLProcessor::_LMapRowHO::dccO, XMLProcessor::_LMapRowHO::depthO, XMLProcessor::_LMapRowHO::detO, ALCARECOEcalPhiSym_cff::doc, XMLProcessor::_LMapRowHO::dphiO, XMLProcessor::_LMapRowHO::etaO, XMLProcessor::_LMapRowHO::fedidO, XMLProcessor::_LMapRowHO::fi_chO, XMLProcessor::_LMapRowHO::fpgaO, XMLDOMBlock::getDocument(), XMLProcessor::_LMapRowHO::htr_fiO, XMLProcessor::_LMapRowHO::htrO, XMLProcessor::_LMapRowHO::let_codeO, web.browse_db::loader, XMLProcessor::_LMapRowHO::phiO, XMLProcessor::_LMapRowHO::pixelO, XMLProcessor::_LMapRowHO::qieO, XMLProcessor::_LMapRowHO::rbxO, XMLProcessor::_LMapRowHO::rm_fiO, XMLProcessor::_LMapRowHO::rmO, XMLProcessor::_LMapRowHO::sectorO, XMLProcessor::_LMapRowHO::sideO, and XMLProcessor::_LMapRowHO::spigoO.

158  {
159  DOMDocument* loader = doc->getDocument();
160  DOMElement* root = loader->getDocumentElement();
161 
162  XMLDOMBlock dataSetDoc(templateFileName);
163  DOMDocument* dataSet = dataSetDoc.getDocument();
164 
165  //Dataset
166  dataSet->getElementsByTagName(_toXMLCh("SIDE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->sideO));
167  dataSet->getElementsByTagName(_toXMLCh("ETA"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->etaO));
168  dataSet->getElementsByTagName(_toXMLCh("PHI"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->phiO));
169  dataSet->getElementsByTagName(_toXMLCh("DELTA_PHI"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dphiO));
170 
171  dataSet->getElementsByTagName(_toXMLCh("DEPTH"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->depthO));
172  dataSet->getElementsByTagName(_toXMLCh("SUBDETECTOR"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->detO));
173  dataSet->getElementsByTagName(_toXMLCh("RBX_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rbxO));
174  dataSet->getElementsByTagName(_toXMLCh("SECTOR"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->sectorO));
175 
176  dataSet->getElementsByTagName(_toXMLCh("RM_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rmO));
177  dataSet->getElementsByTagName(_toXMLCh("HPD_PIXEL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->pixelO));
178  dataSet->getElementsByTagName(_toXMLCh("QIE_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->qieO));
179  dataSet->getElementsByTagName(_toXMLCh("ADC"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->adcO));
180  dataSet->getElementsByTagName(_toXMLCh("RM_FIBER"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->rm_fiO));
181  dataSet->getElementsByTagName(_toXMLCh("FIBER_CHANNEL"))
182  ->item(0)
183  ->getFirstChild()
184  ->setNodeValue(_toXMLCh(row->fi_chO));
185 
186  dataSet->getElementsByTagName(_toXMLCh("LETTER_CODE"))
187  ->item(0)
188  ->getFirstChild()
189  ->setNodeValue(_toXMLCh(row->let_codeO));
190  dataSet->getElementsByTagName(_toXMLCh("CRATE"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->crateO));
191  dataSet->getElementsByTagName(_toXMLCh("HTR_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->htrO));
192  dataSet->getElementsByTagName(_toXMLCh("HTR_FPGA"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->fpgaO));
193 
194  dataSet->getElementsByTagName(_toXMLCh("HTR_FIBER"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->htr_fiO));
195  dataSet->getElementsByTagName(_toXMLCh("DCC_SL"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dcc_slO));
196  dataSet->getElementsByTagName(_toXMLCh("SPIGOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->spigoO));
197  dataSet->getElementsByTagName(_toXMLCh("DCC_SLOT"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->dccO));
198  dataSet->getElementsByTagName(_toXMLCh("FED_ID"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh(row->fedidO));
199 
200  // copy the <data_set> node into the final XML
201  DOMNode* cloneDataSet = loader->importNode(dataSet->getDocumentElement(), true);
202  root->appendChild(cloneDataSet);
203 
204  return 0;
205 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ createLMapHBEFXMLBase()

XMLDOMBlock * XMLProcessor::createLMapHBEFXMLBase ( std::string  templateFileName)

Definition at line 77 of file XMLProcessor.cc.

References web.browse_db::loader, and mps_fire::result.

77  {
78  XMLDOMBlock* result = new XMLDOMBlock(templateFileName);
79  DOMDocument* loader = result->getDocument();
80  //DOMElement * root = loader -> getDocumentElement();
81 
82  loader->getElementsByTagName(_toXMLCh("NAME"))
83  ->item(0)
84  ->getFirstChild()
85  ->setNodeValue(_toXMLCh("HCAL LMAP for HB, HE, HF"));
86  //DOMElement * _tag = (DOMElement *)(loader -> getElementsByTagName( _toXMLCh( "TAG" ) ) -> item(0));
87  //_tag -> setAttribute( _toXMLCh("mode"), _toXMLCh("test_mode") );
88 
89  return result;
90 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ createLMapHOXMLBase()

XMLDOMBlock * XMLProcessor::createLMapHOXMLBase ( std::string  templateFileName)

Definition at line 146 of file XMLProcessor.cc.

References web.browse_db::loader, and mps_fire::result.

146  {
147  XMLDOMBlock* result = new XMLDOMBlock(templateFileName);
148  DOMDocument* loader = result->getDocument();
149  //DOMElement * root = loader -> getDocumentElement();
150 
151  loader->getElementsByTagName(_toXMLCh("NAME"))->item(0)->getFirstChild()->setNodeValue(_toXMLCh("HCAL LMAP for HO"));
152  //DOMElement * _tag = (DOMElement *)(loader -> getElementsByTagName( _toXMLCh( "TAG" ) ) -> item(0));
153  //_tag -> setAttribute( _toXMLCh("mode"), _toXMLCh("test_mode") );
154 
155  return result;
156 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ getInstance()

static XMLProcessor* XMLProcessor::getInstance ( )
inlinestatic

◆ init()

int XMLProcessor::init ( void  )

Definition at line 296 of file XMLProcessor.cc.

References DMR_cfg::cerr, gather_cfg::cout, and cms::concurrency::xercesInitialize().

296  {
297  std::cerr << "Intializing Xerces-c...";
298  try {
300  //
301  //_____ following removed as a xalan-c component_____________________
302  //
303  //XPathEvaluator::initialize();
304  } catch (const XMLException& toCatch) {
305  std::cout << " FAILED! Exiting..." << std::endl;
306  return 1;
307  }
308  std::cerr << " done" << std::endl;
309 
310  return 0;
311 }
void xercesInitialize()
Definition: Xerces.cc:18

◆ serializeDOM()

XMLCh * XMLProcessor::serializeDOM ( XERCES_CPP_NAMESPACE::DOMNode *  node,
std::string  target = "stdout" 
)

Definition at line 245 of file XMLProcessor.cc.

References gather_cfg::cout, fetchall_from_DQM_v2::release, and filterCSVwithJSON::target.

245  {
246  XMLCh tempStr[100];
247  XMLString::transcode("LS", tempStr, 99);
248  DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
249  DOMLSSerializer* theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
250  DOMConfiguration* dc = theSerializer->getDomConfig();
251  dc->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true);
252  dc->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
253 
254  XMLFormatTarget* myFormTarget = nullptr;
255  XMLCh* _string = nullptr;
256  if (target == "stdout" || target == "string") {
257  myFormTarget = new StdOutFormatTarget();
258  }
259  //else if ( target == "memory" )
260  // {
261  // myFormTarget = new MemBufFormatTarget();
262  // }
263  else {
264  myFormTarget = new LocalFileFormatTarget(_toXMLCh(target));
265  }
266 
267  try {
268  if (target == "string") {
269  _string = theSerializer->writeToString(node);
270  } else {
271  DOMLSOutput* outputDesc = ((DOMImplementationLS*)impl)->createLSOutput();
272  outputDesc->setByteStream(myFormTarget);
273  theSerializer->write(node, outputDesc);
274  }
275  } catch (const XMLException& toCatch) {
276  char* message = XMLString::transcode(toCatch.getMessage());
277  std::cout << "Exception message is: \n" << message << "\n";
278  XMLString::release(&message);
279  return nullptr;
280  } catch (const DOMException& toCatch) {
281  char* message = XMLString::transcode(toCatch.msg);
282  std::cout << "Exception message is: \n" << message << "\n";
283  XMLString::release(&message);
284  return nullptr;
285  } catch (...) {
286  std::cout << "Unexpected Exception \n";
287  return nullptr;
288  }
289 
290  theSerializer->release();
291  if (myFormTarget)
292  delete myFormTarget;
293  return _string;
294 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ terminate()

int XMLProcessor::terminate ( void  )

Definition at line 313 of file XMLProcessor.cc.

References gather_cfg::cout, and cms::concurrency::xercesTerminate().

Referenced by HcaluLUTTPGCoder::updateXML().

313  {
314  //
315  //_____ following removed as a xalan-c component_____________________
316  //
317  //std::cout << "Terminating Xalan-c...";
318  //XPathEvaluator::terminate();
319  //std::cout << " done" << std::endl;
320 
321  std::cout << "Terminating Xerces-c...";
323  std::cout << " done" << std::endl;
324 
325  // Other terminations and cleanup.
326 
327  return 0;
328 }
void xercesTerminate()
Definition: Xerces.cc:23

◆ test()

int XMLProcessor::test ( void  )

Definition at line 218 of file XMLProcessor.cc.

References gather_cfg::cout, and XMLDOMBlock::getDocument().

Referenced by edmIntegrityCheck.IntegrityCheck::report(), and edmIntegrityCheck.IntegrityCheck::structured().

218  {
219  //if ( init() != 0 ) return 1;
220 
221  XMLDOMBlock dataBlock("HCAL_TRIG_PRIM_LOOKUP_TABLE.datablock.template");
222 
223  DOMDocument* dataBlockDocument = dataBlock.getDocument();
224 
225  std::cout << "===> Tag length: " << dataBlockDocument->getElementsByTagName(_toXMLCh("CREATED_BY_USER"))->getLength()
226  << std::endl;
227  std::cout << "===> Tag name: "
228  << XMLString::transcode(
229  dataBlockDocument->getElementsByTagName(_toXMLCh("CREATED_BY_USER"))->item(0)->getNodeName())
230  << std::endl;
231  dataBlockDocument->getElementsByTagName(_toXMLCh("CREATED_BY_USER"))
232  ->item(0)
233  ->getFirstChild()
234  ->setNodeValue(_toXMLCh("kukarzev test"));
235 
236  XMLCh* _t;
237  _t = serializeDOM(dataBlockDocument);
238  delete _t;
239 
240  //terminate();
241 
242  return 0;
243 }
XMLCh * serializeDOM(XERCES_CPP_NAMESPACE::DOMNode *node, std::string target="stdout")
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:172

◆ write()

int XMLProcessor::write ( XMLDOMBlock doc,
std::string  target = "stdout" 
)

Definition at line 207 of file XMLProcessor.cc.

References ALCARECOEcalPhiSym_cff::doc, web.browse_db::loader, and filterCSVwithJSON::target.

Referenced by pkg.AbstractPkg::generate(), and querying.connection::write_and_commit().

207  {
208  DOMDocument* loader = doc->getDocument();
209  //DOMElement * root = loader -> getDocumentElement();
210 
211  XMLCh* _t;
212  _t = serializeDOM(loader, target);
213  delete _t;
214 
215  return 0;
216 }
XMLCh * serializeDOM(XERCES_CPP_NAMESPACE::DOMNode *node, std::string target="stdout")

Member Data Documentation

◆ instance

XERCES_CPP_NAMESPACE_USE XMLProcessor * XMLProcessor::instance = nullptr
staticprivate

Definition at line 169 of file XMLProcessor.h.

Referenced by getInstance(), and production_tasks.Task::getname().