diff common-functions.inc @ 12:a20bb1b51aad

Merge.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Tue, 29 May 2012 21:08:23 +0200
parents 19dfa6f3e2be
children 9dab5b96b789
line wrap: on
line diff
--- a/common-functions.inc	Mon May 28 22:57:30 2012 +0200
+++ b/common-functions.inc	Tue May 29 21:08:23 2012 +0200
@@ -60,4 +60,16 @@
   $elem=$elems->item(0);
   return $elem;
 }
+
+function getXmlContent($node)
+{
+  $text=$node->ownerDocument->saveXml($node);
+  $pattern="/^<".$node->tagName."[^>]*>/is";
+  $text=preg_replace($pattern, '' , $text);
+  $pattern='/<\/'.$node->tagName.'[^>]*>$/is';
+  $text=preg_replace($pattern, '' , $text);
+
+  return $text;
+}
+
 ?>
\ No newline at end of file