From 32a15e16a82ca8382ad39076cd942d6eb8242d55 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Wed, 21 Sep 2011 21:23:59 +0200 Subject: [PATCH] Fix #id handling in the C++0x version. --- c++0x/simple.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/c++0x/simple.cpp b/c++0x/simple.cpp index a5e7894..c95bc43 100644 --- a/c++0x/simple.cpp +++ b/c++0x/simple.cpp @@ -34,24 +34,20 @@ class Substitute : public Directive { bool processed = false; if (child->type == XML_ELEMENT_NODE) { - xmlElement *elem = reinterpret_cast(child); - // Find the ID, if any. string id; -#if 0 - for (xmlAttribute *attr = elem->attributes; attr != NULL; attr = attr->nexth) { + for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) { // FIXME: namespace if (strcmp(reinterpret_cast(attr->name), "id") != 0) { continue; } - id = xmlNodeGetContent(attr->content); + id = reinterpret_cast(xmlNodeGetContent(attr->children)); } -#endif // Check all substitutions to see if we found anything appropriate. for (auto it : substitution_map) { if (it.first == reinterpret_cast(child->name) || - (!id.empty() && ("#" + it.first) == id)) { + (!id.empty() && it.first == ("#" + id))) { it.second->process(child, clean); processed = true; break; -- 2.39.2