Mercurial > SimpleWebPresenter
diff common-functions.inc @ 8:19dfa6f3e2be
Support for scripts.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Sun, 12 Jun 2011 14:15:00 +0200 |
| parents | 6c0162497d56 |
| children | 9dab5b96b789 |
line wrap: on
line diff
--- a/common-functions.inc Fri May 20 23:34:33 2011 +0200 +++ b/common-functions.inc Sun Jun 12 14:15:00 2011 +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
