Source for file XMLPartExporter.class.php

Documentation is available at XMLPartExporter.class.php

  1. <?php
  2. /**
  3. * @since 10/17/05
  4. * @package polyphony.exporter
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: XMLPartExporter.class.php,v 1.6 2007/09/19 14:04:45 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * Exports into XML for use with the XML Importer
  14. *
  15. * @since 10/17/05
  16. * @package polyphony.exporter
  17. *
  18. * @copyright Copyright &copy; 2005, Middlebury College
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  20. *
  21. * @version $Id: XMLPartExporter.class.php,v 1.6 2007/09/19 14:04:45 adamfranco Exp $
  22. */
  23. class XMLPartExporter {
  24. /**
  25. * Constructor
  26. *
  27. * Maintains the xml file.
  28. *
  29. * @param resource
  30. * @access public
  31. * @since 10/17/05
  32. */
  33. function XMLPartExporter ($xmlFile) {
  34. $this->_xml =$xmlFile;
  35. $this->_childExporterList = null;
  36. $this->_childElementList = null;
  37. }
  38.  
  39. /**
  40. * Exporter of All things
  41. *
  42. * @param object HarmoniPart
  43. * @access public
  44. * @since 10/17/05
  45. */
  46. function export ($part) {
  47. $this->_object =$part;
  48. $this->_myId =$this->_object->getId();
  49.  
  50. $pS =$this->_object->getPartStructure();
  51. $pSId =$pS->getId();
  52. $partValue =$this->_object->getValue();
  53.  
  54. fwrite($this->_xml,
  55. "\t\t\t<part ".
  56. "id=\"".$this->_myId->getIdString()."\" ".
  57. "xml:id=\"".$pSId->getIdString()."\">".
  58. "<![CDATA[".$partValue->asString()."]]></part>\n");
  59.  
  60. }
  61. }
  62. ?>

Documentation generated on Wed, 19 Sep 2007 10:28:39 -0400 by phpDocumentor 1.3.0RC3