]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/xmloutputter.php
Added new 'Scroller' plugin from @buttle which aims to replace the out-dated
[quix0rs-gnu-social.git] / lib / xmloutputter.php
index 528f633050570c54b939ebed2b73f513a9a63d10..71d57e2d56647afad12e413dda029a912c6e19bc 100644 (file)
@@ -142,6 +142,15 @@ class XMLOutputter
         $this->elementEnd($tag);
     }
 
+    function elementNS(array $ns, $tag, $attrs=null, $content=null)
+    {
+        $this->elementStartNS($ns, $tag, $attrs);
+        if (!is_null($content)) {
+            $this->xw->text($content);
+        }
+        $this->elementEnd($tag);
+    }
+
     /**
      * output a start tag for an element
      *
@@ -169,6 +178,20 @@ class XMLOutputter
         }
     }
 
+    function elementStartNS(array $ns, $tag, $attrs=null)
+    {
+        reset($ns); // array pointer to 0
+        $uri = key($ns);
+        $this->xw->startElementNS($ns[$uri], $tag, $uri);
+        if (is_array($attrs)) {
+            foreach ($attrs as $name => $value) {
+                $this->xw->writeAttribute($name, $value);
+            }
+        } else if (is_string($attrs)) {
+            $this->xw->writeAttribute('class', $attrs);
+        }
+    }
+
     /**
      * output an end tag for an element
      *
@@ -189,7 +212,7 @@ class XMLOutputter
     {
         static $empty_tag = array('base', 'meta', 'link', 'hr',
                                   'br', 'param', 'img', 'area',
-                                  'input', 'col');
+                                  'input', 'col', 'source');
         // XXX: check namespace
         if (in_array($tag, $empty_tag)) {
             $this->xw->endElement();