[packages/libxml++5] - added htmlReadDoc.patch (from upstream) - rel 2

witekfl witekfl at pld-linux.org
Sat Dec 25 12:43:45 CET 2021


commit f81d8c56e2ec4d2a27529ce5612c1038d17b7ecf
Author: Witold Filipczyk <witekfl at poczta.onet.pl>
Date:   Sat Dec 25 12:41:41 2021 +0100

    - added htmlReadDoc.patch (from upstream)
    - rel 2

 htmlReadDoc.patch | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 libxml++5.spec    |  4 ++-
 2 files changed, 81 insertions(+), 1 deletion(-)
---
diff --git a/libxml++5.spec b/libxml++5.spec
index 350a694..9e840d9 100644
--- a/libxml++5.spec
+++ b/libxml++5.spec
@@ -6,11 +6,12 @@ Summary:	C++ interface for working with XML files
 Summary(pl.UTF-8):	Interfejs C++ do pracy z plikami XML
 Name:		libxml++5
 Version:	5.0.1
-Release:	1
+Release:	2
 License:	LGPL v2.1
 Group:		Libraries
 Source0:	https://download.gnome.org/sources/libxml++/5.0/libxml++-%{version}.tar.xz
 # Source0-md5:	b95f8c7cd1068bd7b88111340aba6238
+Patch0:		htmlReadDoc.patch
 URL:		http://libxmlplusplus.sourceforge.net/
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake >= 1:1.11
@@ -85,6 +86,7 @@ libxml++ - przykładowe programy.
 
 %prep
 %setup -q -n libxml++-%{version}
+%patch0 -p1
 
 %build
 mm-common-prepare --copy --force
diff --git a/htmlReadDoc.patch b/htmlReadDoc.patch
new file mode 100644
index 0000000..4923243
--- /dev/null
+++ b/htmlReadDoc.patch
@@ -0,0 +1,78 @@
+commit f23e0ff9828cd4036870ed8f2c8249cad7b3089a
+Author: Kjell Ahlstedt <kjellahlstedt at gmail.com>
+Date:   Wed Jun 9 15:46:01 2021 +0200
+
+    Document, Node: Recognize HTML documents
+    
+    Documents created with htmlReadDoc() have xmlElementType ==
+    XML_HTML_DOCUMENT_NODE. Handle that type like the XML_DOCUMENT_NODE
+    type. htmlDoc* is an alias for xmlDoc*.
+    Fixes #23
+
+diff --git a/libxml++/document.cc b/libxml++/document.cc
+index be1456a..da0a8f5 100644
+--- a/libxml++/document.cc
++++ b/libxml++/document.cc
+@@ -56,6 +56,7 @@ void find_wrappers(xmlNode* node, NodeMap& node_map)
+     case XML_ATTRIBUTE_DECL:
+     case XML_ENTITY_DECL:
+     case XML_DOCUMENT_NODE:
++    case XML_HTML_DOCUMENT_NODE:
+       has_attributes = false;
+       break;
+     default:
+@@ -102,6 +103,7 @@ void remove_found_wrappers(xmlNode* node, NodeMap& node_map)
+     case XML_ATTRIBUTE_DECL:
+     case XML_ENTITY_DECL:
+     case XML_DOCUMENT_NODE:
++    case XML_HTML_DOCUMENT_NODE:
+       has_attributes = false;
+       break;
+     default:
+@@ -457,6 +459,7 @@ int Document::process_xinclude(bool generate_xinclude_nodes, bool fixup_base_uri
+       delete reinterpret_cast<Dtd*>(node);
+       break;
+     case XML_DOCUMENT_NODE:
++    case XML_HTML_DOCUMENT_NODE:
+       delete reinterpret_cast<Document*>(node);
+       break;
+     default:
+diff --git a/libxml++/nodes/node.cc b/libxml++/nodes/node.cc
+index 1f04b55..15680ea 100644
+--- a/libxml++/nodes/node.cc
++++ b/libxml++/nodes/node.cc
+@@ -449,7 +449,9 @@ ustring Node::eval_to_string(const ustring& xpath, const PrefixNsMap& namespaces
+ 
+ ustring Node::get_namespace_prefix() const
+ {
+-  if(impl_->type == XML_DOCUMENT_NODE || impl_->type == XML_ENTITY_DECL)
++  if(impl_->type == XML_DOCUMENT_NODE ||
++     impl_->type == XML_HTML_DOCUMENT_NODE ||
++     impl_->type == XML_ENTITY_DECL)
+   {
+     //impl_ is actually of type xmlDoc or xmlEntity, instead of just xmlNode.
+     //libxml does not always use GObject-style inheritance, so xmlDoc and
+@@ -475,6 +477,7 @@ ustring Node::get_namespace_prefix() const
+ ustring Node::get_namespace_uri() const
+ {
+   if(impl_->type == XML_DOCUMENT_NODE ||
++     impl_->type == XML_HTML_DOCUMENT_NODE ||
+      impl_->type == XML_ENTITY_DECL ||
+      impl_->type == XML_ATTRIBUTE_DECL)
+   {
+@@ -591,6 +594,7 @@ void Node::create_wrapper(xmlNode* node)
+       break;
+     }
+     case XML_DOCUMENT_NODE:
++    case XML_HTML_DOCUMENT_NODE:
+     {
+       // do nothing. For Documents it's the wrapper that is the owner.
+       break;
+@@ -639,6 +643,7 @@ void Node::free_wrappers(xmlNode* node)
+       node->_private = nullptr;
+       return;
+     case XML_DOCUMENT_NODE:
++    case XML_HTML_DOCUMENT_NODE:
+       //Do not free now. The Document is usually the one who owns the caller.
+       return;
+     default:
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libxml++5.git/commitdiff/f81d8c56e2ec4d2a27529ce5612c1038d17b7ecf



More information about the pld-cvs-commit mailing list