summaryrefslogtreecommitdiff
path: root/tools/qa
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-01-17 00:08:08 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-01-17 01:07:29 +0100
commitcd65d6c06760caf0109664d2a320cfb29d634ab2 (patch)
treece825ea5ba5bc86ae6e9b2c38cfe06e546df3452 /tools/qa
parenteecedf21f4869dd52a6498377e35d85d2321ac80 (diff)
tools: support reading xml namespace with XmlWalker
Adds methods namespaceHref and namespacePrefix for reading the current element's namespace prefix and the href. Change-Id: I1c16857c6fc0bdfde2d983d8f42f153111119029 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109442 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'tools/qa')
-rw-r--r--tools/qa/cppunit/test_xmlwalker.cxx5
-rw-r--r--tools/qa/data/test.xml2
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_xmlwalker.cxx b/tools/qa/cppunit/test_xmlwalker.cxx
index 9f442c73c347..ec0a695b62d1 100644
--- a/tools/qa/cppunit/test_xmlwalker.cxx
+++ b/tools/qa/cppunit/test_xmlwalker.cxx
@@ -74,6 +74,11 @@ void XmlWalkerTest::testReadXML()
}
aWalker.parent();
}
+ else if (aWalker.name() == "with-namespace")
+ {
+ CPPUNIT_ASSERT_EQUAL(OString("adobe:ns:meta/"), aWalker.namespaceHref());
+ CPPUNIT_ASSERT_EQUAL(OString("xx"), aWalker.namespacePrefix());
+ }
aWalker.next();
}
aWalker.parent();
diff --git a/tools/qa/data/test.xml b/tools/qa/data/test.xml
index 7a0473d7f8f9..c2736e8bb6ac 100644
--- a/tools/qa/data/test.xml
+++ b/tools/qa/data/test.xml
@@ -8,4 +8,6 @@
</child>
<child number="3">
</child>
+ <xx:with-namespace xmlns:xx="adobe:ns:meta/">
+ </xx:with-namespace>
</root>