Location: PHPKode > scripts > PalmDesktop > cvt_memopad.php
<?php
/**
 * Convert palm memopad files to XML files
 * @author CPKS
 * @version 1.0
 * @package palmdata
 */
require 'memofile.php';

/**
 * Dump filename.MPA to filename.xml
 * @param string $filename
 */
function cvt_memos($filename) {
  $outfile = pathinfo($filename);
	$outfile = $outfile['dirname'] . '/' . $outfile['filename'] . '.xml';
  $pf = new palmdata\memoFile($filename);
	$x = new \XMLWriter;
	$x->openURI($outfile);
	$x->setIndent(TRUE);
	$pf->xdump($x, 'memodata', 'memos');
}

$progname = array_shift($argv);

while ($fn = array_shift($argv)) {
  try {
		cvt_memos($fn);
		echo 'converted ', basename($fn), PHP_EOL;
	}
	catch (\Exception $e) {
	  echo "Exception caught whilst processing $fn:\n";
		echo $e->getMessage();
	}
}
Return current item: PalmDesktop