1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/xmltesttools.hxx>
14 #include <vcl/mtfxmldump.hxx>
15 #include <sal/log.hxx>
16 #include <test/cppunitasserthelper.hxx>
20 OUString
convert(xmlChar
const * string
) {
22 CPPUNIT_ASSERT_MESSAGE(
23 "xmlChar string is not UTF-8",
24 rtl_convertStringToUString(
25 &s
.pData
, reinterpret_cast<char const *>(string
), xmlStrlen(string
),
26 RTL_TEXTENCODING_UTF8
,
27 (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
28 | RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR
29 | RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR
)));
33 OString
oconvert(xmlChar
const * string
)
35 return reinterpret_cast<char const *>(string
);
40 XmlTestTools::XmlTestTools()
43 XmlTestTools::~XmlTestTools()
46 xmlDocUniquePtr
XmlTestTools::parseXml(utl::TempFileNamed
const & aTempFile
)
48 SvFileStream
aFileStream(aTempFile
.GetURL(), StreamMode::READ
);
49 return parseXmlStream(&aFileStream
);
52 xmlDocUniquePtr
XmlTestTools::parseXmlStream(SvStream
* pStream
)
54 std::size_t nSize
= pStream
->remainingSize();
55 std::unique_ptr
<sal_uInt8
[]> pBuffer(new sal_uInt8
[nSize
+ 1]);
56 pStream
->ReadBytes(pBuffer
.get(), nSize
);
58 auto pCharBuffer
= reinterpret_cast<xmlChar
*>(pBuffer
.get());
59 SAL_INFO("test", "XmlTestTools::parseXmlStream: pBuffer is '" << pCharBuffer
<< "'");
60 return xmlDocUniquePtr(xmlParseDoc(pCharBuffer
));
63 xmlDocUniquePtr
XmlTestTools::dumpAndParse(MetafileXmlDump
& rDumper
, const GDIMetaFile
& rGDIMetaFile
)
65 SvMemoryStream aStream
;
66 rDumper
.dump(rGDIMetaFile
, aStream
);
67 aStream
.Seek(STREAM_SEEK_TO_BEGIN
);
68 return XmlTestTools::parseXmlStream(&aStream
);
71 xmlXPathObjectPtr
XmlTestTools::getXPathNode(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
)
73 xmlXPathContextPtr pXmlXpathCtx
= xmlXPathNewContext(pXmlDoc
.get());
74 registerNamespaces(pXmlXpathCtx
);
75 xmlXPathObjectPtr pXmlXpathObj
= xmlXPathEvalExpression(BAD_CAST(pXPath
), pXmlXpathCtx
);
76 xmlXPathFreeContext(pXmlXpathCtx
);
80 void XmlTestTools::registerNamespaces(xmlXPathContextPtr
& pXmlXpathCtx
)
83 XmlTestTools::registerOOXMLNamespaces(pXmlXpathCtx
);
85 XmlTestTools::registerODFNamespaces(pXmlXpathCtx
);
87 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("reqif-xhtml"), BAD_CAST("http://www.w3.org/1999/xhtml"));
90 OUString
XmlTestTools::getXPath(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, const char* pAttribute
)
92 CPPUNIT_ASSERT(pXmlDoc
);
93 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
94 OString docAndXPath
= OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
;
95 CPPUNIT_ASSERT_MESSAGE(docAndXPath
.getStr(), pXmlObj
);
96 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
97 CPPUNIT_ASSERT_MESSAGE(OString(docAndXPath
+ "' not found").getStr(), pXmlNodes
);
98 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(docAndXPath
+ "' number of nodes is incorrect").getStr(),
99 1, xmlXPathNodeSetGetLength(pXmlNodes
));
100 CPPUNIT_ASSERT(pAttribute
);
101 CPPUNIT_ASSERT(pAttribute
[0]);
102 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
103 xmlChar
* prop
= xmlGetProp(pXmlNode
, BAD_CAST(pAttribute
));
104 OString sAttAbsent
= docAndXPath
+ "' no attribute '" + pAttribute
+ "' exist";
105 CPPUNIT_ASSERT_MESSAGE(sAttAbsent
.getStr(), prop
);
106 OUString
s(convert(prop
));
108 xmlXPathFreeObject(pXmlObj
);
112 OUString
XmlTestTools::getXPathContent(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
)
114 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
115 switch (pXmlObj
->type
)
117 case XPATH_UNDEFINED
:
118 CPPUNIT_FAIL("Undefined XPath type");
121 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
123 CPPUNIT_ASSERT_MESSAGE(
124 OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' not found")
126 xmlXPathNodeSetGetLength(pXmlNodes
) > 0);
128 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
129 OUString s
= convert(xmlNodeGetContent(pXmlNode
));
130 xmlXPathFreeObject(pXmlObj
);
135 auto boolVal
= pXmlObj
->boolval
;
136 xmlXPathFreeObject(pXmlObj
);
137 return boolVal
? u
"true"_ustr
: u
"false"_ustr
;
141 auto floatVal
= pXmlObj
->floatval
;
142 xmlXPathFreeObject(pXmlObj
);
143 return OUString::number(floatVal
);
147 auto convertedVal
= convert(pXmlObj
->stringval
);
148 xmlXPathFreeObject(pXmlObj
);
151 #if LIBXML_VERSION < 21000 || defined(LIBXML_XPTR_LOCS_ENABLED)
154 case XPATH_LOCATIONSET
:
157 case XPATH_XSLT_TREE
:
158 xmlXPathFreeObject(pXmlObj
);
159 CPPUNIT_FAIL("Unsupported XPath type");
162 CPPUNIT_FAIL("Invalid XPath type");
165 void XmlTestTools::assertXPath(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, const char* pAttribute
, std::u16string_view rExpectedValue
)
167 OUString aValue
= getXPath(pXmlDoc
, pXPath
, pAttribute
);
168 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, attribute '" + pAttribute
+ "' of '" + pXPath
+ "' incorrect value.").getStr(),
169 rExpectedValue
, std::u16string_view(aValue
));
172 void XmlTestTools::assertXPathDoubleValue(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, const char* pAttribute
, double expectedValue
, double delta
)
174 OUString aValue
= getXPath(pXmlDoc
, pXPath
, pAttribute
);
175 double pathValue
= aValue
.toDouble();
176 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(std::string("In <") + std::string(pXmlDoc
->name
? pXmlDoc
->name
: "") + ">, attribute '" + std::string(pAttribute
) + "' of '" + std::string(pXPath
) + "' incorrect value.",
177 expectedValue
, pathValue
, delta
);
180 void XmlTestTools::assertXPathAttrs(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
,
181 const std::vector
<std::pair
<const char*, std::u16string_view
>>& aPairVector
)
183 for (auto& rPair
: aPairVector
)
185 assertXPath(pXmlDoc
, pXPath
, rPair
.first
, rPair
.second
);
189 int XmlTestTools::countXPathNodes(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
)
191 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
192 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
193 const int n
= xmlXPathNodeSetGetLength(pXmlNodes
);
194 xmlXPathFreeObject(pXmlObj
);
198 void XmlTestTools::assertXPath(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, int nNumberOfNodes
)
200 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of nodes is incorrect").getStr(),
201 nNumberOfNodes
, countXPathNodes(pXmlDoc
, pXPath
));
204 void XmlTestTools::assertXPathContent(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, std::u16string_view rContent
)
206 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath contents of child does not match").getStr(), rContent
, std::u16string_view(getXPathContent(pXmlDoc
, pXPath
)));
209 void XmlTestTools::assertXPathNSDef(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
,
210 std::string_view rNSPrefix
, std::string_view rNSHref
)
212 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
213 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
214 CPPUNIT_ASSERT_MESSAGE(
215 OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' not found").getStr(),
216 xmlXPathNodeSetGetLength(pXmlNodes
) > 0);
218 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
220 for (xmlNsPtr pNamespace
= pXmlNode
->nsDef
; pNamespace
; pNamespace
= pNamespace
->next
)
222 if (!pNamespace
->prefix
)
225 CPPUNIT_ASSERT(pNamespace
->href
);
226 if (rNSPrefix
== oconvert(pNamespace
->prefix
) && rNSHref
== oconvert(pNamespace
->href
))
232 xmlXPathFreeObject(pXmlObj
);
233 CPPUNIT_ASSERT(bFound
);
236 void XmlTestTools::assertXPathChildren(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, int nNumberOfChildNodes
)
238 #if LIBXML_VERSION >= 20703 /* xmlChildElementCount is only available in libxml2 >= 2.7.3 */
239 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
240 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
241 CPPUNIT_ASSERT(pXmlNodes
);
242 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of nodes is incorrect").getStr(),
243 1, xmlXPathNodeSetGetLength(pXmlNodes
));
244 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
245 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of child-nodes is incorrect").getStr(),
246 nNumberOfChildNodes
, static_cast<int>(xmlChildElementCount(pXmlNode
)));
247 xmlXPathFreeObject(pXmlObj
);
251 (void)nNumberOfChildNodes
;
255 void XmlTestTools::assertXPathNoAttribute(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, const char* pAttribute
)
257 CPPUNIT_ASSERT_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' unexpected '" + pAttribute
+ "' attribute").getStr(),
258 !hasXPathAttribute(pXmlDoc
, pXPath
, pAttribute
));
261 bool XmlTestTools::hasXPathAttribute(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
,
262 const char* pAttribute
)
264 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
265 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
266 CPPUNIT_ASSERT(pXmlNodes
);
267 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of nodes is incorrect").getStr(),
268 1, xmlXPathNodeSetGetLength(pXmlNodes
));
269 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
270 bool bFound(xmlGetProp(pXmlNode
, BAD_CAST(pAttribute
)));
271 xmlXPathFreeObject(pXmlObj
);
275 int XmlTestTools::getXPathPosition(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
, const char* pChildName
)
277 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
278 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
279 CPPUNIT_ASSERT(pXmlNodes
);
280 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of nodes is incorrect").getStr(),
282 xmlXPathNodeSetGetLength(pXmlNodes
));
283 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
286 for (xmlNodePtr pChild
= pXmlNode
->children
; pChild
; pChild
= pChild
->next
)
288 if (oconvert(pChild
->name
) == pChildName
)
295 xmlXPathFreeObject(pXmlObj
);
296 CPPUNIT_ASSERT_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
297 + "' child '" + pChildName
+ "' not found")
303 void XmlTestTools::assertXPathNodeName(const xmlDocUniquePtr
& pXmlDoc
, const char* pXPath
,
304 std::string_view rExpectedName
)
306 xmlXPathObjectPtr pXmlObj
= getXPathNode(pXmlDoc
, pXPath
);
307 CPPUNIT_ASSERT(pXmlObj
);
308 xmlNodeSetPtr pXmlNodes
= pXmlObj
->nodesetval
;
309 CPPUNIT_ASSERT(pXmlNodes
);
310 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc
->name
+ ">, XPath '" + pXPath
+ "' number of nodes is incorrect").getStr(),
312 xmlXPathNodeSetGetLength(pXmlNodes
));
313 xmlNodePtr pXmlNode
= pXmlNodes
->nodeTab
[0];
314 CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In XPath '") + pXPath
+ "' name of node is incorrect").getStr(),
315 rExpectedName
, std::string_view(oconvert(pXmlNode
->name
)));
316 xmlXPathFreeObject(pXmlObj
);
319 void XmlTestTools::registerODFNamespaces(xmlXPathContextPtr
& pXmlXpathCtx
)
321 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("manifest"),
322 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"));
323 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("office"),
324 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:office:1.0"));
325 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("style"),
326 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:style:1.0"));
327 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("text"),
328 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0"));
329 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("table"),
330 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0"));
331 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("draw"),
332 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"));
333 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("fo"),
334 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"));
335 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("config"),
336 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:config:1.0"));
337 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xlink"), BAD_CAST("http://www.w3.org/1999/xlink"));
338 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("dc"), BAD_CAST("http://purl.org/dc/elements/1.1/"));
339 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("meta"),
340 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:meta:1.0"));
341 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("number"),
342 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"));
343 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("svg"),
344 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"));
345 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("chart"),
346 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:chart:1.0"));
347 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("dr3d"),
348 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"));
349 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("math"),
350 BAD_CAST("http://www.w3.org/1998/Math/MathML"));
351 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("form"),
352 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:form:1.0"));
353 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("script"),
354 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:script:1.0"));
355 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("ooo"),
356 BAD_CAST("http://openoffice.org/2004/office"));
357 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("ooow"),
358 BAD_CAST("http://openoffice.org/2004/writer"));
359 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("oooc"), BAD_CAST("http://openoffice.org/2004/calc"));
360 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("dom"),
361 BAD_CAST("http://www.w3.org/2001/xml-events"));
362 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xforms"), BAD_CAST("http://www.w3.org/2002/xforms"));
363 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xsd"), BAD_CAST("http://www.w3.org/2001/XMLSchema"));
364 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xsi"),
365 BAD_CAST("http://www.w3.org/2001/XMLSchema-instance"));
366 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("rpt"),
367 BAD_CAST("http://openoffice.org/2005/report"));
368 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("of"),
369 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:of:1.2"));
370 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xhtml"), BAD_CAST("http://www.w3.org/1999/xhtml"));
371 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("grddl"),
372 BAD_CAST("http://www.w3.org/2003/g/data-view#"));
373 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("officeooo"),
374 BAD_CAST("http://openoffice.org/2009/office"));
375 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("tableooo"),
376 BAD_CAST("http://openoffice.org/2009/table"));
377 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("drawooo"),
378 BAD_CAST("http://openoffice.org/2010/draw"));
380 pXmlXpathCtx
, BAD_CAST("calcext"),
381 BAD_CAST("urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"));
383 pXmlXpathCtx
, BAD_CAST("loext"),
384 BAD_CAST("urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"));
386 pXmlXpathCtx
, BAD_CAST("field"),
387 BAD_CAST("urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"));
389 pXmlXpathCtx
, BAD_CAST("formx"),
390 BAD_CAST("urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"));
391 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("css3t"),
392 BAD_CAST("http://www.w3.org/TR/css3-text/"));
393 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("anim"),
394 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:animation:1.0"));
395 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("smil"),
396 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"));
397 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("presentation"),
398 BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"));
400 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("foo"),
401 BAD_CAST("http://example.com/"));
404 void XmlTestTools::registerOOXMLNamespaces(xmlXPathContextPtr
& pXmlXpathCtx
)
406 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("w"),
407 BAD_CAST("http://schemas.openxmlformats.org/wordprocessingml/2006/main"));
408 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("v"), BAD_CAST("urn:schemas-microsoft-com:vml"));
409 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("mc"),
410 BAD_CAST("http://schemas.openxmlformats.org/markup-compatibility/2006"));
412 pXmlXpathCtx
, BAD_CAST("wps"),
413 BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingShape"));
415 pXmlXpathCtx
, BAD_CAST("wpg"),
416 BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"));
418 pXmlXpathCtx
, BAD_CAST("wp"),
419 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"));
421 pXmlXpathCtx
, BAD_CAST("wp14"),
422 BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
423 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("a"),
424 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/main"));
425 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("pic"),
426 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/picture"));
427 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("rels"),
428 BAD_CAST("http://schemas.openxmlformats.org/package/2006/relationships"));
429 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("w14"),
430 BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordml"));
431 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("w15"),
432 BAD_CAST("http://schemas.microsoft.com/office/word/2012/wordml"));
433 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("m"),
434 BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/math"));
435 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("ContentType"),
436 BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types"));
437 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("lc"),
438 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"));
440 pXmlXpathCtx
, BAD_CAST("cp"),
441 BAD_CAST("http://schemas.openxmlformats.org/package/2006/metadata/core-properties"));
443 pXmlXpathCtx
, BAD_CAST("extended-properties"),
444 BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"));
446 pXmlXpathCtx
, BAD_CAST("custom-properties"),
447 BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"));
449 pXmlXpathCtx
, BAD_CAST("vt"),
450 BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"));
451 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("dcterms"), BAD_CAST("http://purl.org/dc/terms/"));
452 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("a14"),
453 BAD_CAST("http://schemas.microsoft.com/office/drawing/2010/main"));
454 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("c"),
455 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/chart"));
456 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("x"),
457 BAD_CAST("http://schemas.openxmlformats.org/spreadsheetml/2006/main"));
458 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("r"),
459 BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/relationships"));
460 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xx"),
461 BAD_CAST("urn:schemas-microsoft-com:office:excel"));
462 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xdr"),
463 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"));
464 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("x14"),
465 BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"));
466 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xm"),
467 BAD_CAST("http://schemas.microsoft.com/office/excel/2006/main"));
468 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("x12ac"),
469 BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac"));
470 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("o"),
471 BAD_CAST("urn:schemas-microsoft-com:office:office"));
472 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("w10"),
473 BAD_CAST("urn:schemas-microsoft-com:office:word"));
474 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("p"),
475 BAD_CAST("http://schemas.openxmlformats.org/presentationml/2006/main"));
476 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("p14"),
477 BAD_CAST("http://schemas.microsoft.com/office/powerpoint/2010/main"));
478 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("dgm"),
479 BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/diagram"));
480 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("c15"),
481 BAD_CAST("http://schemas.microsoft.com/office/drawing/2012/chart"));
482 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xr2"),
483 BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"));
484 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("xr16"),
485 BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2017/revision16"));
486 xmlXPathRegisterNs(pXmlXpathCtx
, BAD_CAST("asvg"),
487 BAD_CAST("http://schemas.microsoft.com/office/drawing/2016/SVG/main"));
490 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */