Description: use older branch of libxml++
 This essentially reverts upstream git commit 13783b7.
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2024-11-30
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Core/PinotSettings.cpp
+++ b/Core/PinotSettings.cpp
@@ -61,7 +61,11 @@
 		return "";
 	}
 
-	const TextNode *pText = pElem->get_first_child_text();
+#ifdef HAS_LIBXMLPP026
+	const TextNode *pText = pElem->get_child_content();
+#else
+	const TextNode *pText = pElem->get_child_text();
+#endif
 	if (pText == NULL)
 	{
 		return "";
@@ -77,10 +81,14 @@
 		return NULL;
 	}
 
-	Element *pSubElem = pElem->add_child_element(nodeName);
+	Element *pSubElem = pElem->add_child(nodeName);
 	if (pSubElem != NULL)
 	{
-		pSubElem->set_first_child_text(nodeContent);
+#ifdef HAS_LIBXMLPP026
+		pSubElem->set_child_content(nodeContent);
+#else
+		pSubElem->set_child_text(nodeContent);
+#endif
 	}
 
 	return pSubElem;
@@ -597,7 +605,7 @@
 		}
 
 		// Go through the subnodes
-		Node::NodeList childNodes = pRootElem->get_children();
+		const Node::NodeList childNodes = pRootElem->get_children();
 		if (childNodes.empty() == false)
 		{
 			for (Node::NodeList::const_iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
@@ -726,16 +734,16 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -797,7 +805,7 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
@@ -805,10 +813,10 @@
 
 	string indexName, indexLocation;
 
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -842,16 +850,16 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -884,7 +892,7 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
@@ -896,10 +904,10 @@
 	bool enableMinDate = false, enableMaxDate = false;
 
 	// Load the query's properties
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1126,17 +1134,17 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
 	// Load the label's properties
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1162,17 +1170,17 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
 	// Load the colour RGB components
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1206,16 +1214,16 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1259,7 +1267,7 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
@@ -1268,10 +1276,10 @@
 	IndexableLocation location;
 
 	// Load the indexable location's properties
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1314,17 +1322,17 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
 	}
 
 	// Load the file patterns list
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1360,7 +1368,7 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
@@ -1369,10 +1377,10 @@
 	string name, value;
 
 	// Load the plugin parameters' values 
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1403,7 +1411,7 @@
 		return false;
 	}
 
-	Node::const_NodeList childNodes = pElem->get_children();
+	Node::NodeList childNodes = pElem->get_children();
 	if (childNodes.empty() == true)
 	{
 		return false;
@@ -1412,10 +1420,10 @@
 	CacheProvider cacheProvider;
 
 	// Load the cache provider's properties
-	for (Node::const_NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
+	for (Node::NodeList::iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
 	{
-		const Node *pNode = (*iter);
-		const Element *pChildElem = dynamic_cast<const Element*>(pNode);
+		Node *pNode = (*iter);
+		Element *pChildElem = dynamic_cast<Element*>(pNode);
 		if (pChildElem == NULL)
 		{
 			continue;
@@ -1493,7 +1501,7 @@
 		{
 			addChildElement(pRootElem, "warnaboutversion", (m_warnAboutVersion ? "YES" : "NO"));
 			// User interface position and size
-			pElem = pRootElem->add_child_element("ui");
+			pElem = pRootElem->add_child("ui");
 			if (pElem == NULL)
 			{
 				return false;
@@ -1518,7 +1526,7 @@
 					continue;
 				}
 
-				pElem = pRootElem->add_child_element("extraindex");
+				pElem = pRootElem->add_child("extraindex");
 				if (pElem == NULL)
 				{
 					return false;
@@ -1533,7 +1541,7 @@
 				// Only save those whose group was collapsed
 				if (channelIter->second == false)
 				{
-					pElem = pRootElem->add_child_element("channel");
+					pElem = pRootElem->add_child("channel");
 					if (pElem == NULL)
 					{
 						return false;
@@ -1545,7 +1553,7 @@
 			for (map<string, QueryProperties>::iterator queryIter = m_queries.begin();
 				queryIter != m_queries.end(); ++queryIter)
 			{
-				pElem = pRootElem->add_child_element("storedquery");
+				pElem = pRootElem->add_child("storedquery");
 				if (pElem == NULL)
 				{
 					return false;
@@ -1594,7 +1602,7 @@
 			// Labels
 			for (set<string>::iterator labelIter = m_labels.begin(); labelIter != m_labels.end(); ++labelIter)
 			{
-				pElem = pRootElem->add_child_element("label");
+				pElem = pRootElem->add_child("label");
 				if (pElem == NULL)
 				{
 					return false;
@@ -1606,7 +1614,7 @@
 			// Enable terms suggestion
 			addChildElement(pRootElem, "suggestterms", (m_suggestQueryTerms ? "YES" : "NO"));
 			// New results colour
-			pElem = pRootElem->add_child_element("newresults");
+			pElem = pRootElem->add_child("newresults");
 			if (pElem == NULL)
 			{
 				return false;
@@ -1618,7 +1626,7 @@
 			snprintf(numStr, 64, "%u", m_newResultsColourBlue);
 			addChildElement(pElem, "blue", numStr);
 			// Proxy
-			pElem = pRootElem->add_child_element("proxy");
+			pElem = pRootElem->add_child("proxy");
 			if (pElem == NULL)
 			{
 				return false;
@@ -1632,7 +1640,7 @@
 			for (set<IndexableLocation>::iterator locationIter = m_indexableLocations.begin();
 				locationIter != m_indexableLocations.end(); ++locationIter)
 			{
-				pElem = pRootElem->add_child_element("indexable");
+				pElem = pRootElem->add_child("indexable");
 				if (pElem == NULL)
 				{
 					return false;
@@ -1641,7 +1649,7 @@
 				addChildElement(pElem, "monitor", (locationIter->m_monitor ? "YES" : "NO"));
 			}
 			// File patterns
-			pElem = pRootElem->add_child_element("patterns");
+			pElem = pRootElem->add_child("patterns");
 			if (pElem == NULL)
 			{
 				return false;
@@ -1661,7 +1669,7 @@
 					continue;
 				}
 
-				pElem = pRootElem->add_child_element("pluginparameters");
+				pElem = pRootElem->add_child("pluginparameters");
 				if (pElem == NULL)
 				{
 					return false;
--- a/IndexSearch/OpenSearchParser.cpp
+++ b/IndexSearch/OpenSearchParser.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2005-2024 Fabrice Colin
+ *  Copyright 2005-2009 Fabrice Colin
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -44,11 +44,15 @@
 	const Element *pElem = dynamic_cast<const Element*>(pNode);
 	if (pElem != NULL)
 	{
-		const TextNode *pText = pElem->get_first_child_text();
+#ifdef HAS_LIBXMLPP026
+		const TextNode *pText = pElem->get_child_content();
+#else
+		const TextNode *pText = pElem->get_child_text();
+#endif
 		if (pText == NULL)
 		{
 			// Maybe the text is given as CDATA
-			Node::const_NodeList childNodes = pNode->get_children();
+			const Node::NodeList childNodes = pNode->get_children();
 			if (childNodes.size() == 1)
 			{
 				// Is it CDATA ?
@@ -136,7 +140,7 @@
 		{
 			if (rootNodeName == "rss")
 			{
-				Node::NodeList rssChildNodes = pRootElem->get_children();
+				const Node::NodeList rssChildNodes = pRootElem->get_children();
 				for (Node::NodeList::const_iterator rssIter = rssChildNodes.begin();
 					rssIter != rssChildNodes.end(); ++rssIter)
 				{
@@ -183,7 +187,7 @@
 		}
 
 		// Go through the subnodes
-		Node::NodeList childNodes = pRootElem->get_children();
+		const Node::NodeList childNodes = pRootElem->get_children();
 		for (Node::NodeList::const_iterator iter = childNodes.begin();
 			iter != childNodes.end(); ++iter)
 		{
@@ -223,7 +227,7 @@
 
 			// Go through the item's subnodes
 			ustring title, url, extract;
-			Node::NodeList itemChildNodes = pChildNode->get_children();
+			const Node::NodeList itemChildNodes = pChildNode->get_children();
 			for (Node::NodeList::const_iterator itemIter = itemChildNodes.begin();
 				itemIter != itemChildNodes.end(); ++itemIter)
 			{
@@ -349,7 +353,7 @@
 		}
 
 		// Go through the subnodes
-		Node::NodeList childNodes = pRootElem->get_children();
+		const Node::NodeList childNodes = pRootElem->get_children();
 		if (childNodes.empty() == false)
 		{
 			for (Node::NodeList::const_iterator iter = childNodes.begin(); iter != childNodes.end(); ++iter)
--- a/IndexSearch/ResultsExporter.cpp
+++ b/IndexSearch/ResultsExporter.cpp
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2007-2024 Fabrice Colin
+ *  Copyright 2007 Fabrice Colin
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -39,10 +39,14 @@
 		return NULL;
 	}
 
-	Element *pSubElem = pElem->add_child_element(nodeName);
+	Element *pSubElem = pElem->add_child(nodeName);
 	if (pSubElem != NULL)
 	{
-		pSubElem->set_first_child_text(nodeContent);
+#ifdef HAS_LIBXMLPP026
+		pSubElem->set_child_content(nodeContent);
+#else
+		pSubElem->set_child_text(nodeContent);
+#endif
 	}
 
 	return pSubElem;
@@ -201,7 +205,7 @@
 	pRootElem->set_attribute("xmlns:atom", "http://www.w3.org/2005/Atom");
 
 	// User interface position and size
-	m_pChannelElem = pRootElem->add_child_element("channel");
+	m_pChannelElem = pRootElem->add_child("channel");
 	if (m_pChannelElem == NULL)
 	{
 		return false;
@@ -246,7 +250,7 @@
 		return false;
 	}
 
-	Element *pElem = m_pChannelElem->add_child_element("item");
+	Element *pElem = m_pChannelElem->add_child("item");
 	addChildElement(pElem, "title", docInfo.getTitle());
 	addChildElement(pElem, "link", docInfo.getLocation());
 	addChildElement(pElem, "description", FilterUtils::stripMarkup(docInfo.getExtract()));
--- a/README
+++ b/README
@@ -512,8 +512,8 @@
 gtkmm							3.24
 http://www.gtkmm.org/
 
-libxml++						3.2.0
-https://github.com/libxmlplusplus/libxmlplusplus/
+libxml++						2.12.0
+http://libxmlplusplus.sourceforge.net/
 
 libexttextcat						3.2
 http://cgit.freedesktop.org/libreoffice/libexttextcat/
--- a/configure.ac
+++ b/configure.ac
@@ -372,7 +372,7 @@
     [],[PKG_CHECK_MODULES(GMIME, gmime-2.6 >= 2.5 )] )
 AC_SUBST(GMIME_CFLAGS)
 AC_SUBST(GMIME_LIBS)
-PKG_CHECK_MODULES(XML, libxml++-3.0 >= 3.2 )
+PKG_CHECK_MODULES(XML, libxml++-2.6 >= 2.12 )
 AC_SUBST(XML_CFLAGS)
 AC_SUBST(XML_LIBS)
 INDEX_CFLAGS="$XAPIAN_CFLAGS"
--- a/pinot.spec.in
+++ b/pinot.spec.in
@@ -17,11 +17,11 @@
 URL: https://github.com/FabriceColin/pinot
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: xapian-core-libs >= 1.4.10, libexttextcat, sqlite >= 3.3.1, libcurl >= 7.13, gmime >= 2.6
-Requires: libxml++30 >= 3.2, shared-mime-info, gtkmm30 >= 3.24
+Requires: libxml++ >= 2.12, shared-mime-info, gtkmm30 >= 3.24
 Requires: taglib >= 1.4, exiv2-libs >= 0.18, unzip, antiword, unrtf, %{pftotext_pkg}
 #Suggests: xapian-omega
 BuildRequires: xapian-core-devel >= 1.4.10, libuuid-devel, libexttextcat-devel, sqlite-devel >= 3.3.1, libcurl-devel >= 7.13, gmime-devel >= 2.6, boost-devel >= 1.75
-BuildRequires: libxml++30-devel >= 3.2, gtkmm30-devel >= 3.24, openssl-devel, gettext-devel, desktop-file-utils, help2man
+BuildRequires: libxml++-devel >= 2.12, gtkmm30-devel >= 3.24, openssl-devel, gettext-devel, desktop-file-utils, help2man
 BuildRequires: taglib-devel >= 1.4, exiv2-devel >= 0.18
 BuildRequires: gcc-c++
 %if 0%{?_with_libarchive:1}
