2 #include "XmlStackedHandler.h" 6 #include <QXmlParseException> 8 #include "XmlStackedHandlerReader.h" 11 XmlStackedHandler::XmlStackedHandler() {
17 XmlStackedHandler::~XmlStackedHandler() {
23 void XmlStackedHandler::setReader(XmlStackedHandlerReader *reader) {
33 nextHandler->startElement(m_lastStartNamespaceURI, m_lastStartLocalName,
34 m_lastStartQName, m_lastStartAtts);
38 bool XmlStackedHandler::startElement(
const QString &namespaceURI,
const QString &localName,
39 const QString &qName,
const QXmlAttributes &atts) {
40 m_lastStartNamespaceURI = namespaceURI;
41 m_lastStartLocalName = localName;
42 m_lastStartQName = qName;
43 m_lastStartAtts = atts;
49 bool XmlStackedHandler::endElement(
const QString &namespaceURI,
const QString &localName,
50 const QString &qName) {
54 if (m_depth == 0 && reader()) {
55 reader()->popContentHandler();
57 if (reader()->topContentHandler())
58 reader()->topContentHandler()->endElement(namespaceURI, localName, qName);
64 XmlStackedHandlerReader *XmlStackedHandler::reader() {
69 const XmlStackedHandlerReader *XmlStackedHandler::reader()
const {
74 bool XmlStackedHandler::fatalError(
const QXmlParseException &exception) {
75 qDebug() <<
"Parse error at line " << exception.lineNumber()
76 <<
", " <<
"column " << exception.columnNumber() <<
": " 77 << qPrintable(exception.message());
XML Handler that parses XMLs in a stack-oriented way.
void switchToNewHandler(XmlStackedHandler *nextHandler)
Switch to a new content handler and continue processing using the new handler.
Namespace for ISIS/Bullet specific routines.