From 67206b7904b2a8ad5ce161ad3fc746c8bc025feb Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 11 Nov 2023 20:32:00 -0500 Subject: [PATCH] add function to get just the *value* of the attribute --- app/lib/phast/Parser/XMLParser.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/lib/phast/Parser/XMLParser.inc.php b/app/lib/phast/Parser/XMLParser.inc.php index c7043b0..bfe07a5 100644 --- a/app/lib/phast/Parser/XMLParser.inc.php +++ b/app/lib/phast/Parser/XMLParser.inc.php @@ -163,8 +163,16 @@ } return $str; } + + public function GetAttributeValue($name, $index = 0) : ?string + { + $attr = $this->GetAttribute($name, $index); + if ($attr != null) + return $attr->Value; + return null; + } - public function GetAttribute($name, $index = 0) + public function GetAttribute($name, $index = 0) : ?MarkupAttribute { $i = 0; $last = null;