test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 15 of file SaxToDom.h.

Member Typedef Documentation

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.

Constructor & Destructor Documentation

SaxToDom::SaxToDom ( )

Definition at line 13 of file SaxToDom.cc.

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

Definition at line 16 of file SaxToDom.cc.

17 { }

Member Function Documentation

const TinyDom & SaxToDom::dom ( ) const

Definition at line 20 of file SaxToDom.cc.

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

Definition at line 50 of file SaxToDom.cc.

53 {
54  parent_.pop_back();
55 }
std::vector< NodeName > parent_
Definition: SaxToDom.h:33
void SaxToDom::error ( const SAXParseException e)
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.

30 {
31  StrX strx(name); // element-name
32  NodeName nm(string(strx.localForm())); // as a temp.string
33  //parent_.push_back(nm);
34  AttList al; // map of attributes -> values
35  for (unsigned int i = 0; i < atts.getLength(); ++i) {
36  const XMLCh* aname = atts.getLocalName(i);
37  const XMLCh* value = atts.getValue(i);
38  // fill the tiny-dom-attribute-list (i.e. the map)
39  al[NodeName((StrX(aname).localForm()))]=NodeName(StrX(value).localForm());
40  //cout << " att=" << StrX(aname) << " val=" << StrX(value) << endl;
41  }
42  // add the new element to the dom-tree
43  dom_.addEdge(parent_.back(), nm , al);
44  //cout << "add from=" << parent_.back().str() << " to=" << nm.str() << endl;
45  // set the parent_ to the actual node
46  parent_.push_back(nm);
47 }
int i
Definition: DBlmapReader.cc:9
Definition: TagName.h:9
Definition: StrX.h:32
TinyDom dom_
Definition: SaxToDom.h:34
TagName NodeName
Definition: TinyDom.h:13
std::map< AttName, AttValue > AttList
Definition: TinyDom.h:16
std::vector< NodeName > parent_
Definition: SaxToDom.h:33
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 34 of file SaxToDom.h.

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

Definition at line 33 of file SaxToDom.h.