#include <DetectorDescription/RegressionTest/src/SaxToDom.h>
Public Types | |
typedef xercesc_2_7::Attributes | Attributes |
typedef xercesc_2_7::SAXParseException | SAXParseException |
Public Member Functions | |
const TinyDom & | dom () const |
void | endElement (const XMLCh *const uri, const XMLCh *const name, const XMLCh *const qname) |
void | error (const SAXParseException &e) |
SaxToDom () | |
void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs) |
~SaxToDom () | |
Private Attributes | |
TinyDom | dom_ |
std::vector< NodeName > | parent_ |
Definition at line 14 of file SaxToDom.h.
typedef xercesc_2_7::Attributes SaxToDom::Attributes |
Definition at line 17 of file SaxToDom.h.
typedef xercesc_2_7::SAXParseException SaxToDom::SAXParseException |
Definition at line 18 of file SaxToDom.h.
SaxToDom::SaxToDom | ( | ) |
SaxToDom::~SaxToDom | ( | ) |
const TinyDom & SaxToDom::dom | ( | ) | const |
void SaxToDom::endElement | ( | const XMLCh *const | uri, | |
const XMLCh *const | name, | |||
const XMLCh *const | qname | |||
) |
Definition at line 50 of file SaxToDom.cc.
References parent_.
00053 { 00054 parent_.pop_back(); 00055 }
void SaxToDom::error | ( | const SAXParseException & | e | ) |
Definition at line 58 of file SaxToDom.cc.
References TestMuL1L2Filter_cff::cerr, and lat::endl().
00059 { 00060 cerr << "\nError at file " << StrX(e.getSystemId()) 00061 << ", line " << e.getLineNumber() 00062 << ", char " << e.getColumnNumber() 00063 << "\n Message: " << StrX(e.getMessage()) << endl; 00064 }
void SaxToDom::startElement | ( | const XMLCh *const | uri, | |
const XMLCh *const | localname, | |||
const XMLCh *const | qname, | |||
const Attributes & | attrs | |||
) |
Definition at line 26 of file SaxToDom.cc.
References graph< N, E >::addEdge(), dom_, i, StrX::localForm(), parent_, and value.
00030 { 00031 StrX strx(name); // element-name 00032 NodeName nm(string(strx.localForm())); // as a temp.string 00033 //parent_.push_back(nm); 00034 AttList al; // map of attributes -> values 00035 for (unsigned int i = 0; i < atts.getLength(); ++i) { 00036 const XMLCh* aname = atts.getLocalName(i); 00037 const XMLCh* value = atts.getValue(i); 00038 // fill the tiny-dom-attribute-list (i.e. the map) 00039 al[NodeName((StrX(aname).localForm()))]=NodeName(StrX(value).localForm()); 00040 //cout << " att=" << StrX(aname) << " val=" << StrX(value) << endl; 00041 } 00042 // add the new element to the dom-tree 00043 dom_.addEdge(parent_.back(), nm , al); 00044 //cout << "add from=" << parent_.back().str() << " to=" << nm.str() << endl; 00045 // set the parent_ to the actual node 00046 parent_.push_back(nm); 00047 }
TinyDom SaxToDom::dom_ [private] |
std::vector<NodeName> SaxToDom::parent_ [private] |
Definition at line 32 of file SaxToDom.h.
Referenced by endElement(), SaxToDom(), and startElement().