diff common-functions.inc @ 6:6c0162497d56

Improved error reporting, and support for multilevel params.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Fri, 20 May 2011 22:28:03 +0200
parents 18aafb1a8986
children 19dfa6f3e2be
line wrap: on
line diff
--- a/common-functions.inc	Fri May 20 13:25:53 2011 +0200
+++ b/common-functions.inc	Fri May 20 22:28:03 2011 +0200
@@ -51,4 +51,13 @@
 	 }
 	 return $out;
 }
+
+function getElementByTagName($obj, $name) {
+  $elems=$obj->getElementsByTagName($name);
+  if ($elems->length != 1) {
+    exit;
+  }
+  $elem=$elems->item(0);
+  return $elem;
+}
 ?>
\ No newline at end of file