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 43 of file XMLDOMBlock.h.

Constructor & Destructor Documentation

XMLDOMBlock::XMLDOMBlock ( )

Definition at line 50 of file XMLDOMBlock.cc.

References init.

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

Definition at line 209 of file XMLDOMBlock.cc.

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

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

Definition at line 65 of file XMLDOMBlock.cc.

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

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

Definition at line 57 of file XMLDOMBlock.cc.

References init.

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

Definition at line 329 of file XMLDOMBlock.cc.

References geometryXMLtoCSV::parser.

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

Member Function Documentation

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

Definition at line 523 of file XMLDOMBlock.cc.

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

Definition at line 317 of file XMLDOMBlock.cc.

Referenced by operator+=().

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

Definition at line 266 of file XMLDOMBlock.cc.

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

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

Definition at line 459 of file XMLDOMBlock.cc.

Referenced by LutXml::getCurrentBrick().

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

Definition at line 467 of file XMLDOMBlock.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

468 {
469  if (the_string) delete the_string;
470  std::string _target = "string";
471  the_string = new std::string( XMLString::transcode( theProcessor->serializeDOM(_node,_target) ) );
472  return (*the_string);
473 }
std::string * the_string
Definition: XMLDOMBlock.h:99
XMLProcessor * theProcessor
Definition: XMLDOMBlock.h:94
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 400 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by XMLRBXPedestalsLoader::addRBXSlot().

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

Definition at line 350 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

Referenced by XMLRBXPedestalsLoader::addRBXSlot().

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

Definition at line 357 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 446 of file XMLDOMBlock.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 167 of file XMLDOMBlock.cc.

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

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

Definition at line 35 of file XMLDOMBlock.cc.

References _length, getDocumentConst(), and i.

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

Definition at line 122 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().

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

Definition at line 408 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

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

Definition at line 416 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 427 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 435 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 364 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().

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

Definition at line 372 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 382 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 390 of file XMLDOMBlock.cc.

References XMLProcessor::_toXMLCh().

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

Definition at line 322 of file XMLDOMBlock.cc.

References TablePrint::write.

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

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

Friends And Related Function Documentation

friend class XMLProcessor
friend

Definition at line 46 of file XMLDOMBlock.h.

Member Data Documentation

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

Definition at line 96 of file XMLDOMBlock.h.

XercesDOMParser* XMLDOMBlock::parser
protected

Definition at line 95 of file XMLDOMBlock.h.

std::string* XMLDOMBlock::the_string
protected

Definition at line 99 of file XMLDOMBlock.h.

std::string XMLDOMBlock::theFileName
protected

Definition at line 98 of file XMLDOMBlock.h.

XMLProcessor* XMLDOMBlock::theProcessor
protected

Definition at line 94 of file XMLDOMBlock.h.