bool processed = false;
if (child->type == XML_ELEMENT_NODE) {
- xmlElement *elem = reinterpret_cast<xmlElement *>(child);
-
// Find the ID, if any.
string id;
-#if 0
- for (xmlAttribute *attr = elem->attributes; attr != NULL; attr = attr->nexth) {
- // FIXME: namespace
- if (strcmp(reinterpret_cast<const char *>(attr->name), "id") != 0) {
- continue;
+ for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) {
+ if (strcmp(reinterpret_cast<const char *>(attr->ns->href), "http://template.sesse.net/") == 0 &&
+ strcmp(reinterpret_cast<const char *>(attr->name), "id") == 0) {
+ id = reinterpret_cast<const char *>(xmlNodeGetContent(attr->children));
}
- id = xmlNodeGetContent(attr->content);
}
-#endif
// Check all substitutions to see if we found anything appropriate.
for (auto it : substitution_map) {
if (it.first == reinterpret_cast<const char *>(child->name) ||
- (!id.empty() && ("#" + it.first) == id)) {
+ (!id.empty() && it.first == ("#" + id))) {
it.second->process(child, clean);
processed = true;
break;