CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SaxToDom2 Class Reference

#include <SaxToDom2.h>

Inheritance diagram for SaxToDom2:

Public Types

using Attributes = XERCES_CPP_NAMESPACE::Attributes
 
using SAXParseException = XERCES_CPP_NAMESPACE::SAXParseException
 

Public Member Functions

const TinyDom2dom () const
 
void endElement (const XMLCh *uri, const XMLCh *name, const XMLCh *qname) override
 
void error (const SAXParseException &e) override
 
 SaxToDom2 ()
 
void startElement (const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const Attributes &attrs) override
 
 ~SaxToDom2 () override
 

Private Attributes

TinyDom2 dom_
 
std::vector< Node2parent_
 

Detailed Description

Definition at line 19 of file SaxToDom2.h.

Member Typedef Documentation

using SaxToDom2::Attributes = XERCES_CPP_NAMESPACE::Attributes

Definition at line 23 of file SaxToDom2.h.

using SaxToDom2::SAXParseException = XERCES_CPP_NAMESPACE::SAXParseException

Definition at line 24 of file SaxToDom2.h.

Constructor & Destructor Documentation

XERCES_CPP_NAMESPACE_USE SaxToDom2::SaxToDom2 ( )

Definition at line 13 of file SaxToDom2.cc.

14 {
15  AttList2 al;
16  al [ TagName("name") ] = TagName("myTinyDomTest");
17  Node2 nm(TagName("TinyDom2"), al);
18  parent_.emplace_back( nm );
19 }
Definition: TagName.h:9
std::map< TagName, TagName > AttList2
Definition: TinyDom2.h:15
std::pair< TagName, AttList2 > Node2
Definition: TinyDom2.h:16
std::vector< Node2 > parent_
Definition: SaxToDom2.h:37
SaxToDom2::~SaxToDom2 ( )
override

Definition at line 21 of file SaxToDom2.cc.

22 { }

Member Function Documentation

const TinyDom2 & SaxToDom2::dom ( ) const

Definition at line 25 of file SaxToDom2.cc.

26 {
27  return dom_;
28 }
TinyDom2 dom_
Definition: SaxToDom2.h:38
void SaxToDom2::endElement ( const XMLCh *  uri,
const XMLCh *  name,
const XMLCh *  qname 
)
override

Definition at line 58 of file SaxToDom2.cc.

61 {
62  parent_.pop_back();
63 }
std::vector< Node2 > parent_
Definition: SaxToDom2.h:37
void SaxToDom2::error ( const SAXParseException e)
override

Definition at line 66 of file SaxToDom2.cc.

References MessageLogger_cfi::cerr, python.rootplot.argparse::message, and fetchall_from_DQM_v2::release.

Referenced by argparse.ArgumentParser::_get_option_tuples(), python.rootplot.argparse.ArgumentParser::_get_option_tuples(), argparse.ArgumentParser::_parse_known_args(), python.rootplot.argparse.ArgumentParser::_parse_known_args(), argparse.ArgumentParser::_parse_optional(), python.rootplot.argparse.ArgumentParser::_parse_optional(), argparse.ArgumentParser::_read_args_from_files(), python.rootplot.argparse.ArgumentParser::_read_args_from_files(), argparse.ArgumentParser::add_subparsers(), python.rootplot.argparse.ArgumentParser::add_subparsers(), Page1Parser.Page1Parser::check_for_whole_start_tag(), argparse.ArgumentParser::parse_args(), python.rootplot.argparse.ArgumentParser::parse_args(), argparse.ArgumentParser::parse_known_args(), and python.rootplot.argparse.ArgumentParser::parse_known_args().

67 {
68  char* id = XMLString::transcode(e.getSystemId());
69  char* message = XMLString::transcode(e.getMessage());
70  cerr << "\nError at file " << id
71  << ", line " << e.getLineNumber()
72  << ", char " << e.getColumnNumber()
73  << "\n Message: " << message << endl;
74  XMLString::release(&id);
75  XMLString::release(&message);
76 }
void SaxToDom2::startElement ( const XMLCh *  uri,
const XMLCh *  localname,
const XMLCh *  qname,
const Attributes attrs 
)
override

Definition at line 31 of file SaxToDom2.cc.

References mps_fire::i, and fetchall_from_DQM_v2::release.

35 {
36  char * strx = XMLString::transcode(name); // element-name
37  AttList2 al;
38 
39  for (unsigned int i = 0; i < atts.getLength(); ++i)
40  {
41  char* aname = XMLString::transcode(atts.getLocalName(i));
42  char* value = XMLString::transcode(atts.getValue(i));
43  al[TagName(aname)]=TagName(value);
44  XMLString::release(&aname);
45  XMLString::release(&value);
46  }
47 
48  // add the new element to the dom-tree
49  Node2 nm(TagName(strx) , al);
50  Node2 par = parent_.back();
51  dom_.addEdge(par, nm, AnotherDummy2());
52 
53  parent_.emplace_back(nm);
54  XMLString::release(&strx);
55 }
void addEdge(const N &from, const N &to, const E &edge)
Definition: Graph.h:261
Definition: TagName.h:9
std::map< TagName, TagName > AttList2
Definition: TinyDom2.h:15
Definition: value.py:1
std::pair< TagName, AttList2 > Node2
Definition: TinyDom2.h:16
TinyDom2 dom_
Definition: SaxToDom2.h:38
std::vector< Node2 > parent_
Definition: SaxToDom2.h:37

Member Data Documentation

TinyDom2 SaxToDom2::dom_
private

Definition at line 38 of file SaxToDom2.h.

std::vector<Node2> SaxToDom2::parent_
private

Definition at line 37 of file SaxToDom2.h.