Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / XmlRpc / Generator / XmlWriter.php
blob0196ef8a5c616692685050d73702f7f7b1a08dcb
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\XmlRpc\Generator;
12 /**
13 * XML generator adapter based on XMLWriter
15 class XmlWriter extends AbstractGenerator
17 /**
18 * XMLWriter instance
20 * @var XMLWriter
22 protected $xmlWriter;
24 /**
25 * Initialized XMLWriter instance
27 * @return void
29 protected function _init()
31 $this->xmlWriter = new \XMLWriter();
32 $this->xmlWriter->openMemory();
33 $this->xmlWriter->startDocument('1.0', $this->encoding);
37 /**
38 * Open a new XML element
40 * @param string $name XML element name
41 * @return void
43 protected function _openElement($name)
45 $this->xmlWriter->startElement($name);
48 /**
49 * Write XML text data into the currently opened XML element
51 * @param string $text XML text data
52 * @return void
54 protected function _writeTextData($text)
56 $this->xmlWriter->text($text);
59 /**
60 * Close an previously opened XML element
62 * @param string $name
63 * @return XmlWriter
65 protected function _closeElement($name)
67 $this->xmlWriter->endElement();
69 return $this;
72 /**
73 * Emit XML document
75 * @return string
77 public function saveXml()
79 return $this->xmlWriter->flush(false);