Skip to content

Commit

Permalink
strip namespaces from xml element names
Browse files Browse the repository at this point in the history
  • Loading branch information
TomK committed Sep 14, 2023
1 parent c6ce1aa commit f50b6ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/PayPal/Core/PPUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static function xmlNodeToArray($node)
$child = $children->item($i);
if ($child !== null) {
if ($child->childNodes->item(0) instanceof \DOMText) {
$result[$i]['name'] = $child->nodeName;
$result[$i]['name'] = last(explode(':',$child->nodeName));
$result[$i]['text'] = $child->childNodes->item(0)->nodeValue;
if ($child->hasAttributes()) {
foreach ($child->attributes as $k => $v) {
Expand All @@ -131,7 +131,7 @@ private static function xmlNodeToArray($node)
}
}
} else if (!in_array($child->nodeName, $result)) {
$result[$i]['name'] = $child->nodeName;
$result[$i]['name'] = last(explode(':',$child->nodeName));
$result[$i]['children'] = PPUtils::xmlNodeToArray($child);

if ($child->hasAttributes()) {
Expand Down

0 comments on commit f50b6ed

Please sign in to comment.