diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-11-13 15:38:28 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-12-18 17:21:52 +0100 |
commit | 0e44a69b3546f259cd01bac1a5d10e86b287eb45 (patch) | |
tree | e342f435b08937f9b0664ea9b9c9eaf8541054ba /tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h | |
parent | 159d7230d301f999633eecef25f8569f5e8831b6 (diff) | |
download | qtxmlpatterns-0e44a69b3546f259cd01bac1a5d10e86b287eb45.tar.gz |
Stop using SAX classes for reading XML files
The qtxmlpatterns' tests are using SAX classes for parsing XML files.
These classes will be deprecated.
Replaced QXmlSimpleReader by QDomDocument where applicable.
For the test suite handlers inheriting from QXmlDefaultHandler, introduced
the XmlParseHelper base class, which drives the parsing loop and allows
overriding the methods for handling different XML tokens.
Task-number: QTBUG-76177
Change-Id: Ia1a60c898a272906ede459e95ced7ec95d154fde
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h')
-rw-r--r-- | tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h index 3015d8c..2affbab 100644 --- a/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h +++ b/tests/auto/xmlpatternssdk/XSDTestSuiteHandler.h @@ -30,10 +30,10 @@ #define PatternistSDK_XSDTestSuiteHandler_H #include <QUrl> -#include <QXmlDefaultHandler> #include "ExternalSourceLoader.h" #include "TestSuite.h" +#include "XmlParseHelper.h" #include "XQTSTestCase.h" QT_BEGIN_NAMESPACE @@ -57,7 +57,7 @@ namespace QPatternistSDK * @ingroup PatternistSDK * @author Tobias Koenig <tobias.koenig@nokia.com> */ - class XSDTestSuiteHandler : public QXmlDefaultHandler + class XSDTestSuiteHandler : public XmlParseHelper { public: /** @@ -68,17 +68,14 @@ namespace QPatternistSDK * test groups when loading */ XSDTestSuiteHandler(const QUrl &catalogFile); - virtual bool characters(const QString &ch); + bool characters(const QStringRef &ch) override; - virtual bool endElement(const QString &namespaceURI, - const QString &localName, - const QString &qName); - virtual bool startElement(const QString &namespaceURI, - const QString &localName, - const QString &qName, - const QXmlAttributes &atts); + bool endElement(const QStringRef &namespaceURI, const QStringRef &localName, + const QStringRef &qName) override; + bool startElement(const QStringRef &namespaceURI, const QStringRef &localName, + const QStringRef &qName, const QXmlStreamAttributes &atts) override; - virtual TestSuite *testSuite() const; + TestSuite *testSuite() const; private: TestSuite* m_ts; |