casa
$Rev:20696$
|
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. | |
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. |
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 222 of file TBParser.h.
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.
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().
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.
bool casa::TBXercesSAXParser::inTD [private] |
Flag indicating whether the parsing is currently in a tag or not.
Definition at line 256 of file TBParser.h.
bool casa::TBXercesSAXParser::parsedata [private] |
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.
vector<String>* casa::TBXercesSAXParser::row [private] |
The current row of table data being parsed.
Definition at line 259 of file TBParser.h.
bool casa::TBXercesSAXParser::valid [private] |
Indicates whether the parsing is valid or not.
Definition at line 265 of file TBParser.h.