]> git.sesse.net Git - xml-template/blobdiff - php/xml-template.php
Horrible workaround for PHP's namespace bugs.
[xml-template] / php / xml-template.php
index 91dfa8d45ad1017625b9c6b17dd9e473d5fbfaf1..d7e8aef7428d4817fd03b3121be80271bcc20498 100644 (file)
@@ -37,7 +37,10 @@ function XML_Template_process($node, $obj, $clean = 1)
                                $attrs = $child->attributes();
                                if (isset($attrs)) {
                                        foreach ($child->attributes() as $attr) {
-                                               if ($attr->namespace_uri() == 'http://template.sesse.net/' && $attr->name() == 'id') {
+                                               // PHP's DOMXML module forgets the prefix information when
+                                               // cloning nodes, so we'll have to avoid the namespace check
+                                               // here, unfortunately
+                                               if (/* $attr->namespace_uri() == 'http://template.sesse.net/' && */ $attr->name() == 'id') {
                                                        $id = $attr->value();
                                                        if ($clean) {
                                                                // FIXME: this won't work since we're not in the right namespace