CMS 3D CMS Logo

SaxToDom Class Reference

#include <DetectorDescription/RegressionTest/src/SaxToDom.h>

List of all members.

Public Types

typedef xercesc_2_7::Attributes Attributes
typedef
xercesc_2_7::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 14 of file SaxToDom.h.


Member Typedef Documentation

typedef xercesc_2_7::Attributes SaxToDom::Attributes

Definition at line 17 of file SaxToDom.h.

typedef xercesc_2_7::SAXParseException SaxToDom::SAXParseException

Definition at line 18 of file SaxToDom.h.


Constructor & Destructor Documentation

SaxToDom::SaxToDom (  ) 

Definition at line 13 of file SaxToDom.cc.

References parent_.

00014 { parent_.push_back(NodeName("TinyDom")); }

SaxToDom::~SaxToDom (  ) 

Definition at line 16 of file SaxToDom.cc.

00017 { }


Member Function Documentation

const TinyDom & SaxToDom::dom (  )  const

Definition at line 20 of file SaxToDom.cc.

References dom_.

00021 {
00022    return dom_;
00023 }

void SaxToDom::endElement ( const XMLCh *const   uri,
const XMLCh *const   name,
const XMLCh *const   qname 
)

Definition at line 50 of file SaxToDom.cc.

References parent_.

00053 {
00054   parent_.pop_back();
00055 }

void SaxToDom::error ( const SAXParseException e  ) 

Definition at line 58 of file SaxToDom.cc.

References TestMuL1L2Filter_cff::cerr, and lat::endl().

00059 {
00060     cerr << "\nError at file " << StrX(e.getSystemId())
00061                  << ", line " << e.getLineNumber()
00062                  << ", char " << e.getColumnNumber()
00063          << "\n  Message: " << StrX(e.getMessage()) << endl;
00064 }

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 graph< N, E >::addEdge(), dom_, i, StrX::localForm(), parent_, and value.

00030 {
00031   StrX strx(name); // element-name
00032   NodeName nm(string(strx.localForm())); // as a temp.string
00033   //parent_.push_back(nm);
00034   AttList al; // map of attributes -> values
00035   for (unsigned int i = 0; i < atts.getLength(); ++i) {
00036     const XMLCh* aname = atts.getLocalName(i);
00037     const XMLCh* value = atts.getValue(i);
00038     // fill the tiny-dom-attribute-list (i.e. the map)
00039     al[NodeName((StrX(aname).localForm()))]=NodeName(StrX(value).localForm());
00040     //cout << "  att=" << StrX(aname) << " val=" << StrX(value) << endl;
00041   }  
00042   // add the new element to the dom-tree
00043   dom_.addEdge(parent_.back(), nm , al);
00044   //cout << "add from=" << parent_.back().str() << " to=" << nm.str() << endl;
00045   // set the parent_ to the actual node
00046   parent_.push_back(nm);
00047 }


Member Data Documentation

TinyDom SaxToDom::dom_ [private]

Definition at line 33 of file SaxToDom.h.

Referenced by dom(), and startElement().

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

Definition at line 32 of file SaxToDom.h.

Referenced by endElement(), SaxToDom(), and startElement().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:14 2009 for CMSSW by  doxygen 1.5.4