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

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

Public Member Functions

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

Private Attributes

TinyDom2 dom_
 
std::vector< Node2parent_
 

Detailed Description

Definition at line 19 of file SaxToDom2.h.

Member Typedef Documentation

typedef XERCES_CPP_NAMESPACE::Attributes SaxToDom2::Attributes

Definition at line 23 of file SaxToDom2.h.

typedef XERCES_CPP_NAMESPACE::SAXParseException SaxToDom2::SAXParseException

Definition at line 24 of file SaxToDom2.h.

Constructor & Destructor Documentation

XERCES_CPP_NAMESPACE_USE SaxToDom2::SaxToDom2 ( )

Definition at line 14 of file SaxToDom2.cc.

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

Definition at line 22 of file SaxToDom2.cc.

23 { }

Member Function Documentation

const TinyDom2 & SaxToDom2::dom ( ) const

Definition at line 26 of file SaxToDom2.cc.

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

Definition at line 59 of file SaxToDom2.cc.

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

Definition at line 67 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().

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

Definition at line 32 of file SaxToDom2.cc.

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

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

Member Data Documentation

TinyDom2 SaxToDom2::dom_
private

Definition at line 39 of file SaxToDom2.h.

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

Definition at line 38 of file SaxToDom2.h.