X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FXML.php;h=e06a92d25edf9a5a3d73951431064eaafb1f29c4;hb=5456ef01855f7f6bda4f137980df5a1793712bb1;hp=03e17a55404bba4a4ec99a63219595ab6346d74e;hpb=7211fc4f1ac33819ed0543ac65f9a075250c3190;p=friendica.git diff --git a/src/Util/XML.php b/src/Util/XML.php index 03e17a5540..e06a92d25e 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -446,4 +446,19 @@ class XML return $first_item->nodeValue; } + + public static function getFirstAttributes($xpath, $element, $context = null) + { + $result = $xpath->query($element, $context); + if (!is_object($result)) { + return false; + } + + $first_item = $result->item(0); + if (!is_object($first_item)) { + return false; + } + + return $first_item->attributes; + } }