comment on xmlns and DOCTYPE bug v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 21 Feb 2021 23:52:46 +0100
branchv_0
changeset 2 4b938619848b
parent 1 db5418b04c63
child 3 b30965489f42
comment on xmlns and DOCTYPE bug
src/XMLDocumentConstructor.h
--- a/src/XMLDocumentConstructor.h	Sun Feb 21 22:11:49 2021 +0100
+++ b/src/XMLDocumentConstructor.h	Sun Feb 21 23:52:46 2021 +0100
@@ -58,8 +58,9 @@
 				} else {
 					element = parent->add_child(elementName);
 				}
-
+				
 				for (size_t i = 0; i < htmlNode->v.element.attributes.length; i++) {
+					// FIXME: if the xmlns was set in exportTo() according to the DOCTYPE, we should not add xmlns attribute here (otherwise we would have two xmlns attributes and thus invalid xml)
 					GumboAttribute* htmlAttribute = static_cast<GumboAttribute*> (htmlNode->v.element.attributes.data[i]);
 					element->set_attribute(htmlAttribute->name, htmlAttribute->value);
 				}