casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
casa::TBXercesSAXParser Class Reference

TBParser subclass that uses a SAX parser in the XERCES library. More...

#include <TBParser.h>

Inheritance diagram for casa::TBXercesSAXParser:
casa::TBParser

List of all members.

Public Member Functions

 TBXercesSAXParser (TableParams *tp)
 Constructor that takes the table parameters.
virtual ~TBXercesSAXParser ()
Result parse (String *xml, bool parsedata=true)
 Implements TBParser::parse().
void startDocument ()
 Implements DefaultHandler::startDocument().
void endDocument ()
 Implements DefaultHandler::endDocument().
void startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs)
 Implements DefaultHandler::startElement().
void endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
 Implements DefaultHandler::endElement().
void characters (const XMLCh *const chars, const unsigned int length)
 Implements DefaultHandler::characters().

Private Attributes

SAX2XMLReader * reader
 SAX reader.
bool inTD
 Flag indicating whether the parsing is currently in a tag or not.
vector< String > * row
 The current row of table data being parsed.
stringstream extraText
 Keeps all non-XML or extra text.
bool valid
 Indicates whether the parsing is valid or not.
map< int, vector< TBKeyword * > * > colkws
 Keep all parsed column keywords.
bool parsedata
 Is true if the table data should be parsed, false otherwise.

Detailed Description

TBParser subclass that uses a SAX parser in the XERCES library.

Synopsis

TBXercesSAXParser is a subclass of TBParser that implements all the parsing methods using a XERCES SAX parser. If XML parsing is required, the TBXercesSAXParser is recommended for its (relative) speed. TBXercesSAXParser also implements xerces::DefaultHandler since SAX uses event-driven parsing.

Definition at line 222 of file TBParser.h.


Constructor & Destructor Documentation

Constructor that takes the table parameters.


Member Function Documentation

void casa::TBXercesSAXParser::characters ( const XMLCh *const  chars,
const unsigned int  length 
)

Implements DefaultHandler::characters().

Implements DefaultHandler::endDocument().

void casa::TBXercesSAXParser::endElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname 
)

Implements DefaultHandler::endElement().

Result casa::TBXercesSAXParser::parse ( String xml,
bool  parsedata = true 
) [virtual]

Implements TBParser::parse().

Parses the String into the table data serially using event-driven SAX parsing.

Implements casa::TBParser.

Implements DefaultHandler::startDocument().

void casa::TBXercesSAXParser::startElement ( const XMLCh *const  uri,
const XMLCh *const  localname,
const XMLCh *const  qname,
const Attributes &  attrs 
)

Implements DefaultHandler::startElement().


Member Data Documentation

map<int, vector<TBKeyword*>*> casa::TBXercesSAXParser::colkws [private]

Keep all parsed column keywords.

Definition at line 268 of file TBParser.h.

stringstream casa::TBXercesSAXParser::extraText [private]

Keeps all non-XML or extra text.

Definition at line 262 of file TBParser.h.

Flag indicating whether the parsing is currently in a tag or not.

Definition at line 256 of file TBParser.h.

Is true if the table data should be parsed, false otherwise.

Definition at line 271 of file TBParser.h.

SAX2XMLReader* casa::TBXercesSAXParser::reader [private]

SAX reader.

Definition at line 253 of file TBParser.h.

The current row of table data being parsed.

Definition at line 259 of file TBParser.h.

Indicates whether the parsing is valid or not.

Definition at line 265 of file TBParser.h.


The documentation for this class was generated from the following file: