summaryrefslogtreecommitdiff
path: root/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-11-13 15:38:28 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2019-12-18 17:21:52 +0100
commit0e44a69b3546f259cd01bac1a5d10e86b287eb45 (patch)
treee342f435b08937f9b0664ea9b9c9eaf8541054ba /tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h
parent159d7230d301f999633eecef25f8569f5e8831b6 (diff)
downloadqtxmlpatterns-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/XSLTTestSuiteHandler.h')
-rw-r--r--tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h
index 231b55d..b5879c1 100644
--- a/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h
+++ b/tests/auto/xmlpatternssdk/XSLTTestSuiteHandler.h
@@ -31,10 +31,10 @@
#include <QStack>
#include <QUrl>
-#include <QXmlDefaultHandler>
#include "ExternalSourceLoader.h"
#include "TestSuite.h"
+#include "XmlParseHelper.h"
#include "XQTSTestCase.h"
QT_BEGIN_NAMESPACE
@@ -59,7 +59,7 @@ namespace QPatternistSDK
* @ingroup PatternistSDK
* @author Frans Englich <frans.englich@nokia.com>
*/
- class XSLTTestSuiteHandler : public QXmlDefaultHandler
+ class XSLTTestSuiteHandler : public XmlParseHelper
{
public:
/**
@@ -70,17 +70,14 @@ namespace QPatternistSDK
* test groups when loading
*/
XSLTTestSuiteHandler(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:
TestGroup *containerFor(const QString &name);