10#ifndef INCLUDED_TEST_XMLTESTTOOLS_HXX
11#define INCLUDED_TEST_XMLTESTTOOLS_HXX
16#include <libxml/xmlwriter.h>
17#include <libxml/tree.h>
18#include <libxml/xpath.h>
19#include <libxml/xpathInternals.h>
20#include <libxml/parserInternals.h>
22#include <rtl/string.hxx>
23#include <rtl/ustring.hxx>
28#include <cppunit/TestAssert.h>
47 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
50 xmlXPathObjectPtr getXPathNode(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath);
54 OUString getXPath(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
const OString& rAttribute);
58 OUString getXPathContent(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath);
63 int getXPathPosition(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath, std::string_view rChildName);
67 int countXPathNodes(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath);
72 void assertXPath(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
const OString& rAttribute,
73 const OUString& rExpectedValue);
74 void assertXPathAttrs(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
75 const std::vector<std::pair<OString, OUString>>& aPairVector);
80 void assertXPath(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
int nNumberOfNodes = 1);
84 void assertXPathContent(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
const OUString& rContent);
88 void assertXPathNSDef(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath, std::u16string_view rNSPrefix,
89 std::u16string_view rNSHref);
94 void assertXPathChildren(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
int nNumberOfChildNodes);
98 void assertXPathNoAttribute(
const xmlDocUniquePtr& pXmlDoc,
const OString& rXPath,
const OString& rAttribute);
100 static void registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
101 static void registerOOXMLNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
#define OOO_DLLPUBLIC_TEST
std::unique_ptr< xmlDoc, xmlDocDeleter > xmlDocUniquePtr