#include <SaxToDom.h>
Public Types | |
typedef XERCES_CPP_NAMESPACE::Attributes | Attributes |
typedef XERCES_CPP_NAMESPACE::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 15 of file SaxToDom.h.
typedef XERCES_CPP_NAMESPACE::Attributes SaxToDom::Attributes |
Definition at line 18 of file SaxToDom.h.
typedef XERCES_CPP_NAMESPACE::SAXParseException SaxToDom::SAXParseException |
Definition at line 19 of file SaxToDom.h.
SaxToDom::SaxToDom | ( | ) |
Definition at line 13 of file SaxToDom.cc.
SaxToDom::~SaxToDom | ( | ) |
Definition at line 16 of file SaxToDom.cc.
{ }
const TinyDom & SaxToDom::dom | ( | ) | const |
Definition at line 20 of file SaxToDom.cc.
{ return dom_; }
void SaxToDom::endElement | ( | const XMLCh *const | uri, |
const XMLCh *const | name, | ||
const XMLCh *const | qname | ||
) |
Definition at line 50 of file SaxToDom.cc.
{ parent_.pop_back(); }
void SaxToDom::error | ( | const SAXParseException & | e | ) |
Definition at line 58 of file SaxToDom.cc.
References benchmark_cfg::cerr.
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 i, StrX::localForm(), and relativeConstraints::value.
{ StrX strx(name); // element-name NodeName nm(string(strx.localForm())); // as a temp.string //parent_.push_back(nm); AttList al; // map of attributes -> values for (unsigned int i = 0; i < atts.getLength(); ++i) { const XMLCh* aname = atts.getLocalName(i); const XMLCh* value = atts.getValue(i); // fill the tiny-dom-attribute-list (i.e. the map) al[NodeName((StrX(aname).localForm()))]=NodeName(StrX(value).localForm()); //cout << " att=" << StrX(aname) << " val=" << StrX(value) << endl; } // add the new element to the dom-tree dom_.addEdge(parent_.back(), nm , al); //cout << "add from=" << parent_.back().str() << " to=" << nm.str() << endl; // set the parent_ to the actual node parent_.push_back(nm); }
TinyDom SaxToDom::dom_ [private] |
Definition at line 34 of file SaxToDom.h.
std::vector<NodeName> SaxToDom::parent_ [private] |
Definition at line 33 of file SaxToDom.h.