// Check all substitutions to see if we found anything appropriate.
string tag = reinterpret_cast<const char *>(child->name);
for (auto it : substitution_map) {
// Check all substitutions to see if we found anything appropriate.
string tag = reinterpret_cast<const char *>(child->name);
for (auto it : substitution_map) {
// Attribute substitution.
if (begins_with(it.first, tag + "/")) {
// Attribute substitution.
if (begins_with(it.first, tag + "/")) {
const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(
it.first.c_str() + tag.size() + 1);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(
const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(
it.first.c_str() + tag.size() + 1);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(
xmlSetProp(child, attr_key, attr_value);
} else if ((!id.empty() && begins_with(it.first, "#" + id + "/"))) {
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.c_str() + id.size() + 2);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(
const xmlChar *attr_key = reinterpret_cast<const xmlChar *>(
it.first.c_str() + id.size() + 2);
const xmlChar *attr_value = reinterpret_cast<const xmlChar *>(