TBParser subclass that uses a SAX parser in the XERCES library. More...
#include <TBParser.h>
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. | |
std::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. | |
std::map< int, std::vector < TBKeyword * > * > | colkws |
Keep all parsed column keywords. | |
bool | parsedata |
Is true if the table data should be parsed, false otherwise. |
TBParser subclass that uses a SAX parser in the XERCES library.
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 221 of file TBParser.h.
casa::TBXercesSAXParser::TBXercesSAXParser | ( | TableParams * | tp | ) |
Constructor that takes the table parameters.
virtual casa::TBXercesSAXParser::~TBXercesSAXParser | ( | ) | [virtual] |
void casa::TBXercesSAXParser::characters | ( | const XMLCh *const | chars, | |
const unsigned int | length | |||
) |
Implements DefaultHandler::characters().
void casa::TBXercesSAXParser::endDocument | ( | ) |
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.
void casa::TBXercesSAXParser::startDocument | ( | ) |
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().
std::map<int, std::vector<TBKeyword*>*> casa::TBXercesSAXParser::colkws [private] |
Keep all parsed column keywords.
Definition at line 267 of file TBParser.h.
stringstream casa::TBXercesSAXParser::extraText [private] |
Keeps all non-XML or extra text.
Definition at line 261 of file TBParser.h.
bool casa::TBXercesSAXParser::inTD [private] |
Flag indicating whether the parsing is currently in a tag or not.
Definition at line 255 of file TBParser.h.
bool casa::TBXercesSAXParser::parsedata [private] |
Is true if the table data should be parsed, false otherwise.
Definition at line 270 of file TBParser.h.
SAX2XMLReader* casa::TBXercesSAXParser::reader [private] |
SAX reader.
Definition at line 252 of file TBParser.h.
std::vector<String>* casa::TBXercesSAXParser::row [private] |
The current row of table data being parsed.
Definition at line 258 of file TBParser.h.
bool casa::TBXercesSAXParser::valid [private] |
Indicates whether the parsing is valid or not.
Definition at line 264 of file TBParser.h.