#include <structuredocumenthandler.h>
Public Member Functions | |
| StructureDocumentHandler (StructureHandler *pHandler) | |
| Constructor. | |
| ~StructureDocumentHandler () | |
| Destructor. | |
| void | startElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &atts) |
| This method is called when an element is started. | |
| void | endElement (const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) |
| This method is called when an element is ended. | |
| void | characters (const XMLCh *const chars, const unsigned int length) |
| This method is called when characters data inside an element are found. | |
| void | fatalError (const SAXParseException &exc) |
| Reports a fatal XML parsing error. | |
| SAXParseException * | getParsingException () const |
| It returns exception caught during parsing, null if nothing was caught. | |
| bool | isError () const |
| It tells if an error occurs during parsing. true If an error occurs during parsing, false otherwise. | |
Protected Attributes | |
| ostringstream | m_Buffer |
| Buffer used to read character data. | |
| int | m_iNestedDepth |
| Nested depth reached. | |
| int | m_iContextDepth |
| Last depth reached when handler have switched. | |
| StructureHandler * | m_pHandler |
| Current handler used to parse XML document. | |
| stack< HandlerContext * > | m_ContextStack |
| Stack containing the list of HandlerContext. | |
| SAXParseException * | m_pException |
| Exception caught during parsing. | |
| bool | m_bParsingError |
| Parsing error. true If an error occurs during parsing, false otherwise. | |
It used different StructureHandler object to parse the XML document. Each time, it meets a new element, we get the StructureHandler object able to parse this structure. The new StructureHandler is given by the current StructureHandler used. If we need to switch to a new StructureHandler, we save the context of the current StructureHandler, and switch to the new one. And so on. When it meets the end of an element which makes a switch, we restore the previous one thanks to a call stack.
Yves Houpert <yves.houpert@insa-rouen.fr>
|
|
Constructor.
|
|
||||||||||||
|
This method is called when characters data inside an element are found.
|
|
||||||||||||||||
|
This method is called when an element is ended.
|
|
|
Reports a fatal XML parsing error.
|
|
|
It returns exception caught during parsing, null if nothing was caught.
|
|
||||||||||||||||||||
|
This method is called when an element is started.
|
|
|
Stack containing the list of HandlerContext. This stack is used to set a previous handler. |
|
|
Nested depth reached. It corresponds to the number of element still open. |
1.4.6