How can I add an xml namespace
declaration to my xml_document
using pugixml?
I tried this, which results in a invalid xml (invalid char ":", says my validator):
xml_document doc;
auto declarationNode = doc.append_child(node_declaration);
declarationNode.append_attribute("xmlns\:xsi") = "http://www.w3.org/2001/XMLSchema-instance";
I guess a namespace declaration is not the same as an xml attribute.
But how can I add that namespace declaration?