CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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")
 
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 ()
 
 XMLProcessor (const XMLProcessor &)
 

Static Private Attributes

static XMLProcessorinstance = NULL
 

Detailed Description

Description: Testing Xerces library for processing HCAL DB XML wrappers

Usage: <usage>

Definition at line 42 of file XMLProcessor.h.

Member Typedef Documentation

Constructor & Destructor Documentation

XMLProcessor::~XMLProcessor ( )
virtual

Definition at line 50 of file XMLProcessor.cc.

51 {
52  // terminates Xerces
53  terminate();
54 }
int terminate(void)
XMLProcessor::XMLProcessor ( )
private

Definition at line 44 of file XMLProcessor.cc.

References init.

Referenced by getInstance().

45 {
46  // initializes Xerces, must be done only once
47  init();
48 }
int init(void)
XMLProcessor::XMLProcessor ( const XMLProcessor )
private

Member Function Documentation

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

Definition at line 189 of file XMLProcessor.h.

References gather_cfg::cout, ntuplemaker::status, and XERCES_CPP_NAMESPACE_USE::transcode().

190 {
191  char buf[100];
192  int status = snprintf( buf, 100, "%d", temp );
193  if ( status >= 100 )
194  {
195  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
196  }
197  else if ( status <0 )
198  {
199  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
200  }
201  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
202  return buff;
203 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: ntuplemaker.py:245
XMLCh * XMLProcessor::_toXMLCh ( double  temp)
inlinestatic

Definition at line 205 of file XMLProcessor.h.

References gather_cfg::cout, ntuplemaker::status, and XERCES_CPP_NAMESPACE_USE::transcode().

206 {
207  char buf[100];
208  int status = snprintf( buf, 100, "%.10e", temp );
209  if ( status >= 100 )
210  {
211  std::cout << "XMLProcessor::_toXMLCh(int temp): buffer overflow, the std::string will be truncated!" << std::endl;
212  }
213  else if ( status <0 )
214  {
215  std::cout << "XMLProcessor::_toXMLCh(int temp): output error" << std::endl;
216  }
217  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
218  return buff;
219 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: ntuplemaker.py:245
XMLCh * XMLProcessor::_toXMLCh ( time_t  temp)
inlinestatic

Definition at line 221 of file XMLProcessor.h.

References gather_cfg::cout, ntuplemaker::status, and XERCES_CPP_NAMESPACE_USE::transcode().

222 {
223  char buf[100];
224  int status = strftime( buf, 50, "%c", gmtime( &temp ) );
225  if ( status == 0 )
226  {
227  std::cout << "XML Processor::_toXMLCh(int temp): buffer overflow, the std::string is indeterminate!" << std::endl;
228  }
229  XMLCh* buff = XERCES_CPP_NAMESPACE::XMLString::transcode( buf );
230  return buff;
231 }
XMLCh * transcode(const T &fInput)
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: ntuplemaker.py:245
int XMLProcessor::addLMapHBEFDataset ( XMLDOMBlock doc,
LMapRowHBEF row,
std::string  templateFileName 
)

Definition at line 94 of file XMLProcessor.cc.

References ecalMGPA::adc(), HLT_FULL_cff::depth, eta, phi, submit::rm, pyrootRender::root, and slb().

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

Definition at line 160 of file XMLProcessor.cc.

References pyrootRender::root.

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

Definition at line 81 of file XMLProcessor.cc.

References query::result.

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

Definition at line 147 of file XMLProcessor.cc.

References query::result.

148 {
149  XMLDOMBlock * result = new XMLDOMBlock( templateFileName );
150  DOMDocument * loader = result -> getDocument();
151  //DOMElement * root = loader -> getDocumentElement();
152 
153  loader -> getElementsByTagName( _toXMLCh( "NAME" ) ) -> item(0) -> getFirstChild() -> setNodeValue( _toXMLCh( "HCAL LMAP for HO" ) );
154  //DOMElement * _tag = (DOMElement *)(loader -> getElementsByTagName( _toXMLCh( "TAG" ) ) -> item(0));
155  //_tag -> setAttribute( _toXMLCh("mode"), _toXMLCh("test_mode") );
156 
157  return result;
158 }
tuple result
Definition: query.py:137
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:183
static XMLProcessor* XMLProcessor::getInstance ( )
inlinestatic
int XMLProcessor::init ( void  )

Definition at line 298 of file XMLProcessor.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, and cms::concurrency::xercesInitialize().

299 {
300  std::cerr << "Intializing Xerces-c...";
301  try {
303  //
304  //_____ following removed as a xalan-c component_____________________
305  //
306  //XPathEvaluator::initialize();
307  }
308  catch (const XMLException& toCatch) {
309  std::cout << " FAILED! Exiting..." << std::endl;
310  return 1;
311  }
312  std::cerr << " done" << std::endl;
313 
314  return 0;
315 }
void xercesInitialize()
Definition: Xerces.cc:17
tuple cout
Definition: gather_cfg.py:145
XMLCh * XMLProcessor::serializeDOM ( XERCES_CPP_NAMESPACE::DOMNode *  node,
std::string  target = "stdout" 
)

Definition at line 238 of file XMLProcessor.cc.

References gather_cfg::cout, python.rootplot.argparse::message, NULL, fetchall_from_DQM_v2::release, and XERCES_CPP_NAMESPACE_USE::transcode().

239 {
240  XMLCh tempStr[100];
241  XMLString::transcode("LS", tempStr, 99);
242  DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
243  DOMWriter* theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
244 
245  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTDiscardDefaultContent, true))
246  theSerializer->setFeature(XMLUni::fgDOMWRTDiscardDefaultContent, true);
247 
248  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
249  theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
250 
251  XMLFormatTarget * myFormTarget = 0;
252  XMLCh * _string = 0;
253  if ( target == "stdout" || target == "string" )
254  {
255  myFormTarget = new StdOutFormatTarget();
256  }
257  //else if ( target == "memory" )
258  // {
259  // myFormTarget = new MemBufFormatTarget();
260  // }
261  else
262  {
263  myFormTarget = new LocalFileFormatTarget( _toXMLCh( target ) );
264  }
265 
266  try {
267  if ( target == "string" ){
268  _string = theSerializer->writeToString( *node );
269  }
270  else{
271  theSerializer->writeNode(myFormTarget, *node);
272  }
273  }
274  catch (const XMLException& toCatch) {
275  char* message = XMLString::transcode(toCatch.getMessage());
276  std::cout << "Exception message is: \n"
277  << message << "\n";
278  XMLString::release(&message);
279  return 0;
280  }
281  catch (const DOMException& toCatch) {
282  char* message = XMLString::transcode(toCatch.msg);
283  std::cout << "Exception message is: \n"
284  << message << "\n";
285  XMLString::release(&message);
286  return NULL;
287  }
288  catch (...) {
289  std::cout << "Unexpected Exception \n" ;
290  return NULL;
291  }
292 
293  theSerializer->release();
294  if ( myFormTarget ) delete myFormTarget;
295  return _string;
296 }
#define NULL
Definition: scimark2.h:8
XMLCh * transcode(const T &fInput)
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:183
tuple cout
Definition: gather_cfg.py:145
int XMLProcessor::terminate ( void  )

Definition at line 317 of file XMLProcessor.cc.

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

Referenced by HcaluLUTTPGCoder::updateXML().

318 {
319  //
320  //_____ following removed as a xalan-c component_____________________
321  //
322  //std::cout << "Terminating Xalan-c...";
323  //XPathEvaluator::terminate();
324  //std::cout << " done" << std::endl;
325 
326  std::cout << "Terminating Xerces-c...";
328  std::cout << " done" << std::endl;
329 
330 
331  // Other terminations and cleanup.
332 
333  return 0;
334 }
void xercesTerminate()
Definition: Xerces.cc:22
tuple cout
Definition: gather_cfg.py:145
int XMLProcessor::test ( void  )

Definition at line 217 of file XMLProcessor.cc.

References gather_cfg::cout, and XERCES_CPP_NAMESPACE_USE::transcode().

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() << std::endl;
226  std::cout << "===> Tag name: " << XMLString::transcode( dataBlockDocument -> getElementsByTagName( _toXMLCh( "CREATED_BY_USER" ) ) -> item(0) -> getNodeName() ) << std::endl;
227  dataBlockDocument -> getElementsByTagName( _toXMLCh( "CREATED_BY_USER" ) ) -> item(0) -> getFirstChild() -> setNodeValue( _toXMLCh( "kukarzev test" ) );
228 
229  XMLCh * _t;
230  _t = serializeDOM( dataBlockDocument );
231  delete _t;
232 
233  //terminate();
234 
235  return 0;
236 }
XMLCh * serializeDOM(XERCES_CPP_NAMESPACE::DOMNode *node, std::string target="stdout")
XMLCh * transcode(const T &fInput)
static XMLCh * _toXMLCh(std::string temp)
Definition: XMLProcessor.h:183
tuple cout
Definition: gather_cfg.py:145
int XMLProcessor::write ( XMLDOMBlock doc,
std::string  target = "stdout" 
)

Definition at line 205 of file XMLProcessor.cc.

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

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

Member Data Documentation

XERCES_CPP_NAMESPACE_USE XMLProcessor * XMLProcessor::instance = NULL
staticprivate

Definition at line 180 of file XMLProcessor.h.

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