]> git.sesse.net Git - xml-template/commitdiff
Fix namespace support for t:id in C++0x.
authorsgunderson@bigfoot.com <>
Wed, 21 Sep 2011 19:28:41 +0000 (21:28 +0200)
committersgunderson@bigfoot.com <>
Wed, 21 Sep 2011 19:28:41 +0000 (21:28 +0200)
c++0x/simple.cpp

index c95bc437c6bc81fc51d5faf8d613d9485b66683b..69480e9c4abf21bb3ea619a554d7c2e77c6fc40c 100644 (file)
@@ -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<const char *>(attr->name), "id") != 0) {
-                                               continue;
+                                       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 = reinterpret_cast<const char *>(xmlNodeGetContent(attr->children));
                                }
 
                                // Check all substitutions to see if we found anything appropriate.