Home > Back-end >  Generate Xml with Js in Codeigniter?
Generate Xml with Js in Codeigniter?

Time:11-12

I am having problem with creating xml with codeigniter any help please! here is what im doing

$this->load->helper('xml');
$data['settings'] = $this->settings_model->getSettings();
$string = $this->load->view('sitemap', $data);
$string = '<p>Here is a paragraph & an entity (&#123;).</p>';
$string = xml_convert($string);
echo $string;

CodePudding user response:

here you go solution with js

var xmltext = "str";
   var filename = "finance.xml";
   var pom = document.createElement('a');
   var bb = new Blob([xmltext], {type: 'text/plain'});

   pom.setAttribute('href', window.URL.createObjectURL(bb));
   pom.setAttribute('download', filename);

   pom.dataset.downloadurl = ['text/plain', pom.download, pom.href].join(':');
   pom.draggable = true;
   pom.classList.add('dragout');

   pom.click();
  • Related