X-Git-Url: https://git.sesse.net/?p=xml-template;a=blobdiff_plain;f=c%2B%2B0x%2Fxml-template.cpp;h=317a561779fab53a7177d8376e1bbd37de585909;hp=5bbcb9b5dbeec7079a1b436118fc3f7a858eaaeb;hb=cc0c274ab48363f5a590bcd1b283d7aec01aeae7;hpb=052b584d7b60fd9be246d3fcf8bdefdead60d35c diff --git a/c++0x/xml-template.cpp b/c++0x/xml-template.cpp index 5bbcb9b..317a561 100644 --- a/c++0x/xml-template.cpp +++ b/c++0x/xml-template.cpp @@ -196,13 +196,13 @@ void Substitute::process(xmlNode *node, bool clean) // Attribute substitution. if (begins_with(it.first, tag + "/")) { const xmlChar *attr_key = reinterpret_cast( - it.first.substr(tag.size() + 1).c_str()); + it.first.c_str() + tag.size() + 1); const xmlChar *attr_value = reinterpret_cast( 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( - it.first.substr(tag.size() + 2).c_str()); + it.first.c_str() + tag.size() + 2); const xmlChar *attr_value = reinterpret_cast( it.second->get_contents().c_str()); xmlSetProp(child, attr_key, attr_value);