SimpleExcel\Writer\XMLWriter::setData PHP Method

setData() public method

Set XML data
public setData ( array $values ) : void
$values array An array contains ordered value of arrays for all fields
return void
    public function setData($values)
    {
        if (!is_array($values)) {
            $values = array($values);
        }
        $this->tabl_data = "";
        // reset the xml data.
        // append values as rows
        foreach ($values as $value) {
            $this->addRow($value);
        }
    }

Usage Example

 /**
  * Change writer type to convert to another format
  * 
  * @param    string  $filetype   Set the filetype of the file which will be written (XML/CSV/TSV/HTML/JSON)
  */
 public function convertTo($filetype)
 {
     $this->constructWriter($filetype);
     $this->writer->setData($this->parser->getField());
 }