# HG changeset patch # User František Kučera # Date 1613947966 -3600 # Node ID 4b938619848b2ded1993216c29563a34947781a0 # Parent db5418b04c63769c97618efbdcfec3df020a2923 comment on xmlns and DOCTYPE bug diff -r db5418b04c63 -r 4b938619848b 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 (htmlNode->v.element.attributes.data[i]); element->set_attribute(htmlAttribute->name, htmlAttribute->value); }