. * * @category Output * @package StatusNet * @author Evan Prodromou * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } /** * Create in-memory XML * * @category Output * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ * @see Action * @see HTMLOutputter */ class XMLStringer extends XMLOutputter { function __construct($indent=false) { $this->xw = new XMLWriter(); $this->xw->openMemory(); $this->xw->setIndent($indent); } function getString() { return $this->xw->outputMemory(); } // utility for quickly creating XML-strings static function estring($tag, $attrs=null, $content=null) { $xs = new XMLStringer(); $xs->element($tag, $attrs, $content); return $xs->getString(); } }