// Attribute substitution.
if (begins_with(it.first, tag + "/")) {
const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(
- it.first.substr(tag.size() + 1).c_str());
+ it.first.c_str() + tag.size() + 1);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(
it.second->get_contents().c_str());
xmlSetProp(child, attr_key, attr_value);
} else if ((!id.empty() && begins_with(it.first, "#" + id + "/"))) {
const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(
- it.first.substr(tag.size() + 2).c_str());
+ it.first.c_str() + tag.size() + 2);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(
it.second->get_contents().c_str());
xmlSetProp(child, attr_key, attr_value);