Magento file: lib/Zend/XmlRpc/Generator/XmlWriter.php

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

Magento folder: lib/Zend/XmlRpc/Generator/
Magento file: lib/Zend/XmlRpc/Generator/XmlWriter.php

  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_XmlRpc
  17. * @subpackage Generator
  18. * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: XmlWriter.php 20785 2010-01-31 09:43:03Z mikaelkael $
  21. */
  22. /**
  23. * @var Zend_XmlRpc_Generator_GeneratorAbstract
  24. */
  25. #require_once 'Zend/XmlRpc/Generator/GeneratorAbstract.php';
  26. /**
  27. * XML generator adapter based on XMLWriter
  28. */
  29. class Zend_XmlRpc_Generator_XmlWriter extends Zend_XmlRpc_Generator_GeneratorAbstract
  30. {
  31. /**
  32. * XMLWriter instance
  33. *
  34. * @var XMLWriter
  35. */
  36. protected $_xmlWriter;
  37. /**
  38. * Initialized XMLWriter instance
  39. *
  40. * @return void
  41. */
  42. protected function _init()
  43. {
  44. $this->_xmlWriter = new XMLWriter();
  45. $this->_xmlWriter->openMemory();
  46. $this->_xmlWriter->startDocument('1.0', $this->_encoding);
  47. }
  48. /**
  49. * Open a new XML element
  50. *
  51. * @param string $name XML element name
  52. * @return void
  53. */
  54. protected function _openElement($name)
  55. {
  56. $this->_xmlWriter->startElement($name);
  57. }
  58. /**
  59. * Write XML text data into the currently opened XML element
  60. *
  61. * @param string $text XML text data
  62. * @return void
  63. */
  64. protected function _writeTextData($text)
  65. {
  66. $this->_xmlWriter->text($text);
  67. }
  68. /**
  69. * Close an previously opened XML element
  70. *
  71. * @param string $name
  72. * @return void
  73. */
  74. protected function _closeElement($name)
  75. {
  76. $this->_xmlWriter->endElement();
  77. return $this;
  78. }
  79. public function saveXml()
  80. {
  81. return $this->_xmlWriter->flush(false);
  82. }
  83. }
`Reply Or Comment!
Please LogIn to Reply!