CMS 3D CMS Logo

SaxToDom.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_REGRESSION_TEST_SAXTODOM_H
2 #define DETECTOR_DESCRIPTION_REGRESSION_TEST_SAXTODOM_H
3 
4 #include <xercesc/util/XercesDefs.hpp>
5 #include <map>
6 #include <string>
7 #include <vector>
8 
12 #include "xercesc/sax/SAXParseException.hpp"
13 #include "xercesc/sax2/Attributes.hpp"
14 #include "xercesc/sax2/DefaultHandler.hpp"
15 #include "xercesc/util/XercesVersion.hpp"
16 
17 class SaxToDom : public XERCES_CPP_NAMESPACE::DefaultHandler {
18 public:
19  using Attributes = XERCES_CPP_NAMESPACE::Attributes;
20  using SAXParseException = XERCES_CPP_NAMESPACE::SAXParseException;
21  SaxToDom();
22  ~SaxToDom() override;
23  void startElement(const XMLCh* uri, const XMLCh* localname, const XMLCh* qname, const Attributes& attrs) override;
24  void endElement(const XMLCh* uri, const XMLCh* name, const XMLCh* qname) override;
25  const TinyDom& dom() const;
26 
27  // errors
28  void error(const SAXParseException& e) override;
29 
30 private:
31  std::vector<NodeName> parent_;
33 };
34 
35 #endif
XERCES_CPP_NAMESPACE::SAXParseException SAXParseException
Definition: SaxToDom.h:20
void endElement(const XMLCh *uri, const XMLCh *name, const XMLCh *qname) override
Definition: SaxToDom.cc:43
XERCES_CPP_NAMESPACE::Attributes Attributes
Definition: SaxToDom.h:19
void error(const SAXParseException &e) override
Definition: SaxToDom.cc:48
SaxToDom()
Definition: SaxToDom.cc:12
TinyDom dom_
Definition: SaxToDom.h:32
~SaxToDom() override
Definition: SaxToDom.cc:14
void startElement(const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const Attributes &attrs) override
Definition: SaxToDom.cc:18
std::vector< NodeName > parent_
Definition: SaxToDom.h:31
const TinyDom & dom() const
Definition: SaxToDom.cc:16