xmlChildElementCount is only available in libxml2 >= 2.7.3

fixes build error Undefined symbols: _xmlChildElementCount

Change-Id: I9687971912b4d0ae55bf1d9ad987fd339fcbec7e
Reviewed-on: https://gerrit.libreoffice.org/9788
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Douglas Mencken 2014-06-15 08:39:00 -04:00 committed by Caolán McNamara
parent 61df5e69df
commit ca4f1929ce

View file

@ -98,6 +98,7 @@ void XmlTestTools::assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath,
void XmlTestTools::assertXPathChildren(xmlDocPtr pXmlDoc, const OString& rXPath, int nNumberOfChildNodes)
{
#if LIBXML_VERSION >= 20703 /* xmlChildElementCount is only available in libxml2 >= 2.7.3 */
xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
@ -106,6 +107,11 @@ void XmlTestTools::assertXPathChildren(xmlDocPtr pXmlDoc, const OString& rXPath,
CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("XPath '" + rXPath + "' number of child-nodes is incorrect").getStr(),
nNumberOfChildNodes, (int)xmlChildElementCount(pXmlNode));
xmlXPathFreeObject(pXmlObj);
#else
(void)pXmlDoc;
(void)rXPath;
(void)nNumberOfChildNodes;
#endif
}
int XmlTestTools::getXPathPosition(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rChildName)