CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
XMLDOMBlock Class Reference

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

Inheritance diagram for XMLDOMBlock:
HcalChannelDataXml HcalHardwareXml HcalTriggerKey LMapLoader LutXml XMLHTRPatternLoader XMLHTRZeroSuppressionLoader XMLLUTLoader XMLRBXPedestalsLoader

Public Member Functions

DOMElement * add_element (DOMElement *parent, XMLCh *tagname, XMLCh *value)
 
DOMDocument * getDocument (void)
 
DOMDocument * getDocumentConst (void) const
 
DOMDocument * getNewDocument (std::string xmlFileName)
 
std::string & getString (void)
 
std::string & getString (DOMNode *_node)
 
const char * getTagAttribute (const std::string &tagName, const std::string &attrName, int _item=0)
 
const char * getTagValue (const std::string &tagName, int _item=0, DOMDocument *_document=NULL)
 
const char * getTagValue (const std::string &tagName, int _item, DOMElement *_document)
 
std::string getTimestamp (time_t _time)
 
XMLDOMBlockoperator+= (const XMLDOMBlock &other)
 
void parse (InputSource &_source)
 
DOMNode * setTagAttribute (const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
 
DOMNode * setTagAttribute (DOMElement *_elem, const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
 
DOMNode * setTagAttribute (const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0)
 
DOMNode * setTagAttribute (DOMElement *_elem, const std::string &tagName, const std::string &attrName, const int &attrValue, int _item=0)
 
DOMNode * setTagValue (const std::string &tagName, const std::string &tagValue, int _item=0, DOMDocument *_document=NULL)
 
DOMNode * setTagValue (DOMElement *_elem, const std::string &tagName, const std::string &tagValue, int _item=0)
 
DOMNode * setTagValue (const std::string &tagName, const int &tagValue, int _item=0, DOMDocument *_document=NULL)
 
DOMNode * setTagValue (DOMElement *_elem, const std::string &tagName, const int &tagValue, int _item=0)
 
int write (std::string target="stdout")
 
 XMLDOMBlock ()
 
 XMLDOMBlock (std::string xmlFileName)
 
 XMLDOMBlock (InputSource &_source)
 
 XMLDOMBlock (std::string _root, int rootElementName)
 
virtual ~XMLDOMBlock ()
 

Protected Member Functions

int init (std::string _root)
 

Protected Attributes

DOMDocument * document
 
ErrorHandler * errHandler
 
XercesDOMParser * parser
 
std::string * the_string
 
std::string theFileName
 
XMLProcessortheProcessor
 

Friends

class XMLProcessor
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 44 of file XMLDOMBlock.h.

Constructor & Destructor Documentation

XMLDOMBlock::XMLDOMBlock ( )

Definition at line 51 of file XMLDOMBlock.cc.

References init.

52 {
53  //std::cout << "XMLDOMBlock (or derived): default constructor called - this is meaningless!" << std::endl;
54  //std::cout << "XMLDOMBlock (or derived): use yourClass( loaderBaseConfig & ) instead." << std::endl;
55  init( "ROOT" );
56 }
int init(std::string _root)
Definition: XMLDOMBlock.cc:168
XMLDOMBlock::XMLDOMBlock ( std::string  xmlFileName)

Definition at line 210 of file XMLDOMBlock.cc.

References gather_cfg::cout, XMLProcessor::getInstance(), python.rootplot.argparse::message, geometryXMLtoCSV::parser, fetchall_from_DQM_v2::release, and BuildIsoConfigs::xmlFileName.

211 {
212  //
213  //_____ following removed as a xalan-c component_____________________
214  //
215  /*
216  // xalan objects initialization
217  theSourceTreeInit = 0;
218  theDOMSupport = 0;
219  theLiaison = 0;
220  theInputSource = 0;
221  theDocument = 0;
222  thePrefixResolver = 0;
223  theEvaluator = 0;
224  */
225 
227 
229 
230  // initialize the parser
231  parser = new XercesDOMParser();
232  parser->setValidationScheme(XercesDOMParser::Val_Always);
233  parser->setDoNamespaces(true); // optional
234 
235  errHandler = (ErrorHandler*) new HandlerBase();
236  parser->setErrorHandler(errHandler);
237 
238  // parse the input xml file
239  try
240  {
241  parser->parse( theFileName . c_str() );
242  }
243  catch (const XMLException& toCatch) {
244  char* message = XMLString::transcode(toCatch.getMessage());
245  std::cout << "Exception message is: \n"
246  << message << "\n";
247  XMLString::release(&message);
248  //return -1;
249  }
250  catch (const DOMException& toCatch) {
251  char* message = XMLString::transcode(toCatch.msg);
252  std::cout << "Exception message is: \n"
253  << message << "\n";
254  XMLString::release(&message);
255  //return -1;
256  }
257  catch (...) {
258  std::cout << "Unexpected Exception \n" ;
259  //return -1;
260  }
261 
262  //get the XML document
263  document = parser -> getDocument();
264 
265 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
std::string theFileName
Definition: XMLDOMBlock.h:99
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97
tuple cout
Definition: gather_cfg.py:121
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:147
XMLDOMBlock::XMLDOMBlock ( InputSource _source)

Definition at line 66 of file XMLDOMBlock.cc.

References gather_cfg::cout, XMLProcessor::getInstance(), python.rootplot.argparse::message, geometryXMLtoCSV::parser, and fetchall_from_DQM_v2::release.

67 {
68  //
69  //_____ following removed as a xalan-c component_____________________
70  //
71  /*
72  // xalan objects initialization
73  theSourceTreeInit = 0;
74  theDOMSupport = 0;
75  theLiaison = 0;
76  theInputSource = 0;
77  theDocument = 0;
78  thePrefixResolver = 0;
79  theEvaluator = 0;
80  */
81 
83 
84  //theFileName = xmlFileName;
85 
86  // initialize the parser
87  parser = new XercesDOMParser();
88  parser->setValidationScheme(XercesDOMParser::Val_Always);
89  parser->setDoNamespaces(true); // optional
90 
91  errHandler = (ErrorHandler*) new HandlerBase();
92  parser->setErrorHandler(errHandler);
93 
94  // parse the input xml file
95  try
96  {
97  parser->parse( _source );
98  }
99  catch (const XMLException& toCatch) {
100  char* message = XMLString::transcode(toCatch.getMessage());
101  std::cout << "Exception message is: \n"
102  << message << "\n";
103  XMLString::release(&message);
104  //return -1;
105  }
106  catch (const DOMException& toCatch) {
107  char* message = XMLString::transcode(toCatch.msg);
108  std::cout << "Exception message is: \n"
109  << message << "\n";
110  XMLString::release(&message);
111  //return -1;
112  }
113  catch (...) {
114  std::cout << "Unexpected Exception \n" ;
115  //return -1;
116  }
117 
118  //get the XML document
119  document = parser -> getDocument();
120 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97
tuple cout
Definition: gather_cfg.py:121
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:147
XMLDOMBlock::XMLDOMBlock ( std::string  _root,
int  rootElementName 
)

Definition at line 58 of file XMLDOMBlock.cc.

References init.

59 {
60  //std::cout << "XMLDOMBlock (or derived): default constructor called - this is meaningless!" << std::endl;
61  //std::cout << "XMLDOMBlock (or derived): use yourClass( loaderBaseConfig & ) instead." << std::endl;
62  init( _root );
63 }
int init(std::string _root)
Definition: XMLDOMBlock.cc:168
XMLDOMBlock::~XMLDOMBlock ( )
virtual

Definition at line 330 of file XMLDOMBlock.cc.

References geometryXMLtoCSV::parser.

331 {
332  delete parser;
333  delete errHandler;
334  //if (the_string) delete the_string;
335 
336  //
337  //_____ following removed as a xalan-c component_____________________
338  //
339  /*
340  // delete xalan objects
341  delete theSourceTreeInit;
342  delete theDOMSupport;
343  delete theLiaison;
344  delete theInputSource;
345  //delete theDocument; // noneed to delete - belongs to theLiaison
346  delete thePrefixResolver;
347  delete theEvaluator;
348  */
349 }
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97

Member Function Documentation

DOMElement * XMLDOMBlock::add_element ( DOMElement *  parent,
XMLCh *  tagname,
XMLCh *  value 
)

Definition at line 524 of file XMLDOMBlock.cc.

524  {
525  DOMElement * _elem = document -> createElement( tagname );
526  parent -> appendChild(_elem);
527  DOMText * _value = document -> createTextNode(value);
528  _elem->appendChild(_value);
529  return _elem;
530 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
list parent
Definition: dbtoconf.py:74
DOMDocument * XMLDOMBlock::getDocument ( void  )
DOMDocument * XMLDOMBlock::getDocumentConst ( void  ) const

Definition at line 318 of file XMLDOMBlock.cc.

Referenced by operator+=().

319 {
320  return document;
321 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
DOMDocument * XMLDOMBlock::getNewDocument ( std::string  xmlFileName)

Definition at line 267 of file XMLDOMBlock.cc.

References gather_cfg::cout, XMLProcessor::getInstance(), python.rootplot.argparse::message, geometryXMLtoCSV::parser, fetchall_from_DQM_v2::release, and BuildIsoConfigs::xmlFileName.

268 {
269  delete document;
270 
272 
274 
275  // initialize the parser
276  parser = new XercesDOMParser();
277  parser->setValidationScheme(XercesDOMParser::Val_Always);
278  parser->setDoNamespaces(true); // optional
279 
280  errHandler = (ErrorHandler*) new HandlerBase();
281  parser->setErrorHandler(errHandler);
282 
283  // parse the input xml file
284  try
285  {
286  parser->parse( theFileName . c_str() );
287  }
288  catch (const XMLException& toCatch) {
289  char* message = XMLString::transcode(toCatch.getMessage());
290  std::cout << "Exception message is: \n"
291  << message << "\n";
292  XMLString::release(&message);
293  //return -1;
294  }
295  catch (const DOMException& toCatch) {
296  char* message = XMLString::transcode(toCatch.msg);
297  std::cout << "Exception message is: \n"
298  << message << "\n";
299  XMLString::release(&message);
300  //return -1;
301  }
302  catch (...) {
303  std::cout << "Unexpected Exception \n" ;
304  //return -1;
305  }
306 
307  //get the XML document
308  document = parser -> getDocument();
309 
310  return document;
311 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
std::string theFileName
Definition: XMLDOMBlock.h:99
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97
tuple cout
Definition: gather_cfg.py:121
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:147
std::string & XMLDOMBlock::getString ( void  )

Definition at line 460 of file XMLDOMBlock.cc.

Referenced by LutXml::getCurrentBrick().

461 {
462  return getString( this->getDocument() );
463 }
std::string & getString(void)
Definition: XMLDOMBlock.cc:460
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
std::string & XMLDOMBlock::getString ( DOMNode *  _node)

Definition at line 468 of file XMLDOMBlock.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

469 {
470  if (the_string) delete the_string;
471  std::string _target = "string";
472  the_string = new std::string( XMLString::transcode( theProcessor->serializeDOM(_node,_target) ) );
473  return (*the_string);
474 }
std::string * the_string
Definition: XMLDOMBlock.h:100
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
XMLCh * serializeDOM(DOMNode *node, std::string target="stdout")
const char * XMLDOMBlock::getTagAttribute ( const std::string &  tagName,
const std::string &  attrName,
int  _item = 0 
)

Definition at line 401 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by XMLRBXPedestalsLoader::addRBXSlot().

402 {
403  DOMElement * _tag = (DOMElement *)(document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item ));
404  const char * _result = XMLString::transcode( _tag -> getAttribute( XMLProcessor::_toXMLCh( attrName ) ) );
405 
406  return _result;
407 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
const char * XMLDOMBlock::getTagValue ( const std::string &  tagName,
int  _item = 0,
DOMDocument *  _document = NULL 
)

Definition at line 351 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by XMLRBXPedestalsLoader::addRBXSlot().

352 {
353  if (!_document) _document = document;
354  const char * _result = XMLString::transcode( _document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item ) -> getFirstChild()-> getNodeValue() );
355  return _result;
356 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
const char * XMLDOMBlock::getTagValue ( const std::string &  tagName,
int  _item,
DOMElement *  _document 
)

Definition at line 358 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

359 {
360  if (!_document) return 0;
361  const char * _result = XMLString::transcode( _document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item ) -> getFirstChild()-> getNodeValue() );
362  return _result;
363 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
string XMLDOMBlock::getTimestamp ( time_t  _time)

Definition at line 447 of file XMLDOMBlock.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

448 {
449  char timebuf[50];
450  //strftime( timebuf, 50, "%c", gmtime( &_time ) );
451  strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &_time ) );
452  std::string creationstamp = timebuf;
453 
454  return creationstamp;
455 }
int XMLDOMBlock::init ( std::string  _root)
protected

Definition at line 168 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh(), XMLProcessor::getInstance(), and geometryXMLtoCSV::parser.

169 {
171 
172  //theFileName = xmlFileName;
173 
174  // initialize the parser
175  parser = new XercesDOMParser();
176  parser->setValidationScheme(XercesDOMParser::Val_Always);
177  parser->setDoNamespaces(true); // optional
178 
179  errHandler = (ErrorHandler*) new HandlerBase();
180  parser->setErrorHandler(errHandler);
181 
182  DOMImplementation* impl = DOMImplementation::getImplementation();
183 
184  document = impl->createDocument(
185  0, // root element namespace URI.
186  //XMLString::transcode("ROOT"), // root element name
187  XMLProcessor::_toXMLCh(_root), // root element name
188  0); // document type object (DTD).
189 
190  the_string = 0;
191 
192  //
193  //_____ following removed as a xalan-c component_____________________
194  //
195  /*
196  // xalan objects initialization
197  theSourceTreeInit = 0;
198  theDOMSupport = 0;
199  theLiaison = 0;
200  theInputSource = 0;
201  theDocument = 0;
202  thePrefixResolver = 0;
203  theEvaluator = 0;
204  */
205  return 0;
206 }
std::string * the_string
Definition: XMLDOMBlock.h:100
DOMDocument * document
Definition: XMLDOMBlock.h:98
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:147
XMLDOMBlock & XMLDOMBlock::operator+= ( const XMLDOMBlock other)

Definition at line 36 of file XMLDOMBlock.cc.

References _length, getDocumentConst(), and i.

37 {
38  DOMNodeList * _children = other.getDocumentConst()->getDocumentElement()->getChildNodes();
39  int _length = _children->getLength();
40  //std::cout << "Children nodes:" << _length << std::endl;
41  DOMNode * _node;
42  for(int i=0;i!=_length;i++){
43  _node = _children->item(i);
44  DOMNode * i_node = this->getDocument()->importNode(_node,true);
45  this->getDocument()->getDocumentElement()->appendChild(i_node);
46  }
47  return *this;
48 }
int i
Definition: DBlmapReader.cc:9
#define _length
Definition: Pythia6jets.h:4
DOMDocument * getDocumentConst(void) const
Definition: XMLDOMBlock.cc:318
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
void XMLDOMBlock::parse ( InputSource _source)

Definition at line 123 of file XMLDOMBlock.cc.

References gather_cfg::cout, XMLProcessor::getInstance(), python.rootplot.argparse::message, geometryXMLtoCSV::parser, and fetchall_from_DQM_v2::release.

Referenced by HcalTriggerKey::HcalTriggerKey().

124 {
125 
127 
128  //theFileName = xmlFileName;
129 
130  // initialize the parser
131  parser = new XercesDOMParser();
132  parser->setValidationScheme(XercesDOMParser::Val_Always);
133  parser->setDoNamespaces(true); // optional
134 
135  errHandler = (ErrorHandler*) new HandlerBase();
136  parser->setErrorHandler(errHandler);
137 
138  // parse the input xml file
139  try
140  {
141  parser->parse( _source );
142  }
143  catch (const XMLException& toCatch) {
144  char* message = XMLString::transcode(toCatch.getMessage());
145  std::cout << "Exception message is: \n"
146  << message << "\n";
147  XMLString::release(&message);
148  //return -1;
149  }
150  catch (const DOMException& toCatch) {
151  char* message = XMLString::transcode(toCatch.msg);
152  std::cout << "Exception message is: \n"
153  << message << "\n";
154  XMLString::release(&message);
155  //return -1;
156  }
157  catch (...) {
158  std::cout << "Unexpected Exception \n" ;
159  //return -1;
160  }
161 
162  //get the XML document
163  document = parser -> getDocument();
164 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95
DOMDocument * getDocument(void)
Definition: XMLDOMBlock.cc:313
XercesDOMParser * parser
Definition: XMLDOMBlock.h:96
ErrorHandler * errHandler
Definition: XMLDOMBlock.h:97
tuple cout
Definition: gather_cfg.py:121
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:147
DOMNode * XMLDOMBlock::setTagAttribute ( const std::string &  tagName,
const std::string &  attrName,
const std::string &  attrValue,
int  _item = 0 
)

Definition at line 409 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by XMLHTRPatternLoader::XMLHTRPatternLoader(), XMLHTRZeroSuppressionLoader::XMLHTRZeroSuppressionLoader(), XMLLUTLoader::XMLLUTLoader(), and XMLRBXPedestalsLoader::XMLRBXPedestalsLoader().

410 {
411  DOMNode * the_tag = document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
412  DOMElement * _tag = (DOMElement *)the_tag;
413  _tag -> setAttribute( XMLProcessor::_toXMLCh( attrName ), XMLProcessor::_toXMLCh( attrValue ) );
414  return the_tag;
415 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagAttribute ( DOMElement *  _elem,
const std::string &  tagName,
const std::string &  attrName,
const std::string &  attrValue,
int  _item = 0 
)

Definition at line 417 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

418 {
419  if (!_elem) return 0;
420  DOMNode * the_tag = _elem -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
421  if (the_tag){
422  DOMElement * _tag = (DOMElement *)the_tag;
423  _tag -> setAttribute( XMLProcessor::_toXMLCh( attrName ), XMLProcessor::_toXMLCh( attrValue ) );
424  }
425  return the_tag;
426 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagAttribute ( const std::string &  tagName,
const std::string &  attrName,
const int &  attrValue,
int  _item = 0 
)

Definition at line 428 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

429 {
430  DOMNode * the_tag = document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
431  DOMElement * _tag = (DOMElement *)the_tag;
432  _tag -> setAttribute( XMLProcessor::_toXMLCh( attrName ), XMLProcessor::_toXMLCh( attrValue ) );
433  return the_tag;
434 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagAttribute ( DOMElement *  _elem,
const std::string &  tagName,
const std::string &  attrName,
const int &  attrValue,
int  _item = 0 
)

Definition at line 436 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

437 {
438  if (!_elem) return 0;
439  DOMNode * the_tag = _elem -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
440  if (the_tag){
441  DOMElement * _tag = (DOMElement *)the_tag;
442  _tag -> setAttribute( XMLProcessor::_toXMLCh( attrName ), XMLProcessor::_toXMLCh( attrValue ) );
443  }
444  return the_tag;
445 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagValue ( const std::string &  tagName,
const std::string &  tagValue,
int  _item = 0,
DOMDocument *  _document = NULL 
)

Definition at line 365 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by HcalTriggerKey::add_data(), XMLLUTLoader::addChecksums(), XMLHTRPatternLoader::addChecksums(), XMLLUTLoader::addLUT(), XMLHTRPatternLoader::addPattern(), XMLRBXPedestalsLoader::addRBXSlot(), XMLHTRZeroSuppressionLoader::addZS(), XMLHTRPatternLoader::XMLHTRPatternLoader(), XMLHTRZeroSuppressionLoader::XMLHTRZeroSuppressionLoader(), XMLLUTLoader::XMLLUTLoader(), and XMLRBXPedestalsLoader::XMLRBXPedestalsLoader().

366 {
367  if (!_document) _document = document;
368  DOMNode * the_tag = _document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
369  the_tag -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( tagValue ) );
370  return the_tag;
371 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagValue ( DOMElement *  _elem,
const std::string &  tagName,
const std::string &  tagValue,
int  _item = 0 
)

Definition at line 373 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

374 {
375  if (!_elem) return 0;
376  DOMNode * the_tag = _elem -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
377  if (the_tag){
378  the_tag -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( tagValue ) );
379  }
380  return the_tag;
381 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagValue ( const std::string &  tagName,
const int &  tagValue,
int  _item = 0,
DOMDocument *  _document = NULL 
)

Definition at line 383 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

384 {
385  if (!_document) _document = document;
386  DOMNode * the_tag = _document -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
387  the_tag -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( tagValue ) );
388  return the_tag;
389 }
DOMDocument * document
Definition: XMLDOMBlock.h:98
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
DOMNode * XMLDOMBlock::setTagValue ( DOMElement *  _elem,
const std::string &  tagName,
const int &  tagValue,
int  _item = 0 
)

Definition at line 391 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

392 {
393  if (!_elem) return 0;
394  DOMNode * the_tag = _elem -> getElementsByTagName( XMLProcessor::_toXMLCh( tagName ) ) -> item( _item );
395  if(the_tag){
396  the_tag -> getFirstChild() -> setNodeValue( XMLProcessor::_toXMLCh( tagValue ) );
397  }
398  return the_tag;
399 }
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:185
int XMLDOMBlock::write ( std::string  target = "stdout")

Definition at line 323 of file XMLDOMBlock.cc.

References TablePrint::write.

Referenced by WriteL1TriggerObjetsXml::analyze(), XMLLUTLoader::createLoader(), XMLHTRPatternLoader::createLoader(), and pkg.AbstractPkg::generate().

324 {
325  theProcessor -> write( this, target );
326 
327  return 0;
328 }
int write(std::string target="stdout")
Definition: XMLDOMBlock.cc:323
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:95

Friends And Related Function Documentation

friend class XMLProcessor
friend

Definition at line 47 of file XMLDOMBlock.h.

Member Data Documentation

DOMDocument* XMLDOMBlock::document
protected
ErrorHandler* XMLDOMBlock::errHandler
protected

Definition at line 97 of file XMLDOMBlock.h.

XercesDOMParser* XMLDOMBlock::parser
protected

Definition at line 96 of file XMLDOMBlock.h.

std::string* XMLDOMBlock::the_string
protected

Definition at line 100 of file XMLDOMBlock.h.

std::string XMLDOMBlock::theFileName
protected

Definition at line 99 of file XMLDOMBlock.h.

XMLProcessor* XMLDOMBlock::theProcessor
protected

Definition at line 95 of file XMLDOMBlock.h.