From: sgunderson@bigfoot.com <> Date: Wed, 21 Sep 2011 19:28:41 +0000 (+0200) Subject: Fix namespace support for t:id in C++0x. X-Git-Url: https://git.sesse.net/?p=xml-template;a=commitdiff_plain;h=eb5498b74048d0ae51ace918e4d06fcc12264ec4 Fix namespace support for t:id in C++0x. --- diff --git a/c++0x/simple.cpp b/c++0x/simple.cpp index c95bc43..69480e9 100644 --- a/c++0x/simple.cpp +++ b/c++0x/simple.cpp @@ -37,11 +37,10 @@ class Substitute : public Directive { // Find the ID, if any. string id; for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) { - // FIXME: namespace - if (strcmp(reinterpret_cast(attr->name), "id") != 0) { - continue; + if (strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && + strcmp(reinterpret_cast(attr->name), "id") == 0) { + id = reinterpret_cast(xmlNodeGetContent(attr->children)); } - id = reinterpret_cast(xmlNodeGetContent(attr->children)); } // Check all substitutions to see if we found anything appropriate.