- foreach ($child->attributes as $attr) {
- if ($attr->namespaceURI == 'http://template.sesse.net/' && $attr->name == 'id') {
- $id = $attr->value;
- if ($clean) {
- $child->removeAttributeNode($attr);
- $replace_child = 1;
- }
- }
+ $id_node = $child->getAttributeNodeNS('http://template.sesse.net/', 'id');
+ if (isset($id_node)) {
+ $id = $id_node->value;
+ if ($clean) {
+ $child->removeAttributeNode($id_node);
+ $replace_child = 1;
+ }