CMS 3D CMS Logo

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

#include <SaxToDom.h>

Inheritance diagram for SaxToDom:

Public Types

typedef XERCES_CPP_NAMESPACE::Attributes Attributes
 
typedef XERCES_CPP_NAMESPACE::SAXParseException SAXParseException
 

Public Member Functions

const TinyDomdom () 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< NodeNameparent_
 

Detailed Description

Definition at line 17 of file SaxToDom.h.

Member Typedef Documentation

typedef XERCES_CPP_NAMESPACE::Attributes SaxToDom::Attributes

Definition at line 20 of file SaxToDom.h.

typedef XERCES_CPP_NAMESPACE::SAXParseException SaxToDom::SAXParseException

Definition at line 21 of file SaxToDom.h.

Constructor & Destructor Documentation

XERCES_CPP_NAMESPACE_USE SaxToDom::SaxToDom ( )

Definition at line 12 of file SaxToDom.cc.

13 { parent_.push_back(NodeName("TinyDom")); }
TagName NodeName
Definition: TinyDom.h:14
std::vector< NodeName > parent_
Definition: SaxToDom.h:35
SaxToDom::~SaxToDom ( )

Definition at line 15 of file SaxToDom.cc.

16 { }

Member Function Documentation

const TinyDom & SaxToDom::dom ( ) const

Definition at line 19 of file SaxToDom.cc.

20 {
21  return dom_;
22 }
TinyDom dom_
Definition: SaxToDom.h:36
void SaxToDom::endElement ( const XMLCh *const  uri,
const XMLCh *const  name,
const XMLCh *const  qname 
)

Definition at line 52 of file SaxToDom.cc.

55 {
56  parent_.pop_back();
57 }
std::vector< NodeName > parent_
Definition: SaxToDom.h:35
void SaxToDom::error ( const SAXParseException e)

Definition at line 60 of file SaxToDom.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().

61 {
62  char* id = XMLString::transcode(e.getSystemId());
63  char* message = XMLString::transcode(e.getMessage());
64  cerr << "\nError at file " << id
65  << ", line " << e.getLineNumber()
66  << ", char " << e.getColumnNumber()
67  << "\n Message: " << message << endl;
68  XMLString::release(&id);
69  XMLString::release(&message);
70 }
void SaxToDom::startElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname,
const Attributes attrs 
)

Definition at line 25 of file SaxToDom.cc.

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

29 {
30  char * strx = XMLString::transcode(name); // element-name
31  NodeName nm(strx); // as a temp.string
32  //parent_.push_back(nm);
33  AttList al; // map of attributes -> values
34  for (unsigned int i = 0; i < atts.getLength(); ++i) {
35  char* aname = XMLString::transcode(atts.getLocalName(i));
36  char* value = XMLString::transcode(atts.getValue(i));
37  // fill the tiny-dom-attribute-list (i.e. the map)
38  al[NodeName(aname)]=NodeName(value);
39  //cout << " att=" << StrX(aname) << " val=" << StrX(value) << endl;
40  XMLString::release(&aname);
41  XMLString::release(&value);
42  }
43  // add the new element to the dom-tree
44  dom_.addEdge(parent_.back(), nm , al);
45  //cout << "add from=" << parent_.back().str() << " to=" << nm.str() << endl;
46  // set the parent_ to the actual node
47  parent_.push_back(nm);
48  XMLString::release(&strx);
49 }
Definition: TagName.h:9
Definition: value.py:1
TinyDom dom_
Definition: SaxToDom.h:36
TagName NodeName
Definition: TinyDom.h:14
std::map< AttName, AttValue > AttList
Definition: TinyDom.h:17
std::vector< NodeName > parent_
Definition: SaxToDom.h:35
void addEdge(const N &from, const N &to, const E &edge)
Definition: adjgraph.h:266

Member Data Documentation

TinyDom SaxToDom::dom_
private

Definition at line 36 of file SaxToDom.h.

std::vector<NodeName> SaxToDom::parent_
private

Definition at line 35 of file SaxToDom.h.