CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

SaxToDom2 Class Reference

#include <SaxToDom2.h>

List of all members.

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 17 of file SaxToDom2.h.


Member Typedef Documentation

typedef XERCES_CPP_NAMESPACE::Attributes SaxToDom2::Attributes

Definition at line 21 of file SaxToDom2.h.

typedef XERCES_CPP_NAMESPACE::SAXParseException SaxToDom2::SAXParseException

Definition at line 22 of file SaxToDom2.h.


Constructor & Destructor Documentation

SaxToDom2::SaxToDom2 ( )

Definition at line 13 of file SaxToDom2.cc.

{ 
  AttList2 al;
  al [ TagName("name") ] = TagName("myTinyDomTest");
  Node2 nm(TagName("TinyDom2"), al);
  parent_.push_back( nm );
}
SaxToDom2::~SaxToDom2 ( )

Definition at line 21 of file SaxToDom2.cc.

{ }

Member Function Documentation

const TinyDom2 & SaxToDom2::dom ( ) const

Definition at line 25 of file SaxToDom2.cc.

{
   return dom_;
}
void SaxToDom2::endElement ( const XMLCh *const  uri,
const XMLCh *const  name,
const XMLCh *const  qname 
)

Definition at line 55 of file SaxToDom2.cc.

{
  parent_.pop_back();
}
void SaxToDom2::error ( const SAXParseException e)

Definition at line 63 of file SaxToDom2.cc.

References dtNoiseDBValidation_cfg::cerr.

{
    cerr << "\nError at file " << StrX(e.getSystemId())
                 << ", line " << e.getLineNumber()
                 << ", char " << e.getColumnNumber()
         << "\n  Message: " << StrX(e.getMessage()) << endl;
}
void SaxToDom2::startElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname,
const Attributes attrs 
)

Definition at line 31 of file SaxToDom2.cc.

References i, StrX::localForm(), and relativeConstraints::value.

{
  StrX strx(name); // element-name
  AttList2 al;

  for (unsigned int i = 0; i < atts.getLength(); ++i)
    {
      const XMLCh* aname = atts.getLocalName(i);
      const XMLCh* value = atts.getValue(i);
      al[TagName((StrX(aname).localForm()))]=TagName(StrX(value).localForm());
    }

  // add the new element to the dom-tree
  Node2 nm(TagName(strx.localForm()) , al);
  Node2 par = parent_.back();
  dom_.addEdge(par, nm, AnotherDummy2());

  parent_.push_back(nm);
}

Member Data Documentation

Definition at line 37 of file SaxToDom2.h.

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

Definition at line 36 of file SaxToDom2.h.