コード例 #1
0
 /**
  */
 public function testConstruct()
 {
     // Memory
     $object = new XMLWriter();
     $object->startElement('element');
     $object->text('AAA');
     $object->endElement();
     $this->assertEquals('<element>AAA</element>' . chr(10), $object->getData());
     // Disk
     $object = new XMLWriter(XMLWriter::STORAGE_DISK);
     $object->startElement('element');
     $object->text('BBB');
     $object->endElement();
     $this->assertEquals('<element>BBB</element>' . chr(10), $object->getData());
 }
コード例 #2
0
 private function writeAllocation(XMLWriter $oXML, $piIdTask, $piIdResource)
 {
     $oXML->startElement('allocation');
     $oXML->writeAttribute('task-id', $piIdTask);
     $oXML->writeAttribute('resource-id', $piIdResource);
     $oXML->writeAttribute('function', 'Default:0');
     $oXML->writeAttribute('responsible', 'true');
     $oXML->writeAttribute('load', '100.0');
     $oXML->endElement();
 }