Skip to content

Commit 363e232

Browse files
committed
Reduce duplicate namespaces
1 parent 44d4187 commit 363e232

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/XML/CanonicalizableElementTrait.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,13 @@ public function processTransforms(
141141
$xpathValue = $xpath->getContent()->getValue();
142142
$arXPath['query'] = '(.//. | .//@* | .//namespace::*)[' . $xpathValue . ']';
143143

144-
// $arXpath['namespaces'] = $xpath->getNamespaces();
145-
// TODO: review if $nsnode->localName is equivalent to the keys in getNamespaces()
146-
// $nslist = $xp->query('./namespace::*', $node);
147-
// foreach ($nslist as $nsnode) {
148-
// if ($nsnode->localName != "xml") {
149-
// $arXPath['namespaces'][$nsnode->localName] = $nsnode->nodeValue;
150-
// }
151-
// }
144+
$arXpath['namespaces'] = $xpath->getNamespaces();
145+
$nslist = $xp->query('./namespace::*', $node);
146+
foreach ($nslist as $nsnode) {
147+
if ($nsnode->localName != "xml") {
148+
$arXPath['namespaces'][$nsnode->localName] = $nsnode->nodeValue;
149+
}
150+
}
152151
}
153152
break;
154153
}

0 commit comments

Comments
 (0)