X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=c%2B%2B11%2Fxml-template.cpp;h=503e5e329d4f7269a8115c1c1df20114705b4819;hb=67503cff975c04009dd3658c50cd9a4bf3a39ec5;hp=61d567fdacca1cf7d4a5ae1cd35951858bb316af;hpb=c1442a39c69a0e27eaf47165e53c801672390acc;p=xml-template diff --git a/c++11/xml-template.cpp b/c++11/xml-template.cpp index 61d567f..503e5e3 100644 --- a/c++11/xml-template.cpp +++ b/c++11/xml-template.cpp @@ -201,7 +201,7 @@ void Substitute::process(xmlNode *node, bool clean) xmlSetProp(child, attr_key, attr_value); } else if ((!id.empty() && begins_with(it.first, "#" + id + "/"))) { const xmlChar *attr_key = reinterpret_cast( - it.first.c_str() + tag.size() + 2); + it.first.c_str() + id.size() + 2); const xmlChar *attr_value = reinterpret_cast( it.second->get_contents().c_str()); xmlSetProp(child, attr_key, attr_value);