equal
deleted
inserted
replaced
56 if (parent == nullptr) { |
56 if (parent == nullptr) { |
57 element = document->create_root_node(elementName); |
57 element = document->create_root_node(elementName); |
58 } else { |
58 } else { |
59 element = parent->add_child(elementName); |
59 element = parent->add_child(elementName); |
60 } |
60 } |
61 |
61 |
62 for (size_t i = 0; i < htmlNode->v.element.attributes.length; i++) { |
62 for (size_t i = 0; i < htmlNode->v.element.attributes.length; i++) { |
|
63 // 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) |
63 GumboAttribute* htmlAttribute = static_cast<GumboAttribute*> (htmlNode->v.element.attributes.data[i]); |
64 GumboAttribute* htmlAttribute = static_cast<GumboAttribute*> (htmlNode->v.element.attributes.data[i]); |
64 element->set_attribute(htmlAttribute->name, htmlAttribute->value); |
65 element->set_attribute(htmlAttribute->name, htmlAttribute->value); |
65 } |
66 } |
66 |
67 |
67 for (size_t i = 0; i < htmlNode->v.element.children.length; i++) { |
68 for (size_t i = 0; i < htmlNode->v.element.children.length; i++) { |